terraform-aws-modules / terraform-aws-acm

Terraform module to create AWS ACM resources 🇺🇦
https://registry.terraform.io/modules/terraform-aws-modules/acm/aws
Apache License 2.0
184 stars 230 forks source link

feat: Make validation timeout configurable #123

Closed nepalevov closed 1 year ago

nepalevov commented 1 year ago

Is your request related to a problem? Please describe.

Since aws provider 4.12.0 the default timeout for resource aws_acm_certificate_validation was increased from 45 to 75 minutes (https://github.com/hashicorp/terraform-provider-aws/issues/20073), so the \ I use this module in CI and new resource timeout exceeds default CI job timeout, which is 60 minutes.

Describe the solution you'd like.

I'd like to have create timeout for resource "aws_acm_certificate_validation" "this" {} configurable by variable, e.g.

variable "validation_timeout" {
  description = "Define maximum timeout to wait for the validation to complete"
  type        = string
  default     = "75m"
}

resource "aws_acm_certificate_validation" "this" {
  count = local.create_certificate && var.validation_method != "NONE" && var.validate_certificate && var.wait_for_validation ? 1 : 0

  certificate_arn = aws_acm_certificate.this[0].arn

  validation_record_fqdns = flatten([aws_route53_record.validation.*.fqdn, var.validation_record_fqdns])

  timeouts {
    create = var.validation_timeout
  }
}

Describe alternatives you've considered.

Currently, I have to set wait_for_validation = false. I'd prefer to set smaller validation timeout and receive terraform error, though.

antonbabenko commented 1 year ago

Please open a PR for this change. The variable's default value should be null (not "75m") to respect Terraform AWS provider's setting.

antonbabenko commented 1 year ago

This issue has been resolved in version 4.2.0 :tada:

github-actions[bot] commented 1 year ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.