Open aleksandar-babic opened 2 years ago
Note that the same problem happens in cluster mode (with GDS too).
The same problem, but we use 3.74.3
of 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.
The same problem, but we use
3.74.3
of 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.
Agreed, I tried setting AWS provider version that I last used to do this exact same kind of deployment (with same code) and it wasn't working anymore.
We are experiencing the same problem. Is there any progress in the bug(?) above?
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.
I'm facing the same issue. However, the same values that I have defined in terraform do work in the cli and AWS Console.
@SimranSingh17 We are experiencing exactly the same problem
Anyone found a way to fix this?
reproducible in version 3.74.0
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 InvalidGlobalReplicationGroupState
error on a subsequent apply. For now, we're using terraform to manage the aws_elasticache_global_replication_group
itself, while just managing the secondary cluster out-of-band until the bug is fixed.
This was resolved for me with aws provider version 4.18.0
. (I received this error in 4.8.0
version of aws provider). Give it a try with 4.18.0
Can confirm with @Rustege this bare minimum setup that met our needs, we were able to create the secondary replica cluster without the InvalidParameterCombination error with version 4.18.0
AWS Provider:
resource "aws_elasticache_replication_group" "secondary" {
replication_group_id = "some-redis-replica"
description = "secondary replication group"
global_replication_group_id = data.terraform_remote_state.primary_redis.outputs.global_replication_group_id
subnet_group_name = aws_elasticache_subnet_group.redis.name
security_group_ids = [aws_security_group.redis.id]
lifecycle {
ignore_changes = [engine_version]
}
}
Hello everyone. I cannot reproduce the error described here. Are you still seeing the error on recent versions of the provider? If so, which version(s)?
Hi
I was able to reprofuce from version 3.74 to 4.14
Best Regards Carlos
On Mon, Jul 4, 2022, 22:22 Graham Davison @.***> wrote:
Hello everyone. I cannot reproduce the error described here. Are you still seeing the error on recent versions of the provider? If so, which version(s)?
β Reply to this email directly, view it on GitHub https://github.com/hashicorp/terraform-provider-aws/issues/24854#issuecomment-1174531147, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZEQ66JXECW2Y4JAY6TYUGDVSOL5XANCNFSM5WIWWVUA . You are receiving this because you commented.Message ID: @.***>
is it possible to request the AWS provider provide better output on what parameters are invalid for the InvalidParameterCombination
error?
Hi,
Still doesn't work with 4.14.
Here is the config if that helps to reproduce:
# aws_elasticache_global_replication_group.redis_global_datastore["green"] will be created
+ resource "aws_elasticache_global_replication_group" "redis_global_datastore" {
+ arn = (known after apply)
+ at_rest_encryption_enabled = (known after apply)
+ auth_token_enabled = (known after apply)
+ cache_node_type = (known after apply)
+ cluster_enabled = (known after apply)
+ engine = (known after apply)
+ engine_version_actual = (known after apply)
+ global_replication_group_id = (known after apply)
+ global_replication_group_id_suffix = "decision-engine-green"
+ id = (known after apply)
+ primary_replication_group_id = (known after apply)
+ transit_encryption_enabled = (known after apply)
}
# module.cluster_primary["green"].aws_elasticache_replication_group.redis-cache will be created
+ resource "aws_elasticache_replication_group" "redis-cache" {
+ apply_immediately = true
+ arn = (known after apply)
+ at_rest_encryption_enabled = (known after apply)
+ auto_minor_version_upgrade = "true"
+ automatic_failover_enabled = true
+ cluster_enabled = (known after apply)
+ configuration_endpoint_address = (known after apply)
+ data_tiering_enabled = (known after apply)
+ description = "Decision Engine Redis green Cache"
+ engine = "redis"
+ engine_version = "5.0.6"
+ engine_version_actual = (known after apply)
+ global_replication_group_id = (known after apply)
+ id = (known after apply)
+ maintenance_window = (known after apply)
+ member_clusters = (known after apply)
+ multi_az_enabled = true
+ node_type = "cache.r6g.xlarge"
+ num_cache_clusters = (known after apply)
+ num_node_groups = 1
+ number_cache_clusters = (known after apply)
+ parameter_group_name = "default.redis5.0.cluster.on"
+ port = 6379
+ primary_endpoint_address = (known after apply)
+ reader_endpoint_address = (known after apply)
+ replicas_per_node_group = 2
+ replication_group_description = (known after apply)
+ replication_group_id = "decision-engine-green-test"
+ 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 = "decision-engine-green-subnet-group-test-us-west-2"
+ tags = {
+ "Terraform" = "true"
}
+ tags_all = {
+ "Terraform" = "true"
}
+ transit_encryption_enabled = (known after apply)
+ cluster_mode {
+ num_node_groups = (known after apply)
+ replicas_per_node_group = (known after apply)
}
}
# module.cluster_secondary["green"].aws_elasticache_replication_group.redis-cache will be created
+ resource "aws_elasticache_replication_group" "redis-cache" {
+ apply_immediately = false
+ arn = (known after apply)
+ at_rest_encryption_enabled = (known after apply)
+ auto_minor_version_upgrade = "true"
+ automatic_failover_enabled = true
+ cluster_enabled = (known after apply)
+ configuration_endpoint_address = (known after apply)
+ data_tiering_enabled = (known after apply)
+ description = "Decision Engine secondary green Cache"
+ engine = "redis"
+ engine_version = (known after apply)
+ engine_version_actual = (known after apply)
+ global_replication_group_id = (known after apply)
+ id = (known after apply)
+ maintenance_window = (known after apply)
+ member_clusters = (known after apply)
+ multi_az_enabled = true
+ node_type = (known after apply)
+ num_cache_clusters = (known after apply)
+ 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 = 2
+ replication_group_description = (known after apply)
+ replication_group_id = "decision-engine-green-test"
+ 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 = "decision-engine-green-subnet-group-test-us-east-1"
+ tags = {
+ "Terraform" = "true"
}
+ tags_all = {
+ "Terraform" = "true"
}
+ transit_encryption_enabled = (known after apply)
+ cluster_mode {
+ num_node_groups = (known after apply)
+ replicas_per_node_group = (known after apply)
}
}
Cheers, Nico
We tested the code with minimal viable parameters and even with provider 4.18.0 and still seeing this error. Do any one have consistent success with latest provider?
Hai, We are facing the same issue on hashicorp/aws v4.29.0 version. Here is the config if that helps to reproduce:
resource "aws_elasticache_replication_group" "secondry" {
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
i just tried version 4.33.0
and it works. it was failing for me before (4.12.1
). my global-datasore and both primary and secondary are new clusters. i have the basic setup right now -
resource "aws_elasticache_global_replication_group" "elasticache_global" {
global_replication_group_id_suffix = "preprod-test-elasticache-01"
primary_replication_group_id = aws_elasticache_replication_group.primary.id
}
resource "aws_elasticache_replication_group" "primary" {
replication_group_id = "preprod-test-elasticache-01-us-east-2"
description = "primary replication group"
engine = "redis"
engine_version = "6.2"
node_type = "cache.m6g.large"
auto_minor_version_upgrade = true
num_cache_clusters = 2
}
resource "aws_elasticache_replication_group" "secondary" {
provider = aws.oregon
replication_group_id = "preprod-test-elasticache-01-us-west-2"
description = "secondary replication group"
global_replication_group_id = aws_elasticache_global_replication_group.elasticache_global.global_replication_group_id
num_cache_clusters = 1
}
apply -
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
# aws_elasticache_global_replication_group.elasticache_global will be created
+ resource "aws_elasticache_global_replication_group" "elasticache_global" {
+ arn = (known after apply)
+ at_rest_encryption_enabled = (known after apply)
+ auth_token_enabled = (known after apply)
+ cache_node_type = (known after apply)
+ cluster_enabled = (known after apply)
+ engine = (known after apply)
+ engine_version = (known after apply)
+ engine_version_actual = (known after apply)
+ global_replication_group_id = (known after apply)
+ global_replication_group_id_suffix = "preprod-test-elasticache-01"
+ id = (known after apply)
+ primary_replication_group_id = (known after apply)
+ transit_encryption_enabled = (known after apply)
}
# aws_elasticache_replication_group.primary will be created
+ resource "aws_elasticache_replication_group" "primary" {
+ 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 = "primary replication group"
+ engine = "redis"
+ engine_version = "6.2"
+ engine_version_actual = (known after apply)
+ global_replication_group_id = (known after apply)
+ id = (known after apply)
+ maintenance_window = (known after apply)
+ member_clusters = (known after apply)
+ multi_az_enabled = false
+ node_type = "cache.m6g.large"
+ num_cache_clusters = 2
+ num_node_groups = (known after apply)
+ number_cache_clusters = (known after apply)
+ parameter_group_name = (known after apply)
+ 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 = "preprod-test-elasticache-01-us-east-2"
+ security_group_ids = (known after apply)
+ security_group_names = (known after apply)
+ snapshot_window = (known after apply)
+ subnet_group_name = (known after apply)
+ tags_all = (known after apply)
+ transit_encryption_enabled = (known after apply)
+ cluster_mode {
+ num_node_groups = (known after apply)
+ replicas_per_node_group = (known after apply)
}
}
# aws_elasticache_replication_group.secondary will be created
+ resource "aws_elasticache_replication_group" "secondary" {
+ apply_immediately = (known after apply)
+ arn = (known after apply)
+ at_rest_encryption_enabled = (known after apply)
+ auto_minor_version_upgrade = (known after apply)
+ 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 = (known after apply)
+ 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)
+ 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 = "preprod-test-elasticache-01-us-west-2"
+ security_group_ids = (known after apply)
+ security_group_names = (known after apply)
+ snapshot_window = (known after apply)
+ subnet_group_name = (known after apply)
+ tags_all = (known after apply)
+ transit_encryption_enabled = (known after apply)
+ cluster_mode {
+ num_node_groups = (known after apply)
+ replicas_per_node_group = (known after apply)
}
}
Plan: 3 to add, 0 to change, 0 to destroy.
...
Apply complete! Resources: 3 added, 0 changed, 0 destroyed.
re-run with minor changes -
Terraform will perform the following actions:
# aws_elasticache_replication_group.primary will be updated in-place
~ resource "aws_elasticache_replication_group" "primary" {
+ apply_immediately = true
~ auto_minor_version_upgrade = "false" -> "true"
id = "preprod-test-elasticache-01-us-east-2"
~ tags = {
+ "infra" = "terraform"
}
~ tags_all = {
+ "infra" = "terraform"
}
# (31 unchanged attributes hidden)
# (1 unchanged block hidden)
}
# aws_elasticache_replication_group.secondary will be updated in-place
~ resource "aws_elasticache_replication_group" "secondary" {
+ apply_immediately = true
~ auto_minor_version_upgrade = "false" -> "true"
id = "preprod-test-elasticache-01-us-west-2"
~ member_clusters = [
- "preprod-test-elasticache-01-us-west-2-001",
] -> (known after apply)
~ num_cache_clusters = 1 -> 2
~ tags = {
+ "infra" = "terraform"
}
~ tags_all = {
+ "infra" = "terraform"
}
# (29 unchanged attributes hidden)
# (1 unchanged block hidden)
}
Plan: 0 to add, 2 to change, 0 to destroy.
...
Error: error updating ElastiCache Replication Group (preprod-test-elasticache-01-us-east-2): InvalidParameterValue: Cluster [preprod-test-elasticache-01-us-east-2] is part of a global cluster [fpkhr-preprod-test-elasticache-01]. Request rejected.
...
Error: error updating ElastiCache Replication Group (preprod-test-elasticache-01-us-west-2): InvalidParameterValue: Cluster [preprod-test-elasticache-01-us-west-2] is part of a global cluster [fpkhr-preprod-test-elasticache-01]. Request rejected.
2nd apply not so good. :-\
AH!!! looks like by auto_minor_version_upgrade
tries to set to true
every apply which causes the issue above, i ended up ignoring with lifecycle
-
lifecycle {
prevent_destroy = true
ignore_changes = [
auto_minor_version_upgrade,
]
}
... then it works fine...
is it possible to request the AWS provider provide better output on what parameters are invalid for the
InvalidParameterCombination
error?
That is an error message from the AWS API, so unfortunately we have no control over it. We try to configure plan-time validation for resources, but sometime we miss some cases.
@aleksandar-babic, are you still seeing this error with updated versions of the provider?
For the 3.70.0 provider version, we tried the same configuration as documented by Terraform in provider version 3.70.0 and faced the same issue of InvalidParameterCombination, but when the same configuration was tried using version 4.15.0, it worked fine.Β
resource "aws_elasticache_replication_group" "secondary" {
replication_group_id = "example-secondary"
replication_group_description = "secondary replication group"
global_replication_group_id = aws_elasticache_global_replication_group.example.global_replication_group_id
number_cache_clusters = 1
}
resource "aws_elasticache_global_replication_group" "example" {
provider = aws.other_region
global_replication_group_id_suffix = "example"
primary_replication_group_id = aws_elasticache_replication_group.primary.id
}
resource "aws_elasticache_replication_group" "primary" {
provider = aws.other_region
replication_group_id = "example-primary"
replication_group_description = "primary replication group"
engine = "redis"
engine_version = "5.0.6"
node_type = "cache.m5.large"
number_cache_clusters = 1
}
Is this issue completely resolved in provider version 4.15.0?
we're running into the same issue and the provider version is 4.67.0
and still running into the same problem, we added the lifecycle ignore
section as mentioned in one of the comments above, but no luck. Do you have any other suggestions?
Having same issue. I've tried all the workarounds that I found but without any progress. Same error is returned. I have tried the code that is provided as example here https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/elasticache_replication_group.html and I got same error. Could you please help? I'm using 4.2.0 provider version
Community Note
Terraform CLI and Terraform AWS Provider Version
Affected Resource(s)
Terraform Configuration Files
Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.
Debug Output
Panic Output
Expected Behavior
Expected to successfully create following resources:
frontend
providerActual 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 stringAction=CreateReplicationGroup&AutoMinorVersionUpgrade=true&GlobalReplicationGroupId=iudkw-backend-poc&ReplicationGroupDescription=Secondary+replication+group&ReplicationGroupId=frontend-poc-us-redis-secondary-rg&Version=2015-02-02
which containsAutoMinorVersionUpgrade=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
0000