provider-aws icon indicating copy to clipboard operation
provider-aws copied to clipboard

Elasticache ReplicationGroup unable to reduce numCacheClusters to 1

Open dhumphries-sainsburys opened this issue 2 years ago • 0 comments

What happened?

Reducing of the numCacheClusters value of a replicationgroup object to 1 does not remove the replica nodes within AWS and returns the below in the aws provider logs. At the same time as this reduction i am also setting automaticFailoverEnabled to false as it should be. I notice this also isn't being referenced in the AWS console but that seems to be a different issue

1.6704252979968593e+09 DEBUG events Warning {"object": {"kind":"ReplicationGroup","name":"test-dan-humphries-lab-dan-test-redis2","uid":"0aa74011-41d7-4887-bb12-9309cd2cc6c9","apiVersion":"cache.aws.crossplane.io/v1beta1","resourceVersion":"2543804564"}, "reason": "CannotUpdateExternalResource", "message": "cannot modify ElastiCache replication group: at least 1 replica is required"}

How can we reproduce it?

  1. Create replicationgroup like below
kind: ReplicationGroup
metadata:
  name: test-dan-humphries-lab-dan-test-redis4
spec:
  deletionPolicy: Delete
  forProvider:
    applyModificationsImmediately: true
    atRestEncryptionEnabled: true
    authEnabled: false
    automaticFailoverEnabled: false
    cacheNodeType: cache.t3.micro
    cacheParameterGroupName: default.redis6.x
    cacheSubnetGroupName: lab-data
    engine: redis
    engineVersion: 6.x
    numCacheClusters: 3
    preferredMaintenanceWindow: mon:05:00-mon:06:00
    region: eu-west-1
    replicationGroupDescription: test-dan-humphries-dan-test-redis4
    securityGroupIds:
      - sg-0f0506ae5e20ff6fe
    snapshotRetentionLimit: 0
    snapshotWindow: 23:00-00:00
    transitEncryptionEnabled: true
  providerConfigRef:
    name: aws
  providerRef:
    name: aws
  writeConnectionSecretToRef:
    name: test-dan-humphries-redis-dan-test-redis4
    namespace: flux-system
  1. Allow the elasticache cluster to deploy
  2. Edit replicationgroup object and reduce numCacheClusters to 1

What environment did it happen in?

Crossplane version: 1.8.1 AWS Provider: 0.27.1 Kubernetes: 1.22 Kubernetes distribution: EKS

dhumphries-sainsburys avatar Dec 07 '22 16:12 dhumphries-sainsburys