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"
}
]