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

automatic_failover_enabled for globaldatastore #27

Open
mcujba opened this issue Dec 24, 2024 · 1 comment
Open

automatic_failover_enabled for globaldatastore #27

mcujba opened this issue Dec 24, 2024 · 1 comment
Labels

Comments

@mcujba
Copy link

mcujba commented Dec 24, 2024

Description

In process to enable automatic_failover_enabled for global datastore, module, try to enable it also for each instance

15:50:48.972 STDOUT tofu: plan. Resource actions are indicated with the following symbols:
15:50:48.972 STDOUT tofu:   ~ update in-place
15:50:48.972 STDOUT tofu: OpenTofu will perform the following actions:
15:50:48.972 STDOUT tofu:   # module.euc1.aws_elasticache_replication_group.global[0] will be updated in-place
15:50:48.972 STDOUT tofu:   ~ resource "aws_elasticache_replication_group" "global" {
15:50:48.972 STDOUT tofu:       ~ automatic_failover_enabled  = false -> true
15:50:48.972 STDOUT tofu:         id                          = "redis-202412-euc1"
15:50:48.972 STDOUT tofu:         tags                        = {
15:50:48.972 STDOUT tofu:             "Environment"           = "dev"
15:50:48.972 STDOUT tofu:             "Terraform"             = "true"
15:50:48.972 STDOUT tofu:             "terraform-aws-modules" = "elasticache"
15:50:48.972 STDOUT tofu:         }
15:50:48.972 STDOUT tofu:         # (36 unchanged attributes hidden)
15:50:48.972 STDOUT tofu:         # (1 unchanged block hidden)
15:50:48.973 STDOUT tofu:     }
15:50:48.973 STDOUT tofu:   # module.usw2.aws_elasticache_global_replication_group.this[0] will be updated in-place
15:50:48.973 STDOUT tofu:   ~ resource "aws_elasticache_global_replication_group" "this" {
15:50:48.973 STDOUT tofu:       ~ automatic_failover_enabled           = false -> true
15:50:48.973 STDOUT tofu:         id                                   = "sgaui-redis-202412-usw2"
15:50:48.973 STDOUT tofu:         # (15 unchanged attributes hidden)
15:50:48.973 STDOUT tofu:     }
15:50:48.973 STDOUT tofu:   # module.usw2.aws_elasticache_replication_group.global[0] will be updated in-place
15:50:48.973 STDOUT tofu:   ~ resource "aws_elasticache_replication_group" "global" {
15:50:48.973 STDOUT tofu:       ~ automatic_failover_enabled  = false -> true
15:50:48.973 STDOUT tofu:         id                          = "redis-202412-usw2"
15:50:48.973 STDOUT tofu:         tags                        = {
15:50:48.973 STDOUT tofu:             "Environment"           = "dev"
15:50:48.973 STDOUT tofu:             "Terraform"             = "true"
15:50:48.973 STDOUT tofu:             "terraform-aws-modules" = "elasticache"
15:50:48.973 STDOUT tofu:         }
15:50:48.973 STDOUT tofu:         # (36 unchanged attributes hidden)
15:50:48.973 STDOUT tofu:         # (1 unchanged block hidden)
15:50:48.973 STDOUT tofu:     }
15:50:48.973 STDOUT tofu: Plan: 0 to add, 3 to change, 0 to destroy.
15:50:48.973 STDOUT tofu: 
15:50:48.973 STDOUT tofu: 
15:50:48.973 STDOUT tofu: Do you want to perform these actions?
15:50:48.973 STDOUT tofu:   OpenTofu will perform the actions described above.
15:50:48.973 STDOUT tofu:   Only 'yes' will be accepted to approve.
15:50:48.974 STDOUT tofu:   Enter a value: 
yes
15:51:26.016 STDOUT tofu: module.usw2.aws_elasticache_replication_group.global[0]: Modifying... [id=redis-202412-usw2]
15:51:36.018 STDOUT tofu: module.usw2.aws_elasticache_replication_group.global[0]: Still modifying... [id=redis-202412-usw2, 10s elapsed]
15:51:46.018 STDOUT tofu: module.usw2.aws_elasticache_replication_group.global[0]: Still modifying... [id=redis-202412-usw2, 20s elapsed]
15:51:56.019 STDOUT tofu: module.usw2.aws_elasticache_replication_group.global[0]: Still modifying... [id=redis-202412-usw2, 30s elapsed]
15:51:57.129 STDERR tofu: ╷
15:51:57.129 STDERR tofu: │ Error: modifying ElastiCache Replication Group (redis-202412-usw2): operation error ElastiCache: ModifyReplicationGroup, https response error StatusCode: 400, RequestID: c5bf954a-5dba-4cb1-abe1-68006b3bed38, InvalidParameterValue: Cluster [redis-202412-usw2] is part of a global cluster [sgaui-redis-202412-usw2]. Request rejected.
15:51:57.129 STDERR tofu: │ 
15:51:57.129 STDERR tofu: │   with module.usw2.aws_elasticache_replication_group.global[0],
15:51:57.129 STDERR tofu: │   on .terraform/modules/usw2/main.tf line 152, in resource "aws_elasticache_replication_group" "global":
15:51:57.129 STDERR tofu: │  152: resource "aws_elasticache_replication_group" "global" {
15:51:57.129 STDERR tofu: │ 
15:51:57.129 STDERR tofu: ╵
15:51:57.528 STDOUT tofu: Releasing state lock. This may take a few moments...
15:51:57.997 ERROR  tofu invocation failed in ./.terragrunt-cache/UXxcoIqvzynzybuyTq1zlh3nf-s/7c9VC3QpzoaTd66v9hEWZD3PFO4
15:51:57.997 ERROR  error occurred:

* Failed to execute "tofu apply" in ./.terragrunt-cache/UXxcoIqvzynzybuyTq1zlh3nf-s/7c9VC3QpzoaTd66v9hEWZD3PFO4
  ╷
  │ Error: modifying ElastiCache Replication Group (redis-202412-usw2): operation error ElastiCache: ModifyReplicationGroup, https response error StatusCode: 400, RequestID: c5bf954a-5dba-4cb1-abe1-68006b3bed38, InvalidParameterValue: Cluster [redis-202412-usw2] is part of a global cluster [sgaui-redis-202412-usw2]. Request rejected.
  │ 
  │   with module.usw2.aws_elasticache_replication_group.global[0],
  │   on .terraform/modules/usw2/main.tf line 152, in resource "aws_elasticache_replication_group" "global":
  │  152: resource "aws_elasticache_replication_group" "global" {
  │ 
  ╵
  
  exit status 1

Versions

  • Module version [Required]: 1.4

  • Terraform version:

tofu --version
OpenTofu v1.8.7
on darwin_arm64
+ provider registry.opentofu.org/hashicorp/aws v5.82.2
+ provider registry.opentofu.org/hashicorp/random v3.6.3

Reproduction Code [Required]

set true for automatic_failover_enabled on global datastore cluster

module "usw2" {
  source = "terraform-aws-modules/elasticache/aws"
  version = "~> 1.4"

  providers = {
    aws = aws.us_west_2
  }

  replication_group_id  = var.instances["usw2"].name
  
  create_primary_global_replication_group = true
  engine_version = "7.1"
  node_type      = "cache.m6g.large"
  
  automatic_failover_enabled = var.automatic_failover_enabled

  # Security Group
  vpc_id = var.instances["usw2"].vpc_id
  security_group_rules = {
      for cidr in var.allow_connections_from_these_subnets : "ingress_dynamic_${replace(cidr, ".", "_")}" => {
        description = "Allow inbound from ${cidr}"
        cidr_ipv4   = cidr
      }
  }

  # Subnet Group
  subnet_ids = var.instances["usw2"].private_subnets

  tags = var.tags
}
``
Copy link

This issue has been automatically marked as stale because it has been open 30 days
with no activity. Remove stale label or comment or this issue will be closed in 10 days

@github-actions github-actions bot added the stale label Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant