From df2d01b20541b70acf64a42076cbb63096d60c33 Mon Sep 17 00:00:00 2001 From: Matt Bush Date: Mon, 18 Mar 2024 11:14:08 -0700 Subject: [PATCH] Merge both bucket notification examples Signed-off-by: Matt Bush --- .../s3/v1beta1/bucketnotification-sqs.yaml | 84 ------------------- examples/s3/v1beta1/bucketnotification.yaml | 56 ++++++++++++- 2 files changed, 54 insertions(+), 86 deletions(-) delete mode 100644 examples/s3/v1beta1/bucketnotification-sqs.yaml diff --git a/examples/s3/v1beta1/bucketnotification-sqs.yaml b/examples/s3/v1beta1/bucketnotification-sqs.yaml deleted file mode 100644 index 3416a6501a..0000000000 --- a/examples/s3/v1beta1/bucketnotification-sqs.yaml +++ /dev/null @@ -1,84 +0,0 @@ -# SPDX-FileCopyrightText: 2024 The Crossplane Authors -# -# SPDX-License-Identifier: CC0-1.0 - -apiVersion: s3.aws.upbound.io/v1beta1 -kind: BucketNotification -metadata: - name: example - annotations: - meta.upbound.io/example-id: s3/v1beta1/bucketnotification - labels: - testing.upbound.io/example-name: bucket-notification -spec: - forProvider: - region: us-west-1 - bucketSelector: - matchLabels: - testing.upbound.io/example-name: bucket-notification - queue: - - events: - - "s3:ObjectCreated:*" - filterSuffix: ".log" - queueArnSelector: - matchLabels: - testing.upbound.io/example-name: bucket-notification - ---- -apiVersion: s3.aws.upbound.io/v1beta1 -kind: Bucket -metadata: - name: bucket-notification - annotations: - meta.upbound.io/example-id: s3/v1beta1/bucketnotification - crossplane.io/external-name: ${Rand.RFC1123Subdomain} - labels: - testing.upbound.io/example-name: bucket-notification -spec: - forProvider: - region: us-west-1 - ---- -apiVersion: sqs.aws.upbound.io/v1beta1 -kind: Queue -metadata: - name: bucket-notification - annotations: - meta.upbound.io/example-id: s3/v1beta1/bucketnotification - labels: - testing.upbound.io/example-name: bucket-notification -spec: - forProvider: - region: us-west-1 - name: bucket-notification - ---- -apiVersion: sqs.aws.upbound.io/v1beta1 -kind: QueuePolicy -metadata: - name: bucket-notification - annotations: - meta.upbound.io/example-id: s3/v1beta1/bucketnotification - labels: - testing.upbound.io/example-name: bucket-notification -spec: - forProvider: - region: us-west-1 - queueUrlSelector: - matchLabels: - testing.upbound.io/example-name: bucket-notification - policy: | - { - "Version": "2012-10-17", - "Statement": [ - { - "Sid": "example", - "Effect": "Allow", - "Principal": { - "Service": "s3.amazonaws.com" - }, - "Action": "sqs:SendMessage", - "Resource": "arn:aws:sqs:us-west-1:*:bucket-notification" - } - ] - } diff --git a/examples/s3/v1beta1/bucketnotification.yaml b/examples/s3/v1beta1/bucketnotification.yaml index fa70e3c6c5..eb4075fd70 100644 --- a/examples/s3/v1beta1/bucketnotification.yaml +++ b/examples/s3/v1beta1/bucketnotification.yaml @@ -12,13 +12,20 @@ metadata: testing.upbound.io/example-name: bucket-notification spec: forProvider: - region: us-west-1 bucketSelector: matchLabels: testing.upbound.io/example-name: bucket-notification + queue: + - events: + - "s3:ObjectCreated:*" + filterSuffix: ".log" + queueArnSelector: + matchLabels: + testing.upbound.io/example-name: bucket-notification + region: us-west-1 topic: - events: - - "s3:ObjectCreated:*" + - "s3:ObjectRemoved:*" filterSuffix: ".log" topicArnSelector: matchLabels: @@ -80,3 +87,48 @@ spec: } ] } + +--- +apiVersion: sqs.aws.upbound.io/v1beta1 +kind: Queue +metadata: + name: bucket-notification + annotations: + meta.upbound.io/example-id: s3/v1beta1/bucketnotification + labels: + testing.upbound.io/example-name: bucket-notification +spec: + forProvider: + region: us-west-1 + name: bucket-notification + +--- +apiVersion: sqs.aws.upbound.io/v1beta1 +kind: QueuePolicy +metadata: + name: bucket-notification + annotations: + meta.upbound.io/example-id: s3/v1beta1/bucketnotification + labels: + testing.upbound.io/example-name: bucket-notification +spec: + forProvider: + region: us-west-1 + queueUrlSelector: + matchLabels: + testing.upbound.io/example-name: bucket-notification + policy: | + { + "Version": "2012-10-17", + "Statement": [ + { + "Sid": "example", + "Effect": "Allow", + "Principal": { + "Service": "s3.amazonaws.com" + }, + "Action": "sqs:SendMessage", + "Resource": "arn:aws:sqs:us-west-1:*:bucket-notification" + } + ] + }