SAM v1.22.0 Release
Community Contributors to this Release
@cakepietoast, @dalumiller, @jmnarloch, @nmoutschen, @tyldavis
Tags for Http APIs
SAM supports adding tags to AWS::Serverless::HttpApi
. When a stack is created, SAM will automatically add httpapi:createdBy: SAM
tag. SAM also propagates tags from AWS::Serverless::HttpApi
to AWS::ApiGatewayV2::DomainName
and AWS::ApiGatewayV2::Stage
resources. For more information on how to define tags, see the AWS CloudFormation Documentation. (#1459) (#1492)
Api:
Type: AWS::Serverless::HttpApi
Properties:
Tags:
Tag1: value1
Tag2: value2
PayloadFormatVersion and TimeoutInMillis for Http API events
SAM supports PayloadFormatVersion
and TimeoutInMillis
for Http API events. SAM defaults to "2.0" for PayloadFormatVersion
if the version is not specified. The default value of TimeoutInMillis
is 5000 milli seconds for Http APIs. For more information on these properties see AWS CloudFormation documentation. (#1450) #1517
HttpApiFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: ./
Handler: index.handler
Runtime: nodejs12.x
Events:
Basic:
Type: HttpApi
Properties:
Path: /basic
Method: post
TimeoutInMillis: 10000
PayloadFormatVersion: "2.0"
FailOnWarnings for Serverless Http APIs
SAM supports FailOnWarnings
for AWS::Serverless::HttpApi
resource. Specifies whether to rollback the API creation (true) or not (false) when a warning is encountered. For more information on FailOnWarnings
see AWS CloudFormation Documentation (#1509)
MyApi:
Type: AWS::Serverless::HttpApi
Properties:
FailOnWarnings: True
CORS for Http APIs
SAM supports enabling CORS for Http APIs. SAM adds x-amazon-apigateway-cors
header in open api definition for your Http API when CorsConfiguration
property is defined. Specify true
for adding Cors with domain '*' to your Http APIs or specify a dictionary with additional CorsConfiguration
object. For more information see AWS CloudFormation documentation. (#1381)
MyApi:
Type: AWS::Serverless::HttpApi
Properties:
CorsConfiguration:
AllowOrigins:
- "https://example.com"
AllowHeaders:
- x-apigateway-header
AllowMethods:
- GET
Custom Domains in HTTP API
This release adds support for configuring custom domains on AWS::Serverless::HttpApi
. For more information about this feature see AWS CloudFormation documentation. (#1472)
MyApi:
Type: AWS::Serverless::HttpApi
Properties:
Domain:
DomainName: !Ref DomainName
CertificateArn: !Ref ACMCertificateArn
BasePath:
- /fetch
Route53:
HostedZoneId: ZQ1UAL4EFZVME
IpV6: true
RouteSettings and DefaultRouteSettings for Http APIs
SAM supports DefaulRouteSettings
and RouteSettings
for Http API. For more information see AWS CloudFormation documentation. (#1461) (#1490)
RouteSettings example snippet:
Resources:
HttpApiFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: s3://sam-demo-bucket/todo_list.zip
Handler: index.restapi
Runtime: nodejs12.x
Events:
SimpleCase:
Type: HttpApi
Properties:
ApiId: !Ref MyApi
RouteSettings:
ThrottlingBurstLimit: 300
LoggingLevel: INFO
MyApi:
Type: AWS::Serverless::HttpApi
Properties:
StageName: Prod
RouteSettings:
"$default":
ThrottlingBurstLimit: 200
ThrottlingRateLimit: 0.7
DefaultRouteSettings example snippet:
MyApi:
Type: AWS::Serverless::HttpApi
Properties:
DefinitionUri: s3://bucket/key
StageName: !Join ["", ["Stage", "Name"]]
DefaultRouteSettings:
ThrottlingBurstLimit: 50
Change Log:
- Add periods to error messages, fix quotes (#1430)
- Add EventBridgePutEventsPolicy (#1409)
- Use isinstance check instead of type (#1411)
- Add TimeoutInMillis to HttpApi events (#1450)
- Document support for HTTP API Access Log Settings (#1448)
- Fix markdown style links in not-markdown (#1439)
- Add Tags support to Http Api (#1459)
- Switch Definition to Model (#1423)
- Make usageplan properties referable (#1458)
- Add support for DefaultRouteSettings in HttpApi (#1461)
- Trigger auto publish alias on env var/memorysize change (#1310)
- Support cors for HttpApi (#1381)
- chore: bump translator version (#1483)
- Add referable properties of sam resources (#1468)
- Add support for Custom domains in HTTP API (#1472)
- Remove OIDC auth from Http Api (#1491)
- Propagate tags to DomainName, Stage resources (#1492)
- Add StageVariables to docs (#1493)
- Support RouteSettings for HttpApi (#1490)
- Add DynamoDBWritePolicy and S3WritePolicy (#1374)
- Fix type of user pool tags (#1460)
- Add support for PayloadFormatVersion for HttpAPI events (#1517)
- Add support for FailOnWarnings for HttpApi (#1509)
- Add support for PathParameters for HttpApi (#1510)