Skip to content

Commit 38e9014

Browse files
authored
Merge pull request #415 from oliverjfletcher/docs/update-images-examples
docs: Updating Images docs to make examples consistent
2 parents 6beea40 + 67cf192 commit 38e9014

File tree

1 file changed

+19
-15
lines changed

1 file changed

+19
-15
lines changed

doc_source/gettingstarted-images.md

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,18 @@ You cannot convert an existing container image function to use a \.zip file arch
1010
When you select an image using an image tag, Lambda translates the tag to the underlying image digest\. To retrieve the digest for your image, use the [GetFunctionConfiguration](API_GetFunctionConfiguration.md) API operation\. To update the function to a newer image version, you must use the Lambda console to [update the function code](#configuration-images-update), or use the [UpdateFunctionCode](API_UpdateFunctionCode.md) API operation\. Configuration operations such as [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) do not update the function's container image\.
1111

1212
**Topics**
13-
+ [Prerequisites](#gettingstarted-images-prereq)
14-
+ [Permissions](#gettingstarted-images-permissions)
15-
+ [Creating the function](#configuration-images-create)
16-
+ [Testing the function](#get-started-invoke-function)
17-
+ [Overriding container settings](#configuration-images-settings)
18-
+ [Updating function code](#configuration-images-update)
19-
+ [Using the Lambda API](#configuration-images-api)
20-
+ [AWS CloudFormation](#configuration-images-cloudformation)
13+
- [Deploying Lambda functions as container images](#deploying-lambda-functions-as-container-images)
14+
- [Prerequisites](#prerequisites)
15+
- [Permissions](#permissions)
16+
- [Amazon ECR permissions](#amazon-ecr-permissions)
17+
- [Amazon ECR cross-account permissions](#amazon-ecr-cross-account-permissions)
18+
- [Creating the function](#creating-the-function)
19+
- [Testing the function](#testing-the-function)
20+
- [Overriding container settings](#overriding-container-settings)
21+
- [Updating function code](#updating-function-code)
22+
- [Function version $LATEST](#function-version-latest)
23+
- [Using the Lambda API](#using-the-lambda-api)
24+
- [AWS CloudFormation](#aws-cloudformation)
2125

2226
## Prerequisites<a name="gettingstarted-images-prereq"></a>
2327

@@ -56,7 +60,7 @@ For example, use the IAM console to create a role with the following policy:
5660
"Sid": "VisualEditor0",
5761
"Effect": "Allow",
5862
"Action": ["ecr:SetRepositoryPolicy","ecr:GetRepositoryPolicy"],
59-
"Resource": "arn:aws:ecr:<region>:<account>:repository/<repo name>/"
63+
"Resource": "arn:aws:ecr:<region>:<account>:repository/<repo-name>/"
6064
}
6165
]
6266
}
@@ -105,7 +109,7 @@ A different account in the same region can create a function that uses a contain
105109
"ecr:GetDownloadUrlForLayer"
106110
],
107111
"Principal": {
108-
"AWS": "arn:aws:iam::123456789012:root"
112+
"AWS": "arn:aws:iam::<account>:root"
109113
}
110114
},
111115
{
@@ -121,15 +125,15 @@ A different account in the same region can create a function that uses a contain
121125
"Condition": {
122126
"StringLike": {
123127
"aws:sourceARN":
124-
"arn:aws:lambda:us-east-1:123456789012:function:*"
128+
"arn:aws:lambda:<region>:<account>:function:*"
125129
}
126130
}
127131
}
128132
]
129133
}
130134
```
131135

132-
To give access to multiple accounts, you add the account IDs to the Principal list in the `CrossAccountPermission` policy and to the Condition evaluation list in the `LambdaECRImageCrossAccountRetrievalPolicy`\.
136+
To give access to multiple accounts, you add the account IDs to the Principal list in the `CrossAccountPermission` policy and to the Condition evaluation list in the `LambdaECRImageCrossAccountRetrievalPolicy`\.
133137

134138
If you are working with multiple accounts in an AWS Organization, we recommend that you enumerate each account ID in the ECR permissions policy\. This approach aligns with the AWS security best practice of setting narrow permissions in IAM policies\.
135139

@@ -282,10 +286,10 @@ When you create the function, you can specify the instruction set architecture\.
282286
You can create the function from the same account as the container registry or from a different account in the same region as the container registry in Amazon ECR\. For cross\-account access, adjust the [Amazon ECR permissions](#configuration-images-xaccount-permissions) for the image\.
283287
284288
```
285-
aws lambda create-function --region sa-east-1 --function-name my-function \
289+
aws lambda create-function --region <region> --function-name my-function \
286290
--package-type Image \
287291
--code ImageUri=<ECR Image URI> \
288-
--role arn:aws:iam::123456789012:role/lambda-ex
292+
--role arn:aws:iam::<account>:role/lambda-ex
289293
```
290294
291295
To update the function code, use the `update-function-code` command\. Specify the container image location using the `image-uri` parameter\.
@@ -294,7 +298,7 @@ To update the function code, use the `update-function-code` command\. Specify th
294298
You cannot change the `package-type` of a function\.
295299
296300
```
297-
aws lambda update-function-code --region sa-east-1 --function-name my-function \
301+
aws lambda update-function-code --region <region> --function-name my-function \
298302
--image-uri <ECR Image URI> \
299303
```
300304

0 commit comments

Comments
 (0)