Open EugenKon opened 1 month ago
Voting for Prioritization
Volunteering to Work on This Issue
Hey @EugenKon 👋 Thank you for taking the time to raise this! I noticed that in the sample configuration that you provided, you've mentioned the aws_lb_listener
and a acme_certificate
resource, but the aws_acm_certificate
resource isn't included. It would be really helpful if you could provide how that resource fits into the picture too, so we can get a better idea of dependencies, etc.
If you are interested, here is the full part related to ssl:
terraform {
required_providers {
# 3rd party provider should be defined inside module
acme = {
source = "vancluever/acme"
version = "~> 2.26"
}
}
}
provider "acme" {
server_url = "https://acme-staging-v02.api.letsencrypt.org/directory"
# server_url = "https://acme-v02.api.letsencrypt.org/directory"
}
locals {
san = coalescelist(var.san_domains, [var.domain_name, "*.${var.domain_name}"])
}
resource "tls_private_key" "acme" {
algorithm = "ECDSA"
ecdsa_curve = "P384"
}
resource "acme_registration" "certbot" {
account_key_pem = tls_private_key.acme.private_key_pem
email_address = "saas-ops-infra+${var.project_name}xxxxxx"
}
resource "acme_certificate" "ssl" {
account_key_pem = acme_registration.certbot.account_key_pem
key_type = "P384"
common_name = var.domain_name
subject_alternative_names = local.san
dns_challenge {
provider = "route53"
}
depends_on = [acme_registration.certbot]
}
resource "aws_acm_certificate" "ssl" {
certificate_body = acme_certificate.ssl.certificate_pem
private_key = acme_certificate.ssl.private_key_pem
certificate_chain = acme_certificate.ssl.issuer_pem
depends_on = [acme_certificate.ssl]
}
resource "local_file" "ssl_cert" {
content = acme_certificate.ssl.certificate_pem
# Root dir is at derived-src/aws
filename = "${path.root}/../../cert.pem"
file_permission = "0400"
}
resource "local_file" "ssl_chain" {
content = acme_certificate.ssl.issuer_pem
# Root dir is at derived-src/aws
filename = "${path.root}/../../chain.pem"
file_permission = "0400"
}
resource "local_file" "ssl_fullchain" {
content = format("%s%s", acme_certificate.ssl.certificate_pem, acme_certificate.ssl.issuer_pem)
# Root dir is at derived-src/aws
filename = "${path.root}/../../fullchain.pem"
file_permission = "0400"
}
resource "local_file" "ssl_privkey" {
content = acme_certificate.ssl.private_key_pem
# Root dir is at derived-src/aws
filename = "${path.root}/../../privkey.pem"
file_permission = "0400"
}
Terraform Core Version
v1.9.7
AWS Provider Version
v5.67.0
Affected Resource(s)
Expected Behavior
Because aws_acm_certificate is used by aws_lb_listener the
aws_lb_listener
should be updated first. Probably tasks could be ran in parallel.Actual Behavior
aws_acm_certificate
waits infinitly until the certificate will be released.Relevant Error/Panic Output Snippet
To workaround the problem I did:
This took just seconds.
Terraform Configuration Files
Steps to Reproduce
Debug Output
No response
Panic Output
No response
Important Factoids
No response
References
No response
Would you like to implement a fix?
None