terraform-aws-modules / terraform-aws-atlantis

Terraform module to deploy Atlantis on AWS Fargate πŸ‡ΊπŸ‡¦
https://registry.terraform.io/modules/terraform-aws-modules/atlantis/aws
Apache License 2.0
520 stars 351 forks source link

create_route53_record=false still try to create a record for ACM #360

Closed bakayolo closed 10 months ago

bakayolo commented 11 months ago

Description

Context: I am deploying Atlantis behind Cloudflare. I don't wanna use route53. And I understand that I'll have to set the records for validating certificates in Cloudflare by myself (I am doing this manually).

In my modules, I set

route53_private_zone       = false
create_route53_aaaa_record = false
create_route53_record      = false

Note: create_route53_record is the only not default value.

The issue is happening in this dependency module and exactly in this resource.

I think we should find a way to provide var.validate_certificate in the module directly. We could set validate_certificate = var.create_route53_record || var.create_route53_aaaa_record since I would assume that having both false we don't want to use route53 at all (which is my case) or we can create a new variable. Note that I can also set create_certificate = false by passing my own certificate but it feels more like a workaround in that case.

Wdyt?

If your request is for a new feature, please use the Feature request template.

Versions

Reproduction Code [Required]

Steps to reproduce the behavior:

Not adding any code since the issue is pretty obvious and described above.

Expected behavior

I would expect a new certificate to be created, and have to validate it by myself (which is what I am already doing today fwiw).

Actual behavior

Plan is erroring with

β•·
β”‚ Error: zone_id must not be empty, got 
β”‚ 
β”‚   with module.atlantis.module.atlantis.module.acm.aws_route53_record.validation[0],
β”‚   on .terraform/modules/atlantis.atlantis.acm/main.tf line 37, in resource "aws_route53_record" "validation":
β”‚   37:   zone_id = var.zone_id
β”‚ 
β•΅

Terminal Output Screenshot(s)

Additional context

bakayolo commented 11 months ago

Actually, creating a certificate as part of the same deployment code using aws_acm_certificate resource and certificate_arn input in atlantis module does not work.

The "count" value depends on resource attributes that cannot be determined
β”‚ until apply, so Terraform cannot predict how many instances will be
β”‚ created. To work around this, use the -target argument to first apply only
β”‚ the resources that the count depends on.

https://github.com/terraform-aws-modules/terraform-aws-atlantis/issues/268

github-actions[bot] commented 10 months ago

This issue has been automatically marked as stale because it has been open 30 days with no activity. Remove stale label or comment or this issue will be closed in 10 days

antonbabenko commented 10 months ago

This issue has been resolved in version 4.0.0 :tada:

github-actions[bot] commented 9 months 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.