Loading...
Loading...
### Terraform Version ```shell Terraform v1.13.3 on linux_amd64 ``` ### Terraform Configuration Files `terraform.tf` ```terraform terraform { required_providers { aws = { source = "hashicorp/aws" version = "~> 5.92" } } required_version = ">= 1.2" } ``` `main.tf` ```terraform provider "aws" { region = "us-east-1" } import { to = aws_db_instance.aws_rds_postgres id = "aws-rds-postgres" } ``` ### Debug Output [Gist link](https://gist.github.com/ejohnso49/97aee71d5c6dd263800e63ab0a6c0040) ### Expected Behavior - Config is generated without error - Config for a non-Active Directory enabled RDS has a value `domain_dns_ips = null` ### Actual Behavior - Config generated with an error - Config contains `domain_dns_ips = []` which produces a validation error due to this attribute have a MinItems constraint of 2 despite the attribute being optional ### Steps to Reproduce 1. `terraform init` 2. `terraform plan -generate-config-output=generated.tf` ### Additional Context I think that this issue should be filed in this repo as this is related to how the config output is generated rather than something specific to the AWS provider. I have attempted to fix this bug but have gotten stuck so do not have an immediate fix. I believe the root cause is that the attribute `domain_dns_ips` is an optional list with a MinItems constraint of 2. The provider is producing an attribute value of `nil` correctly when there is no list. When the output generates, `domain_dns_ips = []`. This however then fails on validation as an empty list does not meet the MinItems constraint. I believe the correct behavior would be to generate `domain_dns_ips = null` in this case. ### References _No response_ ### Generative AI / LLM assisted development? _No response_
Click on a version to see all relevant bugs
Terraform Integration
Learn more about where this data comes from
Bug Scrub Advisor
Streamline upgrades with automated vendor bug scrubs
BugZero Enterprise
Wish you caught this bug sooner? Get proactive today.