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 import existing aws_elasticache_replication_group without recreate resource #207

Closed
ABRIO-PR opened this issue Oct 18, 2023 · 3 comments
Labels
bug 🐛 An issue with the system

Comments

@ABRIO-PR
Copy link

Describe the Bug

After importing an existing AWS ElastiCache for Redis, terraform wants to recreate it. This is caused by the "security_group_names" parameter. The other options in my template match the existing resource.

-/+ resource "aws_elasticache_replication_group" "default" {
      ~ arn                            = "arn:aws:elasticache:us-east-1:276741630740:replicationgroup:redis" -> (known after apply)
      ~ cluster_enabled                = false -> (known after apply)
      + configuration_endpoint_address = (known after apply)
      ~ engine_version_actual          = "6.2.6" -> (known after apply)
      + global_replication_group_id    = (known after apply)
      ~ id                             = "redis" -> (known after apply)
      ~ member_clusters                = [
          - "redis-001",
        ] -> (known after apply)
      ~ num_node_groups                = 1 -> (known after apply)
      ~ primary_endpoint_address       = "redis.6jpnqy.ng.0001.use1.cache.amazonaws.com" -> (known after apply)
      ~ reader_endpoint_address        = "redis-ro.6jpnqy.ng.0001.use1.cache.amazonaws.com" -> (known after apply)
      ~ replicas_per_node_group        = 0 -> (known after apply)
      + security_group_names           = (known after apply) # forces replacement
        tags                           = {
            "Name" = "redis"
        }
      - user_group_ids                 = [] -> null
        # (21 unchanged attributes hidden)
    }

By adding to the resource 'resource "aws_elasticache_replication_group" "default"' in the module

  lifecycle {
    ignore_changes = [
      security_group_names,
    ]
  }

it works great and Terraform doesn't find any changes.

The module does not support the "security_group_names" parameter

Expected Behavior

No changes. Your infrastructure matches the configuration.

Steps to Reproduce

terraform import 'module.redis-cluster["elasticache-redis"].aws_elasticache_replication_group.default[0]' elasticache-redis

Screenshots

No response

Environment

Module version = "0.53.0"
Terraform version = "1.5.0"
Provider version = "5.21.0"

Additional Context

No response

@ABRIO-PR ABRIO-PR added the bug 🐛 An issue with the system label Oct 18, 2023
@y3ti
Copy link
Contributor

y3ti commented Dec 6, 2023

It's a bug in AWS Provider: hashicorp/terraform-provider-aws#32835

@y3ti
Copy link
Contributor

y3ti commented Dec 21, 2023

Fixed in v1.2.0

@ABRIO-PR
Copy link
Author

It's great! It works for me. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 An issue with the system
Projects
None yet
Development

No branches or pull requests

2 participants