crossplane-contrib / provider-upjet-aws

Official AWS Provider for Crossplane by Upbound.
https://marketplace.upbound.io/providers/upbound/provider-aws
Apache License 2.0
142 stars 121 forks source link

SSM Parameter stores the ARN in forProvider instead of atProvider #678

Closed stevendborrelli closed 1 month ago

stevendborrelli commented 1 year ago

What happened?

SSM Parameter stores the ARN of the generated resource in forProvider instead of atProvider.

How can we reproduce it?

Apply the following yaml

apiVersion: v1
kind: Secret
metadata:
  name: parameter-secret
  namespace: upbound-system
data:
  example-key: dGVzdGtleQ==
type: Opaque
---
apiVersion: ssm.aws.upbound.io/v1beta1
kind: Parameter
metadata:
  annotations:
    meta.upbound.io/example-id: ssm/v1beta1/parameter
  labels:
    testing.upbound.io/example-name: foo
  name: foo
spec:
  forProvider:
    region: us-west-1
    type: String
    valueSecretRef:
      key: example-key
      name: parameter-secret
      namespace: upbound-system

Then verify that the arn is in the forProvider section:

spec:
    deletionPolicy: Delete
    forProvider:
      arn: arn:aws:ssm:us-west-1:609897127049:parameter/foo
      dataType: text
      region: us-west-1
      tags:
        crossplane-kind: parameter.ssm.aws.upbound.io
        crossplane-name: foo
        crossplane-providerconfig: default
      tier: Standard
      type: String
      valueSecretRef:
        key: example-key
        name: parameter-secret
        namespace: upbound-system
    providerConfigRef:
      name: default
  status:
    atProvider:
      id: foo
      tagsAll:
        crossplane-kind: parameter.ssm.aws.upbound.io
        crossplane-name: foo
        crossplane-providerconfig: default
      version: 1

What environment did it happen in?

turkenf commented 1 year ago

This issue can be reproduced. After the Observe Only support, we see the references of forProvider in atProvider. In this case we should not see the arn reference in forProvider. The following spec is from v0.34.0:

spec:
  deletionPolicy: Delete
  forProvider:
    arn: arn:aws:ssm:us-west-1:569674547146:parameter/foo
    dataType: text
    region: us-west-1
    tags:
      crossplane-kind: parameter.ssm.aws.upbound.io
      crossplane-name: foo
      crossplane-providerconfig: default
    tier: Standard
    type: String
    valueSecretRef:
      key: example-key
      name: parameter-secret
      namespace: upbound-system
  managementPolicy: FullControl
  providerConfigRef:
    name: default
status:
  atProvider:
    allowedPattern: ""
    arn: arn:aws:ssm:us-west-1:569674547146:parameter/foo
    dataType: text
    description: ""
    id: foo
    keyId: ""
    tags:
      crossplane-kind: parameter.ssm.aws.upbound.io
      crossplane-name: foo
      crossplane-providerconfig: default
    tagsAll:
      crossplane-kind: parameter.ssm.aws.upbound.io
      crossplane-name: foo
      crossplane-providerconfig: default
    tier: Standard
    type: String
    version: 1
github-actions[bot] commented 5 months ago

This provider repo does not have enough maintainers to address every issue. Since there has been no activity in the last 90 days it is now marked as stale. It will be closed in 14 days if no further activity occurs. Leaving a comment starting with /fresh will mark this issue as not stale.

github-actions[bot] commented 4 months ago

This issue is being closed since there has been no activity for 14 days since marking it as stale. If you still need help, feel free to comment or reopen the issue!

mbbush commented 4 months ago

This is still an issue. Fixing it will technically be a breaking change. My suspicion is that the arn field in the terraform provider schema has the wrong attributes set.

github-actions[bot] commented 1 month ago

This provider repo does not have enough maintainers to address every issue. Since there has been no activity in the last 90 days it is now marked as stale. It will be closed in 14 days if no further activity occurs. Leaving a comment starting with /fresh will mark this issue as not stale.

github-actions[bot] commented 1 month ago

This issue is being closed since there has been no activity for 14 days since marking it as stale. If you still need help, feel free to comment or reopen the issue!