Skip to content

Instantly share code, notes, and snippets.

@me2resh
Created December 4, 2019 23:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save me2resh/b89a03cbdf0721394f68784a0926b15e to your computer and use it in GitHub Desktop.
Save me2resh/b89a03cbdf0721394f68784a0926b15e to your computer and use it in GitHub Desktop.
How to use lambda provisioned concurrency in aws sam
Parameters:
FnName:
Type: String
ProvisionedConcurrency:
Type: String
Default: 10
EnableAliasProvisionedConcurrency:
Type: String
AllowedValues:
- true
- false
Default: true
Conditions:
AliasProvisionedConcurrencyEnabled: !Equals [!Ref EnableAliasProvisionedConcurrency, true]
Resources:
MinimalFunction:
Type: 'AWS::Serverless::Function'
Properties:
CodeUri: s3://sam-demo-bucket/hello.zip
Handler: hello.handler
Runtime: python2.7
DeploymentPreference:
Type: Linear10PercentEvery3Minutes
ProvisionedConcurrencyConfig: !If
- AliasProvisionedConcurrencyEnabled
- ProvisionedConcurrentExecutions: !Ref ProvisionedConcurrency
- !Ref 'AWS::NoValue'
@isbkch
Copy link

isbkch commented Dec 19, 2022

Beauty. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment