Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update examples for s3 bucket notifications and sqs queue policies #1225

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
121 changes: 116 additions & 5 deletions examples/s3/v1beta1/bucketnotification.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,128 @@ kind: BucketNotification
metadata:
name: example
annotations:
upjet.upbound.io/manual-intervention: "Requires a TopicPolicy for the referenced Topic and TopicPolicy is not covered yet."
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: s3
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:
testing.upbound.io/example-name: s3
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: sns.aws.upbound.io/v1beta1
kind: Topic
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

---
apiVersion: sns.aws.upbound.io/v1beta1
kind: TopicPolicy
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
arnSelector:
matchLabels:
testing.upbound.io/example-name: bucket-notification
policy: |
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "example",
"Effect": "Allow",
"Principal": {
"Service": "s3.amazonaws.com"
},
"Action": "sns:Publish",
"Resource": "arn:aws:sns:us-west-1:*:bucket-notification"
}
]
}

---
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"
}
]
}
42 changes: 21 additions & 21 deletions examples/sqs/v1beta1/queuepolicy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,43 +5,43 @@
apiVersion: sqs.aws.upbound.io/v1beta1
kind: QueuePolicy
metadata:
labels:
testing.upbound.io/example-name: test
name: test
name: queue-policy
annotations:
upjet.upbound.io/manual-intervention: "This resource requires manual intervention for adding resource and source ARNs."
meta.upbound.io/example-id: sqs/v1beta1/queue-policy
labels:
testing.upbound.io/example-name: queue-policy
spec:
forProvider:
region: us-west-1
queueUrlSelector:
matchLabels:
testing.upbound.io/example-name: queue-policy
policy: |
{
"Version": "2012-10-17",
"Id": "sqspolicy",
"Statement": [
{
"Sid": "First",
"Sid": "example",
"Effect": "Allow",
"Principal": "*",
"Principal": {
"Service": "s3.amazonaws.com"
},
"Action": "sqs:SendMessage",
"Resource": "${resource_arn}",
"Condition": {
"ArnEquals": {
"aws:SourceArn": "${source_arn}}"
}
}
"Resource": "arn:aws:sqs:us-west-1:*:queue-policy"
}
]
}
queueUrlSelector:
matchLabels:
testing.upbound.io/example-name: example
region: us-west-1

---

apiVersion: sns.aws.upbound.io/v1beta1
kind: Topic
apiVersion: sqs.aws.upbound.io/v1beta1
kind: Queue
metadata:
name: user-updates-topic
name: queue-policy
annotations:
meta.upbound.io/example-id: sqs/v1beta1/queuepolicy
labels:
testing.upbound.io/example-name: queue-policy
spec:
forProvider:
region: us-west-1
name: queue-policy
Loading