-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(lambda): provisioned concurrency (#5308)
fixes #5298
- Loading branch information
Showing
6 changed files
with
418 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
220 changes: 220 additions & 0 deletions
220
packages/@aws-cdk/aws-lambda/test/integ.lambda.prov.concurrent.expected.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,220 @@ | ||
{ | ||
"Resources": { | ||
"MyLambdaAliasPCEServiceRoleF7C9F212": { | ||
"Type": "AWS::IAM::Role", | ||
"Properties": { | ||
"AssumeRolePolicyDocument": { | ||
"Statement": [ | ||
{ | ||
"Action": "sts:AssumeRole", | ||
"Effect": "Allow", | ||
"Principal": { | ||
"Service": "lambda.amazonaws.com" | ||
} | ||
} | ||
], | ||
"Version": "2012-10-17" | ||
}, | ||
"ManagedPolicyArns": [ | ||
{ | ||
"Fn::Join": [ | ||
"", | ||
[ | ||
"arn:", | ||
{ | ||
"Ref": "AWS::Partition" | ||
}, | ||
":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" | ||
] | ||
] | ||
} | ||
] | ||
} | ||
}, | ||
"MyLambdaAliasPCEServiceRoleDefaultPolicyE7418D56": { | ||
"Type": "AWS::IAM::Policy", | ||
"Properties": { | ||
"PolicyDocument": { | ||
"Statement": [ | ||
{ | ||
"Action": "*", | ||
"Effect": "Allow", | ||
"Resource": "*" | ||
} | ||
], | ||
"Version": "2012-10-17" | ||
}, | ||
"PolicyName": "MyLambdaAliasPCEServiceRoleDefaultPolicyE7418D56", | ||
"Roles": [ | ||
{ | ||
"Ref": "MyLambdaAliasPCEServiceRoleF7C9F212" | ||
} | ||
] | ||
} | ||
}, | ||
"MyLambdaAliasPCED0B8D751": { | ||
"Type": "AWS::Lambda::Function", | ||
"Properties": { | ||
"Code": { | ||
"ZipFile": "exports.handler = async function(event, context) { console.log(\"Hello from CDK! with Alias Provisioned Concurrent Exec!\");}" | ||
}, | ||
"Handler": "index.handler", | ||
"Role": { | ||
"Fn::GetAtt": [ | ||
"MyLambdaAliasPCEServiceRoleF7C9F212", | ||
"Arn" | ||
] | ||
}, | ||
"Runtime": "nodejs10.x" | ||
}, | ||
"DependsOn": [ | ||
"MyLambdaAliasPCEServiceRoleDefaultPolicyE7418D56", | ||
"MyLambdaAliasPCEServiceRoleF7C9F212" | ||
] | ||
}, | ||
"MyLambdaAliasPCEVersion15F479C08": { | ||
"Type": "AWS::Lambda::Version", | ||
"Properties": { | ||
"FunctionName": { | ||
"Ref": "MyLambdaAliasPCED0B8D751" | ||
} | ||
} | ||
}, | ||
"Alias325C5727": { | ||
"Type": "AWS::Lambda::Alias", | ||
"Properties": { | ||
"FunctionName": { | ||
"Ref": "MyLambdaAliasPCED0B8D751" | ||
}, | ||
"FunctionVersion": { | ||
"Fn::GetAtt": [ | ||
"MyLambdaAliasPCEVersion15F479C08", | ||
"Version" | ||
] | ||
}, | ||
"Name": "prod", | ||
"ProvisionedConcurrencyConfig": { | ||
"ProvisionedConcurrentExecutions": 5 | ||
} | ||
} | ||
}, | ||
"AliasAliasPermissionAF30F9E8": { | ||
"Type": "AWS::Lambda::Permission", | ||
"Properties": { | ||
"Action": "lambda:InvokeFunction", | ||
"FunctionName": { | ||
"Ref": "Alias325C5727" | ||
}, | ||
"Principal": "cloudformation.amazonaws.com" | ||
} | ||
}, | ||
"MyLambdaVersionPCEServiceRole2ACFB73E": { | ||
"Type": "AWS::IAM::Role", | ||
"Properties": { | ||
"AssumeRolePolicyDocument": { | ||
"Statement": [ | ||
{ | ||
"Action": "sts:AssumeRole", | ||
"Effect": "Allow", | ||
"Principal": { | ||
"Service": "lambda.amazonaws.com" | ||
} | ||
} | ||
], | ||
"Version": "2012-10-17" | ||
}, | ||
"ManagedPolicyArns": [ | ||
{ | ||
"Fn::Join": [ | ||
"", | ||
[ | ||
"arn:", | ||
{ | ||
"Ref": "AWS::Partition" | ||
}, | ||
":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" | ||
] | ||
] | ||
} | ||
] | ||
} | ||
}, | ||
"MyLambdaVersionPCEServiceRoleDefaultPolicy229A1552": { | ||
"Type": "AWS::IAM::Policy", | ||
"Properties": { | ||
"PolicyDocument": { | ||
"Statement": [ | ||
{ | ||
"Action": "*", | ||
"Effect": "Allow", | ||
"Resource": "*" | ||
} | ||
], | ||
"Version": "2012-10-17" | ||
}, | ||
"PolicyName": "MyLambdaVersionPCEServiceRoleDefaultPolicy229A1552", | ||
"Roles": [ | ||
{ | ||
"Ref": "MyLambdaVersionPCEServiceRole2ACFB73E" | ||
} | ||
] | ||
} | ||
}, | ||
"MyLambdaVersionPCEA3A0D86B": { | ||
"Type": "AWS::Lambda::Function", | ||
"Properties": { | ||
"Code": { | ||
"ZipFile": "exports.handler = async function(event, context) { console.log(\"Hello from CDK! with Version Provisioned Concurrent Exec!\");}" | ||
}, | ||
"Handler": "index.handler", | ||
"Role": { | ||
"Fn::GetAtt": [ | ||
"MyLambdaVersionPCEServiceRole2ACFB73E", | ||
"Arn" | ||
] | ||
}, | ||
"Runtime": "nodejs10.x" | ||
}, | ||
"DependsOn": [ | ||
"MyLambdaVersionPCEServiceRoleDefaultPolicy229A1552", | ||
"MyLambdaVersionPCEServiceRole2ACFB73E" | ||
] | ||
}, | ||
"MyLambdaVersionPCEVersion2C704112A": { | ||
"Type": "AWS::Lambda::Version", | ||
"Properties": { | ||
"FunctionName": { | ||
"Ref": "MyLambdaVersionPCEA3A0D86B" | ||
}, | ||
"ProvisionedConcurrencyConfig": { | ||
"ProvisionedConcurrentExecutions": 5 | ||
} | ||
} | ||
}, | ||
"Alias29455D932": { | ||
"Type": "AWS::Lambda::Alias", | ||
"Properties": { | ||
"FunctionName": { | ||
"Ref": "MyLambdaVersionPCEA3A0D86B" | ||
}, | ||
"FunctionVersion": { | ||
"Fn::GetAtt": [ | ||
"MyLambdaVersionPCEVersion2C704112A", | ||
"Version" | ||
] | ||
}, | ||
"Name": "prod" | ||
} | ||
}, | ||
"Alias2AliasPermission2448514B6": { | ||
"Type": "AWS::Lambda::Permission", | ||
"Properties": { | ||
"Action": "lambda:InvokeFunction", | ||
"FunctionName": { | ||
"Ref": "Alias29455D932" | ||
}, | ||
"Principal": "cloudformation.amazonaws.com" | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.