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

Add Argument copy_tags_to_snapshot for aws_rds_cluster_instance #6582

Conversation

teraken0509
Copy link
Contributor

Fixes #6355

Changes proposed in this pull request:

  • Add copy_tags_to_snapshot argument
  • Update document about copy_tags_to_snapshot argument

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccAWSRDSClusterInstance_CopyTagsToSnapshot'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./... -v -parallel 20 -run=TestAccAWSRDSClusterInstance_CopyTagsToSnapshot -timeout 120m
?   	github.com/terraform-providers/terraform-provider-aws	[no test files]
=== RUN   TestAccAWSRDSClusterInstance_CopyTagsToSnapshot
=== PAUSE TestAccAWSRDSClusterInstance_CopyTagsToSnapshot
=== CONT  TestAccAWSRDSClusterInstance_CopyTagsToSnapshot
--- PASS: TestAccAWSRDSClusterInstance_CopyTagsToSnapshot (832.74s)
PASS
ok  	github.com/terraform-providers/tmp-terraform-provider-aws/aws	832.834s

@ghost ghost added size/M Managed by automation to categorize the size of a PR. documentation Introduces or discusses updates to documentation. service/rds Issues and PRs that pertain to the rds service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Nov 26, 2018
@bflad bflad added the enhancement Requests to existing resources that expand the functionality or scope. label Dec 2, 2018
@bflad bflad added this to the v1.51.0 milestone Dec 2, 2018
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

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

Two little things then this should be good to go. Thanks, @kterada0509!

identifier = "tf-cluster-instance-%d"
cluster_identifier = "${aws_rds_cluster.default.id}"
instance_class = "db.t2.small"
db_parameter_group_name = "${aws_db_parameter_group.bar.name}"
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Since the db_parameter_group_name argument does not relate to copy_tags_to_snapshot, it and the aws_db_parameter_group resource can be omitted from the test configuration. 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed it.

@@ -52,6 +52,7 @@ func TestAccAWSRDSClusterInstance_basic(t *testing.T) {
testAccCheckAWSDBClusterInstanceAttributes(&v),
resource.TestMatchResourceAttr("aws_rds_cluster_instance.cluster_instances", "arn", regexp.MustCompile(`^arn:[^:]+:rds:[^:]+:[^:]+:db:.+`)),
resource.TestCheckResourceAttr("aws_rds_cluster_instance.cluster_instances", "auto_minor_version_upgrade", "true"),
resource.TestCheckResourceAttr("aws_rds_cluster_instance", "copy_tags_to_snapshot", "false"),
Copy link
Contributor

Choose a reason for hiding this comment

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

This is missing the resource name and causes the test to fail:

--- FAIL: TestAccAWSRDSClusterInstance_basic (702.58s)
    testing.go:538: Step 0 error: Check failed: Check 5/11 error: Not found: aws_rds_cluster_instance in [root]
Suggested change
resource.TestCheckResourceAttr("aws_rds_cluster_instance", "copy_tags_to_snapshot", "false"),
resource.TestCheckResourceAttr("aws_rds_cluster_instance.cluster_instances", "copy_tags_to_snapshot", "false"),

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks.
Fixed it.

@bflad bflad added the waiting-response Maintainers are waiting on response from community or contributor. label Dec 3, 2018
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @kterada0509! 🚀

--- PASS: TestAccAWSRDSClusterInstance_namePrefix (628.56s)
--- PASS: TestAccAWSRDSClusterInstance_CopyTagsToSnapshot (695.77s)
--- PASS: TestAccAWSRDSClusterInstance_withInstancePerformanceInsights (713.56s)
--- PASS: TestAccAWSRDSClusterInstance_withInstanceEnhancedMonitor (715.07s)
--- PASS: TestAccAWSRDSClusterInstance_disappears (758.99s)
--- PASS: TestAccAWSRDSClusterInstance_PubliclyAccessible (772.16s)
--- PASS: TestAccAWSRDSClusterInstance_generatedName (793.30s)
--- PASS: TestAccAWSRDSClusterInstance_kmsKey (894.70s)
--- PASS: TestAccAWSRDSClusterInstance_az (938.64s)
--- PASS: TestAccAWSRDSClusterInstance_importBasic (1276.77s)
--- PASS: TestAccAWSRDSClusterInstance_basic (1424.95s)

@bflad bflad merged commit f1523e9 into hashicorp:master Dec 4, 2018
@bflad
Copy link
Contributor

bflad commented Dec 5, 2018

This has been released in version 1.51.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

@teraken0509 teraken0509 deleted the feature/add-argument-copy_tags_to_snapshot-for-aws_rds_cluster_instance branch December 26, 2018 09:58
@kierenscott
Copy link

kierenscott commented Jan 11, 2019

I've tested this and noticed that tags are not copied to automated and manual cluster snapshots, even though I have copy_tags_to_snapshots to true in aws_rds_cluster_instance. My Cluster and Cluster Instances are tagged. I don't think automated copying of cluster/cluster-instances tags in this way is supported yet by AWS. Has anyone else noticed this? I'm using terraform version 0.11.7 with aws provider v1.53.0.

@ghost ghost removed the waiting-response Maintainers are waiting on response from community or contributor. label Jan 11, 2019
@DrFaust92
Copy link
Collaborator

Closes #2565

@ghost
Copy link

ghost commented Jan 19, 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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Jan 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. enhancement Requests to existing resources that expand the functionality or scope. service/rds Issues and PRs that pertain to the rds service. size/M Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Argument copy_tags_to_snapshot for aws_rds_cluster_instance
4 participants