terraform-provider-aws: aws_elasticache_replication_group global replication group id InvalidParameterCombination
Community Note
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
- Please do not leave “+1” or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
- If you are interested in working on this issue or have submitted a pull request, please leave a comment
Terraform CLI and Terraform AWS Provider Version
Terraform v1.1.9
on darwin_arm64
+ provider registry.terraform.io/hashicorp/aws v4.14.0
+ provider registry.terraform.io/hashicorp/random v3.1.3
Affected Resource(s)
- aws_elasticache_replication_group
Terraform Configuration Files
Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.
resource "aws_elasticache_subnet_group" "primary" {
name = "${var.backend_prefix}-elasticache-primary"
subnet_ids = module.backend_vpc.private_subnets
}
resource "aws_elasticache_global_replication_group" "this" {
global_replication_group_id_suffix = var.backend_prefix
primary_replication_group_id = aws_elasticache_replication_group.primary.id
}
resource "aws_elasticache_replication_group" "primary" {
replication_group_id = "${var.backend_prefix}-redis-rg"
replication_group_description = "Primary replication group"
engine = "redis"
engine_version = "5.0.6"
node_type = "cache.m5.large"
security_group_ids = [aws_security_group.redis.id]
subnet_group_name = aws_elasticache_subnet_group.primary.name
apply_immediately = true
number_cache_clusters = 1
}
resource "aws_elasticache_replication_group" "secondary" {
provider = aws.frontend
replication_group_id = "${var.frontend_prefix}-us-redis-secondary-rg"
replication_group_description = "Secondary replication group"
global_replication_group_id = aws_elasticache_global_replication_group.this.global_replication_group_id
security_group_ids = [aws_security_group.redis_frontend.id]
subnet_group_name = aws_elasticache_subnet_group.secondary.name
}
Debug Output
---[ REQUEST POST-SIGN ]-----------------------------
POST / HTTP/1.1
Host: elasticache.us-east-1.amazonaws.com
User-Agent: APN/1.0 HashiCorp/1.0 Terraform/1.1.9 (+https://www.terraform.io) terraform-provider-aws/dev (+https://registry.terraform.io/providers/hashicorp/aws) aws-sdk-go/1.44.10 (go1.17.6; darwin; arm64)
Content-Length: 230
Authorization: AWS4-HMAC-SHA256 Credential=/20220518/us-east-1/elasticache/aws4_request, SignedHeaders=content-length;content-type;host;x-amz-date, Signature=e776d3a9db3b8d328f0fd8f533740f69cc5eb90728e1887f8761af57f2f79a5c
Content-Type: application/x-www-form-urlencoded; charset=utf-8
X-Amz-Date: 20220518T142815Z
Accept-Encoding: gzip
Action=CreateReplicationGroup&AutoMinorVersionUpgrade=true&GlobalReplicationGroupId=iudkw-backend-poc&ReplicationGroupDescription=Secondary+replication+group&ReplicationGroupId=frontend-poc-us-redis-secondary-rg&Version=2015-02-02
-----------------------------------------------------: timestamp=2022-05-18T16:28:15.546+0200
2022-05-18T16:28:16.085+0200 [DEBUG] provider.terraform-provider-aws_v4.14.0_x5: [aws-sdk-go] DEBUG: Response elasticache/CreateReplicationGroup Details:
---[ RESPONSE ]--------------------------------------
HTTP/1.1 400 Bad Request
Connection: close
Content-Length: 374
Content-Type: text/xml
Date: Wed, 18 May 2022 14:28:15 GMT
X-Amzn-Requestid: 93343807-e7f7-49c4-85ea-8cf403acaaf1
-----------------------------------------------------: timestamp=2022-05-18T16:28:16.083+0200
2022-05-18T16:28:16.085+0200 [DEBUG] provider.terraform-provider-aws_v4.14.0_x5: [aws-sdk-go] <ErrorResponse xmlns="http://elasticache.amazonaws.com/doc/2015-02-02/">
<Error>
<Type>Sender</Type>
<Code>InvalidParameterCombination</Code>
<Message>Cannot use the given parameters when creating new replication group in an existing global replication group.</Message>
</Error>
<RequestId>93343807-e7f7-49c4-85ea-8cf403acaaf1</RequestId>
</ErrorResponse>: timestamp=2022-05-18T16:28:16.083+0200
2022-05-18T16:28:16.085+0200 [DEBUG] provider.terraform-provider-aws_v4.14.0_x5: [aws-sdk-go] DEBUG: Validate Response elasticache/CreateReplicationGroup failed, attempt 0/25, error InvalidParameterCombination: Cannot use the given parameters when creating new replication group in an existing global replication group.
status code: 400, request id: 93343807-e7f7-49c4-85ea-8cf403acaaf1: timestamp=2022-05-18T16:28:16.083+0200
2022-05-18T16:28:16.128+0200 [ERROR] vertex "aws_elasticache_replication_group.secondary" error: error creating ElastiCache Replication Group (frontend-poc-us-redis-secondary-rg): InvalidParameterCombination: Cannot use the given parameters when creating new replication group in an existing global replication group.
status code: 400, request id: 93343807-e7f7-49c4-85ea-8cf403acaaf1
â•·
│ Warning: Argument is deprecated
│
│ with aws_elasticache_replication_group.primary,
│ on backend.tf line 85, in resource "aws_elasticache_replication_group" "primary":
│ 85: replication_group_description = "Primary replication group"
│
│ Use description instead
│
│ (and 6 more similar warnings elsewhere)
╵
â•·
│ Error: error creating ElastiCache Replication Group (frontend-poc-us-redis-secondary-rg): InvalidParameterCombination: Cannot use the given parameters when creating new replication group in an existing global replication group.
│ status code: 400, request id: 93343807-e7f7-49c4-85ea-8cf403acaaf1
│
│ with aws_elasticache_replication_group.secondary,
│ on frontend.tf line 149, in resource "aws_elasticache_replication_group" "secondary":
│ 149: resource "aws_elasticache_replication_group" "secondary" {
│
╵
2022-05-18T16:28:16.158+0200 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = transport is closing"
2022-05-18T16:28:16.162+0200 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/hashicorp/aws/4.14.0/darwin_arm64/terraform-provider-aws_v4.14.0_x5 pid=89300
2022-05-18T16:28:16.164+0200 [DEBUG] provider: plugin exited
Panic Output
Expected Behavior
Expected to successfully create following resources:
- Primary replication group in default provider
- Global replication group in default provider
- Secondary replication group in
frontendprovider
Actual Behavior
Creation of Secondary replication group fails with error InvalidParameterCombination Cannot use the given parameters when creating new replication group in an existing global replication group. because the provider is sending following in query string Action=CreateReplicationGroup&AutoMinorVersionUpgrade=true&GlobalReplicationGroupId=iudkw-backend-poc&ReplicationGroupDescription=Secondary+replication+group&ReplicationGroupId=frontend-poc-us-redis-secondary-rg&Version=2015-02-02 which contains AutoMinorVersionUpgrade=true that actually causes conflicting error, even tho this was never explicitly defined in the actual resource.
Steps to Reproduce
terraform apply
Important Factoids
References
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 35
- Comments: 24 (3 by maintainers)
This was resolved for me with aws provider version
4.18.0. (I received this error in4.8.0version of aws provider). Give it a try with4.18.0The same problem, but we use
3.74.3of the AWS provider. So weird, because nothing changed in our terraform code, it deployed a hundred times with the same settings, and now we got this issue.Facing same issue while creating a secondary instance in a global datastore, always get this message regardless of combination: InvalidParameterCombination: Cannot use the given parameters when creating new replication group in an existing global replication group. update: not working from terraform, provider aws~4.2.0, but works if you create from AWS UI.
We are experiencing the same problem. Is there any progress in the bug(?) above?
Note that the same problem happens in cluster mode (with GDS too).
Hai, We are facing the same issue on hashicorp/aws v4.29.0 version. Here is the config if that helps to reproduce:
aws_elasticache_replication_group.secondary will be created
apply_immediately = (known after apply)
arn = (known after apply)
at_rest_encryption_enabled = (known after apply)
auto_minor_version_upgrade = true
automatic_failover_enabled = false
cluster_enabled = (known after apply)
configuration_endpoint_address = (known after apply)
data_tiering_enabled = (known after apply)
description = “secondary replication group”
engine = “redis”
engine_version = (known after apply)
engine_version_actual = (known after apply)
global_replication_group_id = “ldgnf-test-global-cy-cyogesh”
id = (known after apply)
maintenance_window = (known after apply)
member_clusters = (known after apply)
multi_az_enabled = false
node_type = (known after apply)
num_cache_clusters = 1
num_node_groups = (known after apply)
number_cache_clusters = (known after apply)
parameter_group_name = (known after apply)
port = 6379
primary_endpoint_address = (known after apply)
reader_endpoint_address = (known after apply)
replicas_per_node_group = (known after apply)
replication_group_description = (known after apply)
replication_group_id = “example-secondary”
security_group_ids = (known after apply)
security_group_names = (known after apply)
snapshot_retention_limit = 1
snapshot_window = “10:00-12:00”
subnet_group_name = (known after apply)
transit_encryption_enabled = (known after apply)
cluster_mode {
Regards Yogesh Chandrakanth
is it possible to request the AWS provider provide better output on what parameters are invalid for the
InvalidParameterCombinationerror?I can confirm that any combination of variables results in the behavior stated above. Furthermore, if you create the replication group in the UI and then import it into terraform, it results in a
InvalidGlobalReplicationGroupStateerror on a subsequent apply. For now, we’re using terraform to manage theaws_elasticache_global_replication_groupitself, while just managing the secondary cluster out-of-band until the bug is fixed.