-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
provider/aws: Enable final snapshots for aws_rds_cluster by default #11694
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only real blocker is unmodified tests for aws_rds_cluster_instance
, which is also why some acceptance tests are failing:
https://gist.github.com/radeksimko/5dc581dc55c90ac152ce61ef72576b27
Otherwise this looks pretty good.
master_password = "mustbeeightcharaters" | ||
db_cluster_parameter_group_name = "default.aurora5.6" | ||
skip_final_snapshot = true | ||
final_snapshot_identifier = "tf-acctest-rdscluster-snapshot-1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure how the namespaces work around snapshots & clusters (i.e. if each cluster has its own namespace), but I'm thinking we should randomize this, so we can run this test multiple times in parallel. What do you think?
return nil | ||
} | ||
} else { | ||
arn, err := buildRDSClusterARN(snapshot_identifier, testAccProvider.Meta().(*AWSClient).partition, testAccProvider.Meta().(*AWSClient).accountid, testAccProvider.Meta().(*AWSClient).region) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really a nitpick, but you could reduce the length of this line by separating the cast operation onto a separate line above, i.e.
awsClient := testAccProvider.Meta().(*AWSClient)
@@ -343,5 +438,6 @@ resource "aws_rds_cluster" "default" { | |||
preferred_backup_window = "03:00-09:00" | |||
preferred_maintenance_window = "wed:01:00-wed:01:30" | |||
apply_immediately = true | |||
skip_final_snapshot = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are all great and will prevent the leakage of snapshots 👍 , but I think we have a few more in ./builtin/providers/aws/resource_aws_rds_cluster_instance_test.go
- we'll either need to disable snapshots there too, or add snapshot deletion into testAccCheckAWSClusterDestroy
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bcbc49b
to
6290351
Compare
@radeksimko I believe I have made the necessary changes here - I am waiting for the tests to run though :) I will post the results when they are done |
263040f
to
44058a7
Compare
Pending the issue of the snapshot random name, all the other tests are passing:
This has used the hard coded snapshot name |
44058a7
to
93c80c0
Compare
We now enable the final_snapshot of aws_rds_cluster by default. This is a continuation of the work in #11668 ``` % make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSRDSCluster_takeFinalSnapshot' ==> Checking that code complies with gofmt requirements... go generate $(go list ./... | grep -v /terraform/vendor/) 2017/02/04 13:19:52 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSRDSCluster_takeFinalSnapshot -timeout 120m === RUN TestAccAWSRDSCluster_takeFinalSnapshot --- PASS: TestAccAWSRDSCluster_takeFinalSnapshot (141.59s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 141.609s ```
93c80c0
to
43d9a45
Compare
master_username = "foo" | ||
master_password = "mustbeeightcharaters" | ||
db_cluster_parameter_group_name = "default.aurora5.6" | ||
skip_final_snapshot = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In hindsight, a testAccAWSClusterConfigWithFinalSnapshot
config should probably have skip_final_snapshot = false
😜
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. |
We now enable the final_snapshot of aws_rds_cluster by default. This is
a continuation of the work in #11668