Skip to content

Commit

Permalink
fix: add variable types
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasmacedot authored Nov 4, 2024
1 parent dae1813 commit ecc67c0
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion _outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ output "cloudfront_zone_id" {

output "aws_cloudfront_origin_access_identity" {
description = "Define cloudfront origin access identity"
value = aws_cloudfront_origin_access_identity.default.*
value = aws_cloudfront_origin_access_identity.default[*]
}
14 changes: 14 additions & 0 deletions _variables.tf
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
variable "name" {
description = "Name of your ECS service"
type = string
}

variable "cluster_name" {

Check warning on line 6 in _variables.tf

View workflow job for this annotation

GitHub Actions / Lint

variable "cluster_name" is declared but not used
description = "Name of existing ECS Cluster to deploy this app to"
type = string
}

variable "hostnames" {
description = "Hostnames to create DNS record for this app that the cloudfront distribution will accept"
type = list(string)
}

variable "dynamic_custom_error_response" {
Expand All @@ -23,32 +26,39 @@ variable "dynamic_custom_error_response" {
variable "hostname_create" {
description = "Create hostnames in the hosted zone passed?"
default = true
type = bool
}

variable "hosted_zone" {
description = "Existing Hosted Zone domain to add hostnames as DNS records"
type = string
}

variable "alb_cloudfront_key" {
description = "Key generated by terraform-aws-ecs module to allow ALB connection from CloudFront"
type = string
}

variable "alb_dns_name" {
description = "ALB DNS Name that CloudFront will point as origin"
type = string
}

variable "certificate_arn" {
description = "Certificate for this app to use in CloudFront (US), must cover `hostname`."
type = string
}

variable "cloudfront_web_acl_id" {

Check warning on line 52 in _variables.tf

View workflow job for this annotation

GitHub Actions / Lint

variable "cloudfront_web_acl_id" is declared but not used
default = ""
description = "Optional web acl (WAF) to attach to CloudFront"
type = string
}

variable "cloudfront_forward_headers" {
default = ["*"]
description = "Headers to forward to origin from CloudFront"
type = list(string)
}

variable "cloudfront_logging_bucket" {
Expand All @@ -66,21 +76,25 @@ variable "cloudfront_logging_prefix" {
variable "cloudfront_origin_keepalive_timeout" {
default = 5
description = "The amount of time, in seconds, that CloudFront maintains an idle connection with a custom origin server before closing the connection. Valid values are from 1 to 60 seconds."
type = number
}

variable "cloudfront_origin_read_timeout" {
default = 30
description = "The amount of time, in seconds, that CloudFront waits for a response from a custom origin. The value applies both to the time that CloudFront waits for an initial response and the time that CloudFront waits for each subsequent packet. Valid values are from 4 to 60 seconds."
type = number
}

variable "alarm_cloudfront_500_errors_threshold" {
default = 5
description = "Cloudfront 500 Errors rate threshold (use 0 to disable this alarm)"
type = number
}

variable "alarm_sns_topics_us" {
default = []
description = "Alarm topics to create and alert on metrics on US region"
type = list(string)
}

variable "iam_certificate_id" {
Expand Down
2 changes: 1 addition & 1 deletion route53-record.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ resource "aws_route53_record" "hostname" {
name = var.hostnames[count.index]
type = var.record_type
ttl = "300"
records = [element(aws_cloudfront_distribution.default.*.domain_name, 0)]
records = [element(aws_cloudfront_distribution.default[*].domain_name, 0)]
}
2 changes: 0 additions & 2 deletions waf.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ resource "aws_wafv2_web_acl" "waf_cloudfront" {
description = "WAF managed rules for Cloudfront"
scope = "CLOUDFRONT"



default_action {
allow {}
}
Expand Down

0 comments on commit ecc67c0

Please sign in to comment.