-
Notifications
You must be signed in to change notification settings - Fork 9.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot set null/undefined value for rds instances' port. #1874
Comments
Hi folks 👋 This issue is resolved in Terraform 0.12, which supports new functionality in the configuration language aimed at solving this issue. The new Given this configuration: # The port argument is a hardcoded null in this illustrative example,
# however it can be sourced from a variable or local value.
resource "aws_db_instance" "test" {
allocated_storage = 5
engine = "postgres"
identifier = "null-testing"
instance_class = "db.t2.micro"
password = "avoid-plaintext-passwords"
port = null
username = "testing"
skip_final_snapshot = true
} Produces the following plan output:
Enjoy! 🚀 |
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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Terraform Version
Terraform v0.10.7
Affected Resource(s)
aws_db_instance
Terraform Configuration Files
Debug Output
https://gist.github.com/l01cd3v/0ea630ea620eae9519e9a12535ddc5c3
Expected Behavior
The 0 value should be discarded and replaced with the "" value, both when creating and updating the instance.
Actual Behavior
Terraform attempts to create/update the DB and set the port to 0.
When creating the DB, AWS discards this value and uses the default port; terraform succeeds.
When updating, AWS throws an error because 0 is not an authorized value, terraform fails.
Steps to Reproduce
Using the sample configuration file, run the following:
Important Factoids
None
References
Seems similar to #1544, which references hashicorp/terraform#5471 (comment)
The text was updated successfully, but these errors were encountered: