Skip to content

v0.41.3: Unable to apply new Parameter Group with existing resources #142

@syphernl

Description

@syphernl

Describe the Bug

The changes done in v0.41.3 (#141) causes issues with existing resources.
Since it re-uses the same name Terraform will try to remove it. But since it is in use, it will fail:

│ Error: error deleting ElastiCache Parameter Group (PROJECT-staging-redis): InvalidCacheParameterGroupState: One or more cache clusters are still members of this parameter group PROJECT-staging-redis, so the group cannot be deleted.
│ 	status code: 400, request id: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Expected Behavior

No errors when applying changes.

Potential solution

  • The parameter group needs to be create_before_destroy
  • A unique name should be used. In the RDS module we can use name_prefix for a similar issue but unfortunately the aws_elasticache_parameter_group resource does not support this.

If this is not possible we can work around this by making the description of the parameter group configurable, so that the Managed by Terraform value can be used for existing resources.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug🐛 An issue with the system

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions