crossplane-contrib / provider-upjet-aws

AWS Provider for Crossplane.
https://marketplace.upbound.io/providers/upbound/provider-family-aws/
Apache License 2.0
145 stars 122 forks source link

Unable to import an AWS bucket notification into Crossplane #1181

Closed giulio-chillipharm closed 2 months ago

giulio-chillipharm commented 7 months ago

Is there an existing issue for this?

Affected Resource(s)

Resource MRs required to reproduce the bug

`apiVersion: s3.aws.upbound.io/v1beta1 kind: Bucket metadata: name: my-imported-s3-bucket annotations: crossplane.io/external-name: test-bucket-sns-notification spec: managementPolicies: ["Observe"] forProvider: region: "eu-west-1"

apiVersion: s3.aws.upbound.io/v1beta1 kind: BucketNotification metadata: name: photo-upload annotations: crossplane.io/external-name: photo-upload spec: managementPolicies: ["Observe"] forProvider: region: eu-west-1 bucket: test-bucket-sns-notification topic:

Steps to Reproduce

I manually created an S3 bucket and configured the bucket notification and SNS topic in the AWS console and then applied the manifest above to import the S3 bucket and bucket notification.

What happened?

While the S3 bucket import was successful, the bucket notification import failed with the error below: Warning CannotObserveExternalResource 2m25s (x52 over 53m) managed/s3.aws.upbound.io/v1beta1, kind=bucketnotification (combined from similar events): failed to observe the resource: [{0 reading S3 Bucket Notification (photo-upload): operation error S3: GetBucketNotificationConfiguration, https response error StatusCode: 301, RequestID: 1JT115BZP0EY2RZW, HostID: 4oqvs+uhxBPLenYw0DqOnsImZbfX9dfkwLN5EVAwHuylVIQhL4C9MrpI2OkDosCB0oiOCChYHaU=, api error PermanentRedirect: The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint. []}]

I can create a new bucket notification with Crossplane, but this replaces the existing one, hence I aim to import the existing one into Crossplane and then modify it as needed. According to this page of your documentation, it should be possible.

Screenshot 2024-02-27 at 10 20 40

Relevant Error Output Snippet

Warning  CannotObserveExternalResource  2m25s (x52 over 53m)  managed/s3.aws.upbound.io/v1beta1, kind=bucketnotification  (combined from similar events): failed to observe the resource: [{0 reading S3 Bucket Notification (photo-upload): operation error S3: GetBucketNotificationConfiguration, https response error StatusCode: 301, RequestID: 1JT115BZP0EY2RZW, HostID: 4oqvs+uhxBPLenYw0DqOnsImZbfX9dfkwLN5EVAwHuylVIQhL4C9MrpI2OkDosCB0oiOCChYHaU=, api error PermanentRedirect: The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint.  []}]

Crossplane Version

1.15.0

Provider Version

1.1.0

Kubernetes Version

1.27.3

Kubernetes Distribution

EKS and Kind

Additional Info

The region of the existing S3 bucket is correct and matches that of the configuration.

mbbush commented 7 months ago

This seems to work for me, but the external name of the bucket notification resource needs to be set to the name of the s3 bucket.

github-actions[bot] commented 2 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 2 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!