View apigwMultiApiSpecs.yaml
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
# Create a HttpApi with a YAML OpenAPI Spec | |
# Use Tranform Includes to dynamically import parts of the API via OpenAPI Specs | |
Type: AWS::Serverless::HttpApi or #AWS::Serverless::Api (REST APIs) | |
Properties: | |
DefinitionBody: | |
openapi: 3.0.1 | |
info: | |
title: "myAPI-splitspecs" | |
version: "2019-02-07T22:41:10Z" |
View apigwBasic.yaml
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
# Create a HttpApi with a YAML OpenAPI Spec | |
# Specify a local file path. SAM will replace it with a S3 path and upload for you | |
# Or you can specify a s3 path directly | |
Type: AWS::Serverless::HttpApi or #AWS::Serverless::Api (REST APIs) | |
Properties: | |
DefinitionUri: ./openapi.yaml or # s3://<mybucket>/<openapi-file-path> |
View pc autoscaling alarm max statistic.yaml
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
MyTargetTrackingScalingPolicy: | |
Type: AWS::ApplicationAutoScaling::ScalingPolicy | |
Properties: | |
PolicyName: utilization | |
PolicyType: TargetTrackingScaling | |
ScalingTargetId: !Ref MyScalableTarget | |
TargetTrackingScalingPolicyConfiguration: | |
TargetValue: 0.70 # Any value between 0 and 1 can be used here | |
# PredefinedMetricSpecification: | |
# PredefinedMetricType: LambdaProvisionedConcurrencyUtilization |
View layer.js
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
myFunction: | |
Type: AWS::Serverless::Function | |
Properties: | |
Handler: test.handler | |
Runtime: nodejs12.x | |
Timeout: 3 | |
Layers: | |
- Ref: MyLayer | |
MyLayer: |
View gist:80c21ca1318cfa477abdcc9bd9031f4b
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
{ | |
"isBase64Encoded": false, | |
"statusCode": 200, | |
"body": "Hello from Lambda!", | |
"headers": { | |
"Content-Type": "application/json" | |
} | |
} |
View cognitoCFnExample.yaml
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
AWSTemplateFormatVersion: "2010-09-09" | |
Parameters: | |
CognitoDomain: | |
Type: String | |
MinLength: 3 | |
MaxLength: 63 | |
AllowedPattern: ^[a-z0-9](?:[a-z0-9\-]{0,61}[a-z0-9])?$ | |
Description: Enter a string. Must be alpha numeric 3-63 in length. |
View sampleS3payload.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
{ | |
"Records": [ | |
{ | |
"eventVersion": "2.0", | |
"eventSource": "aws:s3", | |
"awsRegion": "us-east-1", | |
"eventTime": "1970-01-01T00:00:00.000Z", | |
"eventName": "ObjectCreated:Put", | |
"userIdentity": { | |
"principalId": "EXAMPLE" |
View lambdaLoad.yaml
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
config: | |
target: https://lambda.us-east-2.amazonaws.com | |
phases: | |
- duration: 60 | |
arrivalRate: 10 | |
rampTo: 50 | |
plugins: | |
aws-sigv4: | |
serviceName: lambda |
View samSecrets.js
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
Resources: | |
ApiFunction: | |
Type: AWS::Serverless::Function | |
Properties: | |
Environment: | |
Variables: | |
# this is a standard lambda env var | |
user: "This is a regular env var" | |
# this is a var loaded from SSM |
View gist:29034b42da8b1d58452c86925adc49bb
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
ApiGatewayApi: | |
Type: AWS::Serverless::Api | |
Properties: | |
StageName: Prod | |
DefinitionBody: | |
'Fn::Transform': | |
Name: 'AWS::Include' | |
# Replace <bucket> with your bucket name | |
Parameters: |
NewerOlder