-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathtemplate-sar.yaml
52 lines (52 loc) · 1.66 KB
/
template-sar.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
AWSTemplateFormatVersion: '2010-09-09'
Parameters:
QueueName:
Type: String
Description: Queue name which the lambda will access
QueueUrl:
Type: String
Description: Queue url which the lambda will access
Transform: AWS::Serverless-2016-10-31
Description: Spring Cloud Functions.
Resources:
AwsLambdaSqsLocal:
Type: AWS::Serverless::Function
Properties:
FunctionName: aws-lambda-sqs
Handler: com.mj.aws.lambda.sqs.AwsLambdaSqsFunctionHandler
Description: For AWS Sqs Queue
Runtime: java8
CodeUri: s3://my-sar-artifact/aws-lambda-sqs/aws-lambda-sqs-0.0.4-SNAPSHOT-aws.jar
MemorySize: 320
Timeout: 240
Policies:
- AWSLambdaExecute
- Version: '2012-10-17'
Statement:
- Effect: Allow
Action:
- sqs:ChangeMessageVisibility
- sqs:ChangeMessageVisibilityBatch
- sqs:DeleteMessage
- sqs:DeleteMessageBatch
- sqs:GetQueueAttributes
- sqs:ReceiveMessage
Resource:
- Fn::Sub:
- arn:aws:sqs:${AWS::Region}:${AWS::AccountId}:${queueName}
- queueName:
Ref: QueueName
- Version: '2012-10-17'
Statement:
- Effect: Allow
Action:
- sqs:ListQueues
- sqs:GetQueueAttributes
- sqs:GetQueueUrl
Resource:
- !Sub arn:aws:sqs:${AWS::Region}:${AWS::AccountId}:*
Environment:
Variables:
SPRING_PROFILES_ACTIVE: aws
QUEUE_URL:
Ref: QueueUrl