CodeUri
Specifies the Amazon S3 location of a Web Function's deployment package. You can specify the
location as an object, or as a string of the form
s3:// with an optional
bucket/key?versionId= query parameter.version
The bucket must have versioning enabled and a bucket policy that grants
lambda.amazonaws.com the s3:GetObject and
s3:GetObjectVersion permissions. We recommend that you scope the policy with an
aws:SourceArn condition that matches the function's revisions. If the object is
encrypted with SSE-KMS, use a customer managed key whose key policy allows
lambda.amazonaws.com to call kms:Decrypt. The AWS managed key for Amazon S3
(aws/s3) isn't supported. For
details, see Deploying
Web Function code from Amazon S3 in the AWS Lambda Developer Guide.
Syntax
To declare this entity in your AWS Serverless Application Model (AWS SAM) template, use the following syntax.
Properties
-
Bucket -
The name of the Amazon S3 bucket that contains the deployment package.
Type: String
Required: Yes
CloudFormation compatibility: This property is passed directly to the
Bucketproperty ofBuildConfig.CodeConfig.S3Objectof anAWS::Lambda::WebFunctionRevisionresource. -
Key -
The Amazon S3 key of the deployment package.
Type: String
Required: Yes
CloudFormation compatibility: This property is passed directly to the
Keyproperty ofBuildConfig.CodeConfig.S3Objectof anAWS::Lambda::WebFunctionRevisionresource. -
Version -
The version ID of the deployment package object. Specify a version to pin the revision to a specific upload.
Type: String
Required: No
CloudFormation compatibility: This property is similar to the
VersionIdproperty ofBuildConfig.CodeConfig.S3Objectof anAWS::Lambda::WebFunctionRevisionresource. AWS SAM passes the value asVersionId.
Examples
Object form
CodeUri: Bucket: amzn-s3-demo-bucket Key: webfn.zip Version:object-version-id
URI form
CodeUri: s3://amzn-s3-demo-bucket/webfn.zip?versionId=object-version-id