Skip to content

Instantly share code, notes, and snippets.

View claydanford's full-sized avatar
🌮
sup

Clay Danford claydanford

🌮
sup
View GitHub Profile
functions:
hello:
handler: handler.hello
provisionedConcurrency: 1
concurrencyAutoscaling:
enabled: true
usage: 0.75
hello2:
handler: handler.hello2
functions:
hello:
handler: handler.hello
provisionedConcurrency: 1
concurrencyAutoscaling: true
Resources:
PCTargetHello:
Type: AWS::ApplicationAutoScaling::ScalableTarget
DependsOn: HelloProvConcLambdaAlias
Properties:
MaxCapacity: 10
MinCapacity: 1
ResourceId: function:${self:service}-${self:provider.stage}-hello:provisioned
RoleARN: arn:aws:iam::${AWS::AccountId}:role/aws-service-role/lambda.application-autoscaling.amazonaws.com/AWSServiceRoleForApplicationAutoScaling_LambdaConcurrency
ScalableDimension: lambda:function:ProvisionedConcurrency
{
"HelloProvConcLambdaAlias": {
"Type": "AWS::Lambda::Alias",
"Properties": {
"FunctionName": {
"Ref": "HelloLambdaFunction"
},
"FunctionVersion": {
"Fn::GetAtt": [
"HelloLambdaVersioneImUVX8OtBYeEeye9qtsAak4QnpW2bvILaqs9ZREfI",
functions:
hello:
handler: handler.hello
provisionedConcurrency: 1
provider:
environment:
FOO: ${ssm:/${self:service}/${self:provider.stage}/foo.bar}
SECRET: ${ssm:/${self:service}/${self:provider.stage}/baz~true}
curl -X POST 'https://abcdef0123.execute-api.us-west-2.amazonaws.com/prod/update?appId=psm-test&stage=dev' \
-H 'x-api-key: abcdef0123456789ABCDEF0123456789abcdef01' \
-d 'config/dev.json'
{
"metadata": {
"tags": {
"Application": "sls-example",
"Environment": "dev",
"Owner": "admin@foo.io"
}
},
"foo": {
"bar": "buzz"
@claydanford
claydanford / repo-structure.sh
Created December 20, 2019 20:50
Example configuration repository structure
.
├── README.md
└── config
   ├── dev.json
   ├── prod.json
   └── qa.json
@claydanford
claydanford / sls-example-1.yml
Last active December 20, 2019 20:45
Example serverless framework yaml
service: sls-example
provider:
name: aws
runtime: python3.8
stage: ${opt:stage, 'dev'}
tags:
Application: sls-example
Owner: admin@foo.io