MatejNedic 8a605b665d Verify SNS messages in HTTP subscription mode (#240) | пре 2 година | |
---|---|---|
.. | ||
bin | пре 2 година | |
lib | пре 2 година | |
.gitignore | пре 3 година | |
.npmignore | пре 3 година | |
README.md | пре 3 година | |
cdk.json | пре 3 година | |
jest.config.js | пре 3 година | |
package.json | пре 2 година | |
tsconfig.json | пре 3 година |
This sample shows sending SNS messages receiving them with SQSListener and NotificationMapping. To use NotificationMapping you will need to use NGROK: https://ngrok.com/docs Firstly you will need to start 'ngrok http 127.0.0.1:{YourPort}' after that you will need to change URL inside CDK. After you change URL inside CDK, you can run CDK deploy. Subscription will be automatically sent to NGROK url + topicTest. There is possibility subscription isn't confirmed since application is not started as of CDK deploy, so you should resend subscription from an AWS console. When you open AWS Management console from your favourite browser you search for SNS and after that on left side select subscriptions and request confirmation for NGROK url + /topicTest.
Infrastructure code to run Spring Cloud AWS SNS Sample App based on AWS CDK
npm install
cdk synth
cdk deploy
Once you don't need the infrastructure anymore, it can be destroyed by calling:
cdk destroy
.You will need following policies to run cdk and Sample app:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"sqs:DeleteMessage",
"sqs:GetQueueUrl",
"sqs:ReceiveMessage",
"sqs:SendMessage",
"sqs:GetQueueAttributes",
"sqs:SetQueueAttributes"
"sqs:DeleteQueue",
"sqs:CreateQueue",
"sns:ListTopics",
"sns:GetTopicAttributes",
"sns:DeleteTopic",
"sns:CreateTopic",
"sns:Publish",
"sns:ConfirmSubscription",
"cloudformation:CreateChangeSet",
"cloudformation:DescribeStacks",
"cloudformation:DescribeStackEvents",
"cloudformation:GetTemplate",
"cloudformation:DeleteStack",
"cloudformation:DescribeChangeSet",
"cloudformation:ExecuteChangeSet",
],
"Resource": "arn"
}
]