Created
March 29, 2022 02:54
-
-
Save TwiN/1a6b51e202c7c1af1742c5a429219c8d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: sqs.aws.crossplane.io/v1beta1 | |
kind: Queue | |
metadata: | |
name: {{ .Release.Name }} | |
spec: | |
deletionPolicy: Delete | |
forProvider: | |
region: {{ .Values.awsRegion }} | |
delaySeconds: 1 | |
messageRetentionPeriod: 604800 | |
visibilityTimeout: 600 | |
policy: | | |
{ | |
"Version": "2012-10-17", | |
"Id": "AllowSNSTopicToSendMessagesToSQSQueue", | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Principal": "*", | |
"Action": "SQS:SendMessage", | |
"Resource": "arn:aws:sqs:{{ .Values.awsRegion }}:{{ .Values.awsAccount }}:{{ .Release.Name }}", | |
"Condition": { | |
"ArnEquals": { | |
"aws:SourceArn": "arn:aws:sns:{{ .Values.awsRegion }}:{{ .Values.awsAccount }}:{{ .Release.Name }}" | |
} | |
} | |
} | |
] | |
} | |
providerConfigRef: | |
name: crossplane-provider-config | |
providerRef: | |
name: crossplane-provider-config | |
--- | |
apiVersion: notification.aws.crossplane.io/v1alpha1 | |
kind: SNSTopic | |
metadata: | |
name: {{ .Release.Name }} | |
spec: | |
forProvider: | |
region: {{ .Values.awsRegion }} | |
name: {{ .Release.Name }} | |
displayName: {{ .Release.Name }} | |
policy: | | |
{ | |
"Version": "2008-10-17", | |
"Id": "SNSTopicPolicy", | |
"Statement": [ | |
{ | |
"Sid": "AllowEverythingFromAccount", | |
"Effect": "Allow", | |
"Principal": { | |
"AWS": "*" | |
}, | |
"Action": [ | |
"SNS:GetTopicAttributes", | |
"SNS:SetTopicAttributes", | |
"SNS:AddPermission", | |
"SNS:RemovePermission", | |
"SNS:DeleteTopic", | |
"SNS:Subscribe", | |
"SNS:ListSubscriptionsByTopic", | |
"SNS:Publish", | |
"SNS:Receive" | |
], | |
"Resource": "arn:aws:sns:{{ .Values.awsRegion }}:{{ .Values.awsAccount }}:{{ .Release.Name }}", | |
"Condition": { | |
"StringEquals": { | |
"AWS:SourceOwner": "{{ .Values.awsAccount }}" | |
} | |
} | |
} | |
] | |
} | |
providerConfigRef: | |
name: crossplane-provider-config | |
providerRef: | |
name: crossplane-provider-config | |
--- | |
apiVersion: notification.aws.crossplane.io/v1alpha1 | |
kind: SNSSubscription | |
metadata: | |
name: {{ .Release.Name }} | |
spec: | |
forProvider: | |
endpoint: 'arn:aws:sqs:{{ .Values.awsRegion }}:{{ .Values.awsAccount }}:{{ .Release.Name }}' | |
protocol: sqs | |
region: '{{ .Values.awsRegion }}' | |
topicArn: 'arn:aws:sns:{{ .Values.awsRegion }}:{{ .Values.awsAccount }}:{{ .Release.Name }}' | |
providerRef: | |
name: crossplane-provider-config | |
providerConfigRef: | |
name: crossplane-provider-config |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment