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" |
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> |
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 |
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: |
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" | |
} | |
} |
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. |
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" |
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 |
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 |
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