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

Redis ReplicationGroup doesn't properly observe that it exists, attempts to recreate itself on reconcile #158

Open throwanexception opened 2 years ago

throwanexception commented 2 years ago

What happened?

    message: "create failed: cannot apply: apply failed: Error creating ElastiCache
      Replication Group (sample-redis-2): ReplicationGroupAlreadyExists: Replication
      group with specified name already exists.\n\tstatus code: 400, request id: 3857b163-3ff8-4eb1-9d57-73f24831ac6d:
      : File name: main.tf.json"
    reason: ReconcileError

It does complete the initial creation of the Replication Group.

Possibly relevant metadata:

metadata:
  annotations:
    crossplane.io/external-create-failed: "2022-01-31T21:19:22Z"
    crossplane.io/external-create-pending: "2022-01-31T21:19:16Z"
    crossplane.io/external-name: sample-redis-2

How can we reproduce it?

apiVersion: elasticache.aws.jet.crossplane.io/v1alpha2
kind: ReplicationGroup
metadata:
  name: sample-redis-2
spec:
  deletionPolicy: Delete
  forProvider:
    applyImmediately: true
    atRestEncryptionEnabled: true
    automaticFailoverEnabled: true
    engine: redis
    engineVersion: 3.2.6
    multiAzEnabled: true
    nodeType: cache.m5.large
    numberCacheClusters: 3
    parameterGroupName: default.redis3.2
    port: 6379
    region: us-west-2
    replicationGroupDescription: I am a redis server
    subnetGroupName: elasticache
    tags:
      managed-by: crossplane
    transitEncryptionEnabled: true
  providerConfigRef:
    name: jet-aws-provider

What environment did it happen in?

Crossplane version: v1.6.1 JET AWS version: v0.4.0 Kubernetes version:

Server Version: version.Info{Major:"1", Minor:"21+", GitVersion:"v1.21.5-eks-bc4871b", GitCommit:"5236faf39f1b7a7dabea8df12726f25608131aa9", GitTreeState:"clean", BuildDate:"2021-10-29T23:32:16Z", GoVersion:"go1.16.8", Compiler:"gc", Platform:"linux/amd64"}