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 elasticache cannot be imported into xplane #196

Open kumudkhk opened 2 years ago

kumudkhk commented 2 years ago

What happened?

Existing Redis replicationgroup cannot be imported when Redis is in non-cluster mode. Though the cluster mode is disabled, it tries to set the mode on and creates conflict.

    clusterMode:
    - numNodeGroups: 1
      replicasPerNodeGroup: 2

Error

observe failed: cannot run refresh: refresh failed: Conflicting configuration arguments: "number_cache_clusters": conflicts with cluster_mode.0.num_node_groups: File name: main.tf.json
      Conflicting configuration arguments: "cluster_mode.0.num_node_groups": conflicts with number_cache_clusters: File name: main.tf.json

How can we reproduce it?

Create elasticache replicationgroup manually in non cluster mode and try to import it.

apiVersion: elasticache.aws.jet.crossplane.io/v1alpha2
kind: ReplicationGroup
metadata:
  name: xplane-import
  annotations:
    crossplane.io/external-name: xplane
spec:
  providerConfigRef:
    name: jet-aws-provider
  forProvider:
    replicationGroupDescription: imported redis
    region: us-west-2
    tags:
      managed-by: crossplane

What environment did it happen in?

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

kumudkhk commented 2 years ago

It tries to include both "numberCacheClusters" and "clusterMode" even though when clusterMode is disabled.

    - numNodeGroups: 1
      replicasPerNodeGroup: 2
      .....
    numberCacheClusters: 3
haarchri commented 2 years ago

@muvaf can be closed as of #199