Skip to content
This repository was archived by the owner on Dec 2, 2020. It is now read-only.

Commit f9950a1

Browse files
committed
Add required permissions to README
1 parent c09f523 commit f9950a1

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

README.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ If a layer is already published to Lambda (same layer name, SHA256 digest, and s
1616
- [Install](#install)
1717
+ [Binaries](#binaries)
1818
+ [From Source](#from-source)
19+
- [Permissions](#permissions)
1920
- [Example](#example)
2021
- [License Summary](#license-summary)
2122

@@ -52,6 +53,59 @@ $ make
5253
$ ./bin/local/img2lambda --help
5354
```
5455

56+
## Permissions
57+
58+
No credentials are required for dry-runs of the img2lambda tool. When publishing layers to Lambda, img2lambda will look for credentials in the following order (using the default provider chain in the AWS SDK for Go).
59+
60+
1. Environment variables.
61+
1. Shared credentials file.
62+
1. If running on Amazon ECS (with task role) or AWS CodeBuild, IAM role from the container credentials endpoint.
63+
1. If running on an Amazon EC2 instance, IAM role for Amazon EC2.
64+
65+
The credentials must have the following permissions:
66+
```
67+
{
68+
"Version": "2012-10-17",
69+
"Statement": [
70+
{
71+
"Sid": "MinimalPermissions",
72+
"Effect": "Allow",
73+
"Action": [
74+
"lambda:GetLayerVersion",
75+
"lambda:ListLayerVersions",
76+
"lambda:PublishLayerVersion"
77+
],
78+
"Resource": [
79+
"arn:aws:lambda:<REGION>:<ACCOUNT ID>:layer:<LAYER NAMESPACE>-sha256-*",
80+
"arn:aws:lambda:<REGION>:<ACCOUNT ID>:layer:<LAYER NAMESPACE>-sha256-*:*"
81+
]
82+
}
83+
]
84+
}
85+
```
86+
87+
For example:
88+
```
89+
{
90+
"Version": "2012-10-17",
91+
"Statement": [
92+
{
93+
"Sid": "MinimalPermissions",
94+
"Effect": "Allow",
95+
"Action": [
96+
"lambda:GetLayerVersion",
97+
"lambda:ListLayerVersions",
98+
"lambda:PublishLayerVersion"
99+
],
100+
"Resource": [
101+
"arn:aws:lambda:us-east-1:123456789012:layer:img2lambda-sha256-*",
102+
"arn:aws:lambda:us-east-1:123456789012:layer:img2lambda-sha256-*:*"
103+
]
104+
}
105+
]
106+
}
107+
```
108+
55109
## Example
56110

57111
Build the example Docker image to create a PHP Lambda custom runtime:

0 commit comments

Comments
 (0)