"MyDB" : {
"Type" : "AWS::RDS::DBInstance",
"Properties" : {
"AllocatedStorage" : "5",
"DBInstanceClass" : "db.m1.small",
"Engine" : "MySQL",
"EngineVersion" : "5.5",
"MasterUsername" : { "Ref" : "DBUser" },
"MasterUserPassword" : { "Ref" : "DBPassword" },
"DBParameterGroupName" : { "Ref" : "MyRDSParamGroup" },
"DBSnapshotIdentifier" : {
"Fn::If" : [
"UseDBSnapshot",
{"Ref" : "DBSnapshotName"},
{"Ref" : "AWS::NoValue"}
]
}
}
}variable "snapshot" { default = "" }
resource "aws_db_instance" {# ...
snapshot_identifier = "${var.snapshot}"
Then you just set `snapshot` to the snapshot name when you want to use one, and leave it blank when you don't.}
--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
GitHub Issues: https://github.com/hashicorp/terraform/issues
IRC: #terraform-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Terraform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to terraform-too...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/terraform-tool/83c47ee2-d5a3-4d61-a483-83b2838aa62b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
variable "snapshot" { default = "" }
resource "aws_db_instance" "admin-interface" {
final_snapshot_identifier = "${var.snapshot}"
}
variable "snapshot" { default = ""}
error: aws_db_instance.admin-interface: only alphanumeric characters and hyphens allowed in "final_snapshot_identifier"
Seems like 'final_snapshot_identifier' doesn't like an empty string. I would like to just like exclude "final_snapshot_identifier" in my staging env resource completely, but it seems from the previous post that is not possible without defining a whole new resource.
Not really sure where to go from here. I hope this is enough info.
Thanks!
Thomas
--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
GitHub Issues: https://github.com/hashicorp/terraform/issues
IRC: #terraform-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Terraform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to terraform-too...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/terraform-tool/7c223c1b-c579-4189-aec5-45ac0eb1a77a%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/terraform-tool/e3bf215a-9b1d-4c29-bc39-37f8eb75425a%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/terraform-tool/6cc6c085-0130-41cc-b99d-33d4b293d56c%40googlegroups.com.