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: Added support for snapshot_identifier parameter in aws_rds_cluster #7158

Merged
merged 1 commit into from
Jun 29, 2016

Conversation

kevtainer
Copy link

This PR adds support for snapshot_identifier use in resource_aws_rds_cluster. eg:

resource "aws_rds_cluster" "rds-snapshot-cluster" {
  cluster_identifier = "rds-snapshot-cluster"
  snapshot_identifier = "rds-snapshot"
  db_subnet_group_name = "${aws_db_subnet_group.snapshot-dbsg.name}"
  vpc_security_group_ids = ["${aws_security_group.snapshot-vpc-sg.id}"]
}

Once the cluster has been restored from the snapshot, an instance can be added to the cluster and it will contain the data stored in the cluster snapshot. eg:

resource "aws_rds_cluster_instance" "rds-cluster-instance" {
  instance_class = "db.r3.large"
  cluster_identifier = "${aws_rds_cluster.rds-snapshot-cluster.id}"
  db_subnet_group_name = "${aws_db_subnet_group.snapshot-dbsg.name}"
}

FWIW, the acceptance tests for db_instance and rds_cluster_ are fairly basic. I did not see a pattern for several conditional behaviors in db_instance that I could replicate for rds_cluster_ (specifically, restoration from snapshots). I'd be interested in any feedback to that regard.

Made modifications to existing parameters to enable restoring a RDS cluster snapshot

document changes
@kevtainer
Copy link
Author

TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSRDSCluster_ -timeout 120m
=== RUN   TestAccAWSRDSCluster_basic
--- PASS: TestAccAWSRDSCluster_basic (113.98s)
=== RUN   TestAccAWSRDSCluster_encrypted
--- PASS: TestAccAWSRDSCluster_encrypted (125.03s)
=== RUN   TestAccAWSRDSCluster_backupsUpdate
--- PASS: TestAccAWSRDSCluster_backupsUpdate (143.03s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    382.062s

@kevtainer kevtainer changed the title Added support for snapshot_identifier parameter in aws_rds_cluster provider/aws: Added support for snapshot_identifier parameter in aws_rds_cluster Jun 14, 2016
Type: schema.TypeString,
Computed: false,
Optional: true,
Elem: &schema.Schema{Type: schema.TypeString},
Copy link
Contributor

Choose a reason for hiding this comment

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

This isn't required - I know it's in the db_instance schema, but we only really use it when we are specifying a List

@stack72
Copy link
Contributor

stack72 commented Jun 29, 2016

Hi @KCrawley

Thanks so much for this - I had 1 small nip pick but this won't stop it being merged :) I am running the tests now. Barring these failing, I will get it merged this morning

Thanks

Paul

@stack72
Copy link
Contributor

stack72 commented Jun 29, 2016

make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSRDSCluster_'                                          2 ↵
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /vendor/)
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSRDSCluster_ -timeout 120m
=== RUN   TestAccAWSRDSCluster_basic
--- PASS: TestAccAWSRDSCluster_basic (134.31s)
=== RUN   TestAccAWSRDSCluster_encrypted
--- PASS: TestAccAWSRDSCluster_encrypted (124.46s)
=== RUN   TestAccAWSRDSCluster_backupsUpdate
--- PASS: TestAccAWSRDSCluster_backupsUpdate (201.12s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    459.910s

@ghost
Copy link

ghost commented Apr 24, 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 24, 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