crossplane-contrib / provider-upjet-aws

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

[Bug]: Observe fails for VPC and Subnets with observe failed: external resource does not exist #1385

Closed ayanevbg closed 5 days ago

ayanevbg commented 5 days ago

Is there an existing issue for this?

Affected Resource(s)

ec2.aws.upbound.io/v1beta1 - VPC, Subnet

Resource MRs required to reproduce the bug

No response

Steps to Reproduce

  1. Create a VPC

`

apiVersion: ec2.aws.upbound.io/v1beta1 kind: VPC metadata: labels: vpc.upbound.io/name: test-vpc name: test-vpc spec: deletionPolicy: Orphan # Do not delete the VPC after the c forProvider: cidrBlock: 10.0.0.0/16 region: us-west-1 enableDnsHostnames: true tags: Name: test-vpc `

  1. Delete the resource and try to recreate it with managementPolicies: ["Observe"]

`

apiVersion: ec2.aws.upbound.io/v1beta1 kind: VPC metadata: labels: vpc.upbound.io/name: test-vpc name: test-vpc spec: deletionPolicy: Orphan managementPolicies: ["Observe"] forProvider: cidrBlock: 10.0.0.0/16 region: us-west-1 enableDnsHostnames: true tags: Name: test-vpc `

What happened?

Unable to find VPC and Subnets with management policy set to "Observe". It gives observe failed: external resource does not exist even though the resources exist.

This can be observed even when you create a VPC first, then delete it deletion policy set to Orphan and finally with the same configuration try to create a resource with management policies set to ["Observe"]. It fails with the same error.

Relevant Error Output Snippet

No response

Crossplane Version

1.16.0

Provider Version

1.7.0

Kubernetes Version

No response

Kubernetes Distribution

No response

Additional Info

No response

ayanevbg commented 5 days ago

Setting this annotation seems to be required.

annotations: crossplane.io/external-name:

This did the trick for me.