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

Can't enable automatic snapshotting on aws_elasticache_replication_group #10581

Closed
Alars-ALIT opened this issue Dec 7, 2016 · 3 comments · Fixed by #14757
Closed

Can't enable automatic snapshotting on aws_elasticache_replication_group #10581

Alars-ALIT opened this issue Dec 7, 2016 · 3 comments · Fixed by #14757
Assignees

Comments

@Alars-ALIT
Copy link

Seems impossible to enable automatic snapshotting on a aws_elasticache_replication_group.

Terraform Version

0.7.13

Terraform Configuration Files

resource "aws_elasticache_replication_group" "replication-group" {
  replication_group_id                = "${var.environment}-rep-group"
  replication_group_description = "${var.environment}-redis"
  node_type                                = "cache.m1.small"
  number_cache_clusters            = 2
  port                                          = 6379
  parameter_group_name          = "default.redis3.2"
  automatic_failover_enabled    = "${var.settings["automatic_failover_enabled"]}"
  security_group_ids                  = ["${aws_security_group.redis.id}"]
  subnet_group_name               = "${aws_elasticache_subnet_group.subgroup.name}"

  snapshot_window               = "05:00-09:00"  
  snapshot_retention_limit      = 3
}

Debug Output

Error applying plan:

1 error(s) occurred:

  • aws_elasticache_replication_group.replication-group: Error updating Elasticache replication group: InvalidParameterCombination: Must specify both SnapshotRetentionLimit and SnapshottingClusterId to turn on snapshots
    status code: 400, request id: 25af6fe7-bc87-11e6-9afb-dd75999c5340

Expected Behavior

Snapshots should be enabled

Steps to Reproduce

terraform apply

@stack72
Copy link
Contributor

stack72 commented Dec 8, 2016

Hi @Alars-ALIT

Sorry for the issue here. From the error message I am assuming things go down as follows:

  • Create your terraform controlled replication_group without snapshotting
  • update the config to include snapshotting
  • Terraform apply then throws that error message?

This correct?

I am trying to recreate this right now and am struggling to do so. Any help would be great

Paul

@stack72
Copy link
Contributor

stack72 commented Dec 8, 2016

Replicated it :)

[stacko@Pauls-MacBook-Pro:~/Code/terraform-org/terraform-recreations/10581]
% terraform apply
aws_elasticache_replication_group.replication-group: Refreshing state... (ID: test-rep-group)
aws_elasticache_replication_group.replication-group: Modifying...
  snapshot_retention_limit: "0" => "5"
  snapshot_window:          "07:00-08:00" => "05:00-09:00"
Error applying plan:

1 error(s) occurred:

* aws_elasticache_replication_group.replication-group: Error updating Elasticache replication group: InvalidParameterCombination: Must specify both SnapshotRetentionLimit and SnapshottingClusterId to turn on snapshots
	status code: 400, request id: f0e91fc6-bd4d-11e6-ad10-e779b4597a1e

Terraform does not automatically rollback in the face of errors.
Instead, your Terraform state file has been partially updated with
any resources that successfully completed. Please address the error
above and apply again to incrementally change your infrastructure.

@stack72 stack72 self-assigned this Dec 18, 2016
stack72 added a commit that referenced this issue May 23, 2017
Fixes: #10581

When a cluster was originally created, you could not enable snapshotting
on it. An error message like this was found:

```
* aws_elasticache_replication_group.bar: Error updating Elasticache replication group: InvalidParameterCombination: Must specify both SnapshotRetentionLimit and SnapshottingClusterId to turn on snapshots
    status code: 400, request id: 98d2ea4e-3fb1-11e7-b077-5967719aeab4
```

There is no guidance from AWS on which is the preferred Cluster in the RG to use for snapshotting. Therefore, I decided to set it to be the first cluster. We can now enable snapshotting
stack72 added a commit that referenced this issue May 23, 2017
Fixes: #10581

When a cluster was originally created, you could not enable snapshotting
on it. An error message like this was found:

```
* aws_elasticache_replication_group.bar: Error updating Elasticache replication group: InvalidParameterCombination: Must specify both SnapshotRetentionLimit and SnapshottingClusterId to turn on snapshots
    status code: 400, request id: 98d2ea4e-3fb1-11e7-b077-5967719aeab4
```

There is no guidance from AWS on which is the preferred Cluster in the RG to use for snapshotting. Therefore, I decided to set it to be the first cluster. We can now enable snapshotting
stack72 added a commit that referenced this issue May 23, 2017
Fixes: #10581

When a cluster was originally created, you could not enable snapshotting
on it. An error message like this was found:

```
* aws_elasticache_replication_group.bar: Error updating Elasticache replication group: InvalidParameterCombination: Must specify both SnapshotRetentionLimit and SnapshottingClusterId to turn on snapshots
    status code: 400, request id: 98d2ea4e-3fb1-11e7-b077-5967719aeab4
```

There is no guidance from AWS on which is the preferred Cluster in the RG to use for snapshotting. Therefore, I decided to set it to be the first cluster. We can now enable snapshotting

```
% make testacc TEST=./builtin/providers/aws/ TESTARGS='-run=TestAccAWSElasticacheReplicationGroup_enableSnapshotting'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/05/23 15:02:21 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws/ -v -run=TestAccAWSElasticacheReplicationGroup_enableSnapshotting -timeout 120m
=== RUN   TestAccAWSElasticacheReplicationGroup_enableSnapshotting
--- PASS: TestAccAWSElasticacheReplicationGroup_enableSnapshotting (1261.47s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/aws	1261.496s
```
stack72 added a commit that referenced this issue May 23, 2017
…RG (#14757)

Fixes: #10581

When a cluster was originally created, you could not enable snapshotting
on it. An error message like this was found:

```
* aws_elasticache_replication_group.bar: Error updating Elasticache replication group: InvalidParameterCombination: Must specify both SnapshotRetentionLimit and SnapshottingClusterId to turn on snapshots
    status code: 400, request id: 98d2ea4e-3fb1-11e7-b077-5967719aeab4
```

There is no guidance from AWS on which is the preferred Cluster in the RG to use for snapshotting. Therefore, I decided to set it to be the first cluster. We can now enable snapshotting

```
% make testacc TEST=./builtin/providers/aws/ TESTARGS='-run=TestAccAWSElasticacheReplicationGroup_enableSnapshotting'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/05/23 15:02:21 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws/ -v -run=TestAccAWSElasticacheReplicationGroup_enableSnapshotting -timeout 120m
=== RUN   TestAccAWSElasticacheReplicationGroup_enableSnapshotting
--- PASS: TestAccAWSElasticacheReplicationGroup_enableSnapshotting (1261.47s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/aws	1261.496s
```
@ghost
Copy link

ghost commented Apr 12, 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 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants