crossplane-contrib / provider-jet-aws

AWS Provider for Crossplane that is built with Terrajet.
https://crossplane.io
Apache License 2.0
37 stars 30 forks source link

Reconciliation fails for elasticache replication group #195

Closed kumudkhk closed 2 years ago

kumudkhk commented 2 years ago

What happened?

This bug is for replicationgroup.elasticache.aws.jet.crossplane.io/v1alpha2

Crossplane is able to create the replication group and then it goes into reconciliation error saying "Error creating Elasticache Replication group". It does create the resource in AWS and then the reconciliation fails leaving the object is erroneous state.

DEBUG   provider-jet-aws        Cannot create external resource {"controller": "managed/elasticache.aws.jet.crossplane.io/v1alpha2, kind=replicationgroup", "request": "/redis-test", "uid": "123456789", "version": "835937905", "external-name": "redis-test", "error": "cannot apply: apply failed: Error creating ElastiCache Replication Group (redis-test): ReplicationGroupAlreadyExists: Replication group with specified name already exists.\n\tstatus code: 400, request id: 123456789: : File name: main.tf.json", "errorVerbose": "apply failed: Error creating ElastiCache Replication Group (redis-test): ReplicationGroupAlreadyExists: Replication group with specified name already exists.\n\tstatus code: 400, request id: 123456789: : File name: main.tf.json\ncannot apply\ngithub.com/crossplane/terrajet/pkg/controller.(*external)

Because of the above error, the process does not fully complete and the READY/SYNC status is set to false.

NAME                READY   SYNCED   EXTERNAL-NAME   AGE
redis-test   False   False    redis-test          12h

How can we reproduce it?

apiVersion: elasticache.aws.jet.crossplane.io/v1alpha2
kind: ReplicationGroup
metadata:
  name: redis-test
  annotations:
        crossplane.io/external-name: redis-test
spec:
  providerConfigRef:
    name: jet-aws-provider
  forProvider:
    applyImmediately: true
    subnetGroupName: nameOfSg
    atRestEncryptionEnabled: true
    automaticFailoverEnabled: true
    nodeType: cache.m5.large
    parameterGroupName: redis32
    engine: redis
    engineVersion: "3.2.6"
    multiAzEnabled: true
    numberCacheClusters: 2
    port: 6379
    transitEncryptionEnabled: true
    region: us-east-1
    securityGroupIds:
    - sg-abcd1234567
    tags:
      managed-by: crossplane
    replicationGroupDescription: "test redis instance"

What environment did it happen in?

Crossplane version: v1.6.3 Terrajet version: v0.4.0-39 Cloud: AWS K8S: EKS

haarchri commented 2 years ago

@kumudkhk please check #199 fixed replicationgroup creation issue & added new resources and ref/selector