diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7e4e7da..b84d048 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/antonbabenko/pre-commit-terraform - rev: v1.96.1 + rev: v1.99.4 hooks: - id: terraform_fmt - id: terraform_wrapper_module_for_each diff --git a/README.md b/README.md index f544d7a..03c2895 100644 --- a/README.md +++ b/README.md @@ -179,14 +179,14 @@ module "acm" { | Name | Version | |------|---------| -| [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | >= 4.40 | +| [terraform](#requirement\_terraform) | >= 1.10 | +| [aws](#requirement\_aws) | >= 6.0 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 4.40 | +| [aws](#provider\_aws) | >= 6.0 | ## Modules @@ -215,6 +215,7 @@ No modules. | [key\_algorithm](#input\_key\_algorithm) | Specifies the algorithm of the public and private key pair that your Amazon issued certificate uses to encrypt data | `string` | `null` | no | | [private\_authority\_arn](#input\_private\_authority\_arn) | Private Certificate Authority ARN for issuing private certificates | `string` | `null` | no | | [putin\_khuylo](#input\_putin\_khuylo) | Do you agree that Putin doesn't respect Ukrainian sovereignty and territorial integrity? More info: https://en.wikipedia.org/wiki/Putin_khuylo! | `bool` | `true` | no | +| [region](#input\_region) | Region to create the resources into | `string` | `null` | no | | [subject\_alternative\_names](#input\_subject\_alternative\_names) | A list of domains that should be SANs in the issued certificate | `list(string)` | `[]` | no | | [tags](#input\_tags) | A mapping of tags to assign to the resource | `map(string)` | `{}` | no | | [validate\_certificate](#input\_validate\_certificate) | Whether to validate certificate by creating Route53 record | `bool` | `true` | no | diff --git a/examples/complete-dns-validation-with-cloudflare/README.md b/examples/complete-dns-validation-with-cloudflare/README.md index 69179c1..af8e3f1 100644 --- a/examples/complete-dns-validation-with-cloudflare/README.md +++ b/examples/complete-dns-validation-with-cloudflare/README.md @@ -23,8 +23,8 @@ Note that this example may create resources which cost money. Run `terraform des | Name | Version | |------|---------| -| [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | >= 4.40 | +| [terraform](#requirement\_terraform) | >= 1.10 | +| [aws](#requirement\_aws) | >= 6.0 | | [cloudflare](#requirement\_cloudflare) | >= 3.4, <=3.32 | ## Providers diff --git a/examples/complete-dns-validation-with-cloudflare/main.tf b/examples/complete-dns-validation-with-cloudflare/main.tf index 157b628..c309692 100644 --- a/examples/complete-dns-validation-with-cloudflare/main.tf +++ b/examples/complete-dns-validation-with-cloudflare/main.tf @@ -5,6 +5,14 @@ locals { domain_name = trimsuffix(local.domain, ".") } +provider "aws" { + alias = "route53" +} + +provider "aws" { + alias = "acm" +} + module "acm" { source = "../../" diff --git a/examples/complete-dns-validation-with-cloudflare/versions.tf b/examples/complete-dns-validation-with-cloudflare/versions.tf index 3177d7c..3f6455b 100644 --- a/examples/complete-dns-validation-with-cloudflare/versions.tf +++ b/examples/complete-dns-validation-with-cloudflare/versions.tf @@ -1,10 +1,10 @@ terraform { - required_version = ">= 1.0" + required_version = ">= 1.10" required_providers { aws = { source = "hashicorp/aws" - version = ">= 4.40" + version = ">= 6.0" } # Terraform v1.0.0 only functional with cloudflare versions less than or equal to 3.33.0 # https://github.com/cloudflare/terraform-provider-cloudflare/issues/2340 diff --git a/examples/complete-dns-validation/README.md b/examples/complete-dns-validation/README.md index 7d50798..5c33103 100644 --- a/examples/complete-dns-validation/README.md +++ b/examples/complete-dns-validation/README.md @@ -23,14 +23,14 @@ Note that this example may create resources which cost money. Run `terraform des | Name | Version | |------|---------| -| [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | >= 4.40 | +| [terraform](#requirement\_terraform) | >= 1.10 | +| [aws](#requirement\_aws) | >= 6.0 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 4.40 | +| [aws](#provider\_aws) | >= 6.0 | ## Modules diff --git a/examples/complete-dns-validation/versions.tf b/examples/complete-dns-validation/versions.tf index fa875db..f648e20 100644 --- a/examples/complete-dns-validation/versions.tf +++ b/examples/complete-dns-validation/versions.tf @@ -1,10 +1,10 @@ terraform { - required_version = ">= 1.0" + required_version = ">= 1.10" required_providers { aws = { source = "hashicorp/aws" - version = ">= 4.40" + version = ">= 6.0" } } } diff --git a/examples/complete-email-validation-with-validation-domain/README.md b/examples/complete-email-validation-with-validation-domain/README.md index 18721d4..92a6571 100644 --- a/examples/complete-email-validation-with-validation-domain/README.md +++ b/examples/complete-email-validation-with-validation-domain/README.md @@ -32,14 +32,14 @@ Note that this example may create resources which cost money. Run `terraform des | Name | Version | |------|---------| -| [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | >= 4.40 | +| [terraform](#requirement\_terraform) | >= 1.10 | +| [aws](#requirement\_aws) | >= 6.0 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 4.40 | +| [aws](#provider\_aws) | >= 6.0 | ## Modules diff --git a/examples/complete-email-validation-with-validation-domain/versions.tf b/examples/complete-email-validation-with-validation-domain/versions.tf index fa875db..f648e20 100644 --- a/examples/complete-email-validation-with-validation-domain/versions.tf +++ b/examples/complete-email-validation-with-validation-domain/versions.tf @@ -1,10 +1,10 @@ terraform { - required_version = ">= 1.0" + required_version = ">= 1.10" required_providers { aws = { source = "hashicorp/aws" - version = ">= 4.40" + version = ">= 6.0" } } } diff --git a/examples/complete-email-validation/README.md b/examples/complete-email-validation/README.md index 1371217..60348af 100644 --- a/examples/complete-email-validation/README.md +++ b/examples/complete-email-validation/README.md @@ -36,14 +36,14 @@ Note that this example may create resources which cost money. Run `terraform des | Name | Version | |------|---------| -| [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | >= 4.40 | +| [terraform](#requirement\_terraform) | >= 1.10 | +| [aws](#requirement\_aws) | >= 6.0 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 4.40 | +| [aws](#provider\_aws) | >= 6.0 | ## Modules diff --git a/examples/complete-email-validation/versions.tf b/examples/complete-email-validation/versions.tf index fa875db..f648e20 100644 --- a/examples/complete-email-validation/versions.tf +++ b/examples/complete-email-validation/versions.tf @@ -1,10 +1,10 @@ terraform { - required_version = ">= 1.0" + required_version = ">= 1.10" required_providers { aws = { source = "hashicorp/aws" - version = ">= 4.40" + version = ">= 6.0" } } } diff --git a/main.tf b/main.tf index 68f3f1b..c376925 100644 --- a/main.tf +++ b/main.tf @@ -23,6 +23,7 @@ resource "aws_acm_certificate" "this" { subject_alternative_names = var.subject_alternative_names validation_method = var.validation_method key_algorithm = var.key_algorithm + region = var.region certificate_authority_arn = var.private_authority_arn @@ -67,6 +68,7 @@ resource "aws_acm_certificate_validation" "this" { count = local.create_certificate && var.validation_method != null && var.validate_certificate && var.wait_for_validation ? 1 : 0 certificate_arn = aws_acm_certificate.this[0].arn + region = var.region validation_record_fqdns = flatten([aws_route53_record.validation[*].fqdn, var.validation_record_fqdns]) diff --git a/variables.tf b/variables.tf index e53d33f..1d1dc18 100644 --- a/variables.tf +++ b/variables.tf @@ -46,6 +46,12 @@ variable "domain_name" { default = "" } +variable "region" { + description = "Region to create the resources into" + type = string + default = null +} + variable "subject_alternative_names" { description = "A list of domains that should be SANs in the issued certificate" type = list(string) diff --git a/versions.tf b/versions.tf index fa875db..f648e20 100644 --- a/versions.tf +++ b/versions.tf @@ -1,10 +1,10 @@ terraform { - required_version = ">= 1.0" + required_version = ">= 1.10" required_providers { aws = { source = "hashicorp/aws" - version = ">= 4.40" + version = ">= 6.0" } } } diff --git a/wrappers/main.tf b/wrappers/main.tf index b54571f..811de3a 100644 --- a/wrappers/main.tf +++ b/wrappers/main.tf @@ -14,6 +14,7 @@ module "wrapper" { key_algorithm = try(each.value.key_algorithm, var.defaults.key_algorithm, null) private_authority_arn = try(each.value.private_authority_arn, var.defaults.private_authority_arn, null) putin_khuylo = try(each.value.putin_khuylo, var.defaults.putin_khuylo, true) + region = try(each.value.region, var.defaults.region, null) subject_alternative_names = try(each.value.subject_alternative_names, var.defaults.subject_alternative_names, []) tags = try(each.value.tags, var.defaults.tags, {}) validate_certificate = try(each.value.validate_certificate, var.defaults.validate_certificate, true) diff --git a/wrappers/versions.tf b/wrappers/versions.tf index fa875db..f648e20 100644 --- a/wrappers/versions.tf +++ b/wrappers/versions.tf @@ -1,10 +1,10 @@ terraform { - required_version = ">= 1.0" + required_version = ">= 1.10" required_providers { aws = { source = "hashicorp/aws" - version = ">= 4.40" + version = ">= 6.0" } } }