File tree 1 file changed +41
-0
lines changed
1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,47 @@ This will add a nested app stack with an output parameter `LayerVersionArn`, tha
51
51
- !GetAtt AwsLambdaPowertoolsPythonLayer.Outputs.LayerVersionArn
52
52
` ` `
53
53
54
+ Here is the list of IAM permissions that you need to add to your deployment IAM role to use the layer :
55
+
56
+ ` ` ` yaml
57
+ Version: '2012-10-17'
58
+ Statement:
59
+ - Sid: CloudFormationTransform
60
+ Effect: Allow
61
+ Action: cloudformation:CreateChangeSet
62
+ Resource:
63
+ - arn:aws:cloudformation:us-east-1:aws:transform/Serverless-2016-10-31
64
+ - Sid: GetCfnTemplate
65
+ Effect: Allow
66
+ Action:
67
+ - serverlessrepo:CreateCloudFormationTemplate
68
+ - serverlessrepo:GetCloudFormationTemplate
69
+ Resource:
70
+ # this is arn of the powertools SAR app
71
+ - arn:aws:serverlessrepo:eu-west-1:057560766410:applications/aws-lambda-powertools-python-layer
72
+ - Sid: S3AccessLayer
73
+ Effect: Allow
74
+ Action:
75
+ - s3:GetObject
76
+ Resource:
77
+ # AWS publishes to an external S3 bucket locked down to your account ID
78
+ # The below example is us publishing lambda powertools
79
+ # Bucket: awsserverlessrepo-changesets-plntc6bfnfj
80
+ # Key: *****/arn:aws:serverlessrepo:eu-west-1:057560766410:applications-aws-lambda-powertools-python-layer-versions-1.6.0/aeeccf50-****-****-****-*********
81
+ - arn:aws:s3:::awsserverlessrepo-changesets-*/*
82
+ - Sid: GetLayerVersion
83
+ Effect: Allow
84
+ Action:
85
+ - lambda:PublishLayerVersion
86
+ - lambda:GetLayerVersion
87
+ Resource:
88
+ - !Sub arn:aws:lambda:${AWS::Region}:${AWS::AccoundId}:layer:aws-lambda-powertools-python-layer*
89
+ ` ` `
90
+
91
+ > Credits to [mwarkentin](https://github.com/mwarkentin) for providing the scoped down IAM permissions.
92
+
93
+ The region and the account id for `CloudFormationTransform` and `GetCfnTemplat` are fixed.
94
+
54
95
You can fetch the available versions via the API with :
55
96
56
97
` ` ` bash
You can’t perform that action at this time.
0 commit comments