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: Add aws_elasticache_replication_groups resource #8275

Merged
merged 1 commit into from Aug 18, 2016

Conversation

@stack72
Copy link
Contributor

@stack72 stack72 commented Aug 17, 2016

NOTE: This is the first use case for Replication Groups. This will allow us to specify a set of characteristics for a replication group and a number of nodes in the cluster and Terraform will go and create them.

This doesn't include:

  • creating a replication group from an existing cluster
  • adding a new cluster to a replication group

These use cases will follow very shortly!


New PR to rework the ElastiCache Replication Groups work. This means we are now starting to create a common schema between ElastiCache Cluster and Replication Groups

The ElastiCache Cluster tests work as expected still after the Schema has been refactored:

% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSElasticacheCluster_'           ✹
==> Checking that code complies with gofmt requirements...
/Users/stacko/Code/go/bin/stringer
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/08/17 15:20:57 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSElasticacheCluster_ -timeout 120m
=== RUN   TestAccAWSElasticacheCluster_basic
--- PASS: TestAccAWSElasticacheCluster_basic (395.41s)
=== RUN   TestAccAWSElasticacheCluster_snapshotsWithUpdates
--- PASS: TestAccAWSElasticacheCluster_snapshotsWithUpdates (812.77s)
=== RUN   TestAccAWSElasticacheCluster_decreasingCacheNodes
--- PASS: TestAccAWSElasticacheCluster_decreasingCacheNodes (860.08s)
=== RUN   TestAccAWSElasticacheCluster_vpc
--- PASS: TestAccAWSElasticacheCluster_vpc (509.98s)
=== RUN   TestAccAWSElasticacheCluster_multiAZInVpc
--- PASS: TestAccAWSElasticacheCluster_multiAZInVpc (879.67s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    3457.932s
  • Schema (refactor common schema)
  • Resource Specific schema pieces
  • CRUD
  • Acceptance tests
  • Documentation

Final test run for the Replication Groups

% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSElasticacheReplicationGroup_'  ✹
==> Checking that code complies with gofmt requirements...
/Users/stacko/Code/go/bin/stringer
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/08/18 13:16:33 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSElasticacheReplicationGroup_ -timeout 120m
=== RUN   TestAccAWSElasticacheReplicationGroup_basic
--- PASS: TestAccAWSElasticacheReplicationGroup_basic (771.49s)
=== RUN   TestAccAWSElasticacheReplicationGroup_updateDescription
--- PASS: TestAccAWSElasticacheReplicationGroup_updateDescription (892.87s)
=== RUN   TestAccAWSElasticacheReplicationGroup_updateNodeSize
--- PASS: TestAccAWSElasticacheReplicationGroup_updateNodeSize (1541.97s)
=== RUN   TestAccAWSElasticacheReplicationGroup_vpc
--- PASS: TestAccAWSElasticacheReplicationGroup_vpc (756.61s)
=== RUN   TestAccAWSElasticacheReplicationGroup_multiAzInVpc
--- PASS: TestAccAWSElasticacheReplicationGroup_multiAzInVpc (1114.94s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    5077.898s
@stack72 stack72 force-pushed the aws-elasticache-replication_groups branch 5 times, most recently from c9d3e4a to 079ec05 Aug 18, 2016
resourceSchema["number_cache_clusters"] = &schema.Schema{
Type: schema.TypeInt,
Required: true,
ForceNew: true,
Copy link
Contributor

@elblivion elblivion Aug 18, 2016

Choose a reason for hiding this comment

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

:-/

You can add read replicas by calling CreateCacheCluster, maybe something for later on: https://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/Replication.AddReadReplica.html#Replication.AddReadReplica.API

Loading

Copy link
Contributor Author

@stack72 stack72 Aug 18, 2016

Choose a reason for hiding this comment

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

This is a limitation of the API - the number is not adjustable via the API. This is a decent first pass :) We will continue to make this resource better!

Loading

@stack72 stack72 force-pushed the aws-elasticache-replication_groups branch from 079ec05 to 86f64d0 Aug 18, 2016
@stack72 stack72 changed the title [WIP] Resource aws_elasticache_replication_groups provider/aws: Add aws_elasticache_replication_groups resource Aug 18, 2016
MinTimeout: 3 * time.Second,
Timeout: 40 * time.Minute,
MinTimeout: 10 * time.Second,
Delay: 30 * time.Second,
Copy link
Member

@phinze phinze Aug 18, 2016

Choose a reason for hiding this comment

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

@stack72 are these number changes based on observed slowness while developing?

Loading

Copy link
Contributor Author

@stack72 stack72 Aug 18, 2016

Choose a reason for hiding this comment

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

yessir!

Loading

@phinze
Copy link
Member

@phinze phinze commented Aug 18, 2016

Other than the few super-minor nits inline this LGTM!

Loading

@stack72 stack72 force-pushed the aws-elasticache-replication_groups branch from 86f64d0 to 47b3c9e Aug 18, 2016
* `replication_group_id` – (Required) The replication group identifier. This parameter is stored as a lowercase string.
* `replication_group_description` – (Required) A user-created description for the replication group.
* `number_cache_clusters` - (Required) The number of cache clusters this replication group will initially have.
If Multi-AZ is enabled , the value of this parameter must be at least 2. Changing this number will force a new resource
Copy link
Member

@catsby catsby Aug 18, 2016

Choose a reason for hiding this comment

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

this replication group will initially have ... Changing this number will force a new resource

Let's remove initially here, unless there is some supported way of expanding it

Loading

Copy link
Contributor Author

@stack72 stack72 Aug 18, 2016

Choose a reason for hiding this comment

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

Totally agree on this!

Loading

@stack72 stack72 merged commit 51f2163 into master Aug 18, 2016
1 check passed
Loading
@stack72 stack72 deleted the aws-elasticache-replication_groups branch Aug 18, 2016
* `number_cache_clusters` - (Required) The number of cache clusters this replication group will initially have.
If Multi-AZ is enabled , the value of this parameter must be at least 2. Changing this number will force a new resource
* `node_type` - (Required) The compute and memory capacity of the nodes in the node group.
* `engine` - (Required) The name of the cache engine to be used for the cache clusters in this replication group. The only valid value is Redis.
Copy link
Member

@catsby catsby Aug 18, 2016

Choose a reason for hiding this comment

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

Should we even have this then, if the only value accepted is redis? Seems like needless work for our users

Loading

Copy link
Contributor Author

@stack72 stack72 Aug 18, 2016

Choose a reason for hiding this comment

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

Agreed - removed

Loading

@brmcconn
Copy link

@brmcconn brmcconn commented Sep 1, 2016

Any ETA on when this might be available in an upcoming release? I use Terraform for a lot of other AWS resources and it works great. Would love to be able to add ElastiCache to the list, but can't without being able to run replication groups/Redis.

Loading

@stack72
Copy link
Contributor Author

@stack72 stack72 commented Sep 3, 2016

Hi @brmcconn

This has already been released and is available in the 0.7.2 release

P.

Loading

@brmcconn
Copy link

@brmcconn brmcconn commented Sep 6, 2016

Great, thanks! @stack72. I didn't realize that it was in that release. Just an fyi - the documentation on the website for elasticache hasn't been updated to include the new funcitonality - https://www.terraform.io/docs/providers/aws/index.html#, but I see the documentation posted here which should be plenty to get me up and running!

Loading

@stack72
Copy link
Contributor Author

@stack72 stack72 commented Sep 6, 2016

Hi @brmcconn

The documentation is linked to on the side bar https://www.terraform.io/docs/providers/aws/r/elasticache_replication_group.html - hope this helps

P.

Loading

@brmcconn
Copy link

@brmcconn brmcconn commented Sep 7, 2016

Thanks for the link @stack72. It all works great. However, that's not showing up on the website for me just going to www.terraform.io > docs > providers > AWS (the URL is https://www.terraform.io/docs/providers/aws/index.html). You can see the missing link for aws_elasticache_replication_group in my screenshot below:
image

Loading

@eyalzek
Copy link

@eyalzek eyalzek commented Sep 7, 2016

@brmcconn try clearing your browser cache

Loading

@brmcconn
Copy link

@brmcconn brmcconn commented Sep 7, 2016

@eyalzek , I gave that a try, but no luck. However, if I go to the website on my phone I see the documentation there, so we'll just call this a client issue on my end.

Loading

@ghost
Copy link

@ghost ghost commented Apr 22, 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.

Loading

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

Successfully merging this pull request may close these issues.

None yet

6 participants