Open rgl opened 6 months ago
Voting for Prioritization
Volunteering to Work on This Issue
Hey @rgl 👋 Thank you for taking the time to raise this! Are you able to supply debug logs (redacted as needed) so that we have that information to reference? Without a working reproduction example, we'll need that in order to deduce what's happening.
Ah, sorry, I forgot to include the repo. The full repo is at https://github.com/rgl/terraform-aws-documentdb-example. The relevant parts, I think, are:
I'm sorry, but I will not even try to redact the terraform logs, that file is too complex/unknown for doing that. If there is anything particular that you want to see, let me known. Thou, that repo should be enough to reproduce the problem.
I get the same issue. Until now, the only solution i got was to add the new az manually to the code . This makes almost impossible to develop an automation for different workspaces.
Oh, this also happens with the aws_rds_cluster
resource... :-(
Hey @rgl 👋 Thank you for taking the time to raise this! In the case of aws_rds_cluster
, that behavior is expected and noted in the documentation:
RDS automatically assigns 3 AZs if less than 3 AZs are configured, which will show as a difference requiring resource recreation next Terraform apply
I suspect this may be the case for DocDB as well, but can't find any specific documentation to support that. If you supply 3 AZs, does the issue persist?
@justinretzolk oh, I've missed that part of the documentation... thanks for pointing it out!
by any chance, can you/HashiCorp ask AWS for clarification? and maybe crosslink the two documentations? this provider and aws rds docs.
Terraform Core Version
1.8.2
AWS Provider Version
5.47.0
Affected Resource(s)
aws_docdb_cluster and aws_rds_cluster
Expected Behavior
Expected the aws_docdb_cluster and aws_rds_cluster resources to return the configured availability_zones
Actual Behavior
aws_docdb_cluster.availability_zones
returns more zones than what was configured at creation time.Relevant Error/Panic Output Snippet
No response
Terraform Configuration Files
Please note that
module.vpc.azs
has two azs,eu-west-1a
andeu-west-1a
.Steps to Reproduce
terraform apply
again.terraform apply
wants to recreate the aws_docdb_cluster because it thinks a third zoneeu-west-1c
is being removed. Also notice that we've initially created the aws_docdb_cluster with two azs, not three! So it seems there's a bug somewhere.Debug Output
No response
Panic Output
No response
Important Factoids
No response
References
This is related to https://github.com/hashicorp/terraform-provider-aws/issues/19451.
Would you like to implement a fix?
None