Skip to content
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

Merged
merged 1 commit into from
Feb 13, 2017

Conversation

stack72
Copy link
Contributor

@stack72 stack72 commented Feb 4, 2017

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

Copy link
Member

@radeksimko radeksimko left a 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"
Copy link
Member

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)
Copy link
Member

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
Copy link
Member

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stack72 stack72 force-pushed the f-aws-rdscluster-default-snapshot branch 3 times, most recently from bcbc49b to 6290351 Compare February 13, 2017 13:05
@stack72
Copy link
Contributor Author

stack72 commented Feb 13, 2017

@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

@stack72 stack72 force-pushed the f-aws-rdscluster-default-snapshot branch 2 times, most recently from 263040f to 44058a7 Compare February 13, 2017 14:27
@stack72
Copy link
Contributor Author

stack72 commented Feb 13, 2017

Pending the issue of the snapshot random name, all the other tests are passing:

% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSRDSCluster'                                   ✚ ✭
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/02/13 12:57:22 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSRDSCluster -timeout 120m
=== RUN   TestAccAWSRDSClusterInstance_importBasic
--- PASS: TestAccAWSRDSClusterInstance_importBasic (740.18s)
=== RUN   TestAccAWSRDSCluster_importBasic
--- PASS: TestAccAWSRDSCluster_importBasic (114.17s)
=== RUN   TestAccAWSRDSClusterInstance_basic
--- PASS: TestAccAWSRDSClusterInstance_basic (1547.61s)
=== RUN   TestAccAWSRDSClusterInstance_kmsKey
--- PASS: TestAccAWSRDSClusterInstance_kmsKey (822.81s)
=== RUN   TestAccAWSRDSClusterInstance_disappears
--- PASS: TestAccAWSRDSClusterInstance_disappears (781.63s)
=== RUN   TestAccAWSRDSClusterInstance_withInstanceEnhancedMonitor
--- PASS: TestAccAWSRDSClusterInstance_withInstanceEnhancedMonitor (843.01s)
=== RUN   TestAccAWSRDSCluster_basic
--- PASS: TestAccAWSRDSCluster_basic (143.09s)
=== RUN   TestAccAWSRDSCluster_takeFinalSnapshot
--- PASS: TestAccAWSRDSCluster_takeFinalSnapshot (143.98s)
=== RUN   TestAccAWSRDSCluster_missingUserNameCausesError
--- PASS: TestAccAWSRDSCluster_missingUserNameCausesError (4.80s)
=== RUN   TestAccAWSRDSCluster_updateTags
--- PASS: TestAccAWSRDSCluster_updateTags (138.39s)
=== RUN   TestAccAWSRDSCluster_kmsKey
--- PASS: TestAccAWSRDSCluster_kmsKey (153.51s)
=== RUN   TestAccAWSRDSCluster_encrypted
--- PASS: TestAccAWSRDSCluster_encrypted (112.50s)
=== RUN   TestAccAWSRDSCluster_backupsUpdate
--- PASS: TestAccAWSRDSCluster_backupsUpdate (170.99s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/aws	5716.689s

This has used the hard coded snapshot name

@stack72 stack72 force-pushed the f-aws-rdscluster-default-snapshot branch from 44058a7 to 93c80c0 Compare February 13, 2017 14:48
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
```
@stack72 stack72 force-pushed the f-aws-rdscluster-default-snapshot branch from 93c80c0 to 43d9a45 Compare February 13, 2017 14:54
@stack72 stack72 merged commit eb5bcd9 into master Feb 13, 2017
@stack72 stack72 deleted the f-aws-rdscluster-default-snapshot branch February 13, 2017 19:29
master_username = "foo"
master_password = "mustbeeightcharaters"
db_cluster_parameter_group_name = "default.aurora5.6"
skip_final_snapshot = true
Copy link
Contributor

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 😜

@ghost
Copy link

ghost commented Apr 14, 2020

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.

@ghost ghost locked and limited conversation to collaborators Apr 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants