-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Bump SamTranslator version to 1.63.0 (#4933)
- Loading branch information
1 parent
b89b8e1
commit 5f818d4
Showing
15 changed files
with
458 additions
and
4 deletions.
There are no files selected for viewing
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
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
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
87 changes: 87 additions & 0 deletions
87
tests/functional/commands/validate/lib/models/api_with_cors_and_apikey.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
AWSTemplateFormatVersion: '2010-09-09' | ||
|
||
Transform: | ||
- AWS::Serverless-2016-10-31 | ||
|
||
Globals: | ||
Api: | ||
Auth: | ||
ApiKeyRequired: true | ||
AddApiKeyRequiredToCorsPreflight: false | ||
|
||
Resources: | ||
|
||
MyFunction: | ||
Type: AWS::Serverless::Function | ||
Properties: | ||
Handler: index.handler | ||
InlineCode: | | ||
exports.handler = async function (event) { | ||
return { | ||
statusCode: 200, | ||
body: JSON.stringify({ message: "Hello, SAM!" }), | ||
} | ||
} | ||
Runtime: nodejs16.x | ||
|
||
ApiGatewayLambdaRole: | ||
Type: AWS::IAM::Role | ||
Properties: | ||
AssumeRolePolicyDocument: | ||
Version: '2012-10-17' | ||
Statement: | ||
- Effect: Allow | ||
Principal: {Service: apigateway.amazonaws.com} | ||
Action: sts:AssumeRole | ||
Policies: | ||
- PolicyName: AllowInvokeLambdaFunctions | ||
PolicyDocument: | ||
Version: '2012-10-17' | ||
Statement: | ||
- Effect: Allow | ||
Action: lambda:InvokeFunction | ||
Resource: '*' | ||
|
||
MyApi: | ||
Type: AWS::Serverless::Api | ||
Properties: | ||
Cors: | ||
AllowMethods: "'methods'" | ||
AllowHeaders: "'headers'" | ||
AllowOrigin: "'origins'" | ||
MaxAge: "'600'" | ||
Auth: | ||
ApiKeyRequired: true | ||
StageName: dev | ||
DefinitionBody: | ||
openapi: 3.0.1 | ||
paths: | ||
/apione: | ||
get: | ||
x-amazon-apigateway-integration: | ||
credentials: | ||
Fn::Sub: ${ApiGatewayLambdaRole.Arn} | ||
uri: | ||
Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${MyFunction.Arn}/invocations | ||
passthroughBehavior: when_no_match | ||
httpMethod: POST | ||
type: aws_proxy | ||
/apitwo: | ||
get: | ||
x-amazon-apigateway-integration: | ||
credentials: | ||
Fn::Sub: ${ApiGatewayLambdaRole.Arn} | ||
uri: | ||
Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${MyFunction.Arn}/invocations | ||
passthroughBehavior: when_no_match | ||
httpMethod: POST | ||
type: aws_proxy | ||
|
||
|
||
|
||
Outputs: | ||
ApiUrl: | ||
Description: URL of your API endpoint | ||
Value: !Sub "https://${MyApi}.execute-api.${AWS::Region}.amazonaws.com/dev/" | ||
Metadata: | ||
SamTransformTest: true |
66 changes: 66 additions & 0 deletions
66
...unctional/commands/validate/lib/models/api_with_cors_and_apikey_defined_at_api_level.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
AWSTemplateFormatVersion: '2010-09-09' | ||
|
||
Transform: | ||
- AWS::Serverless-2016-10-31 | ||
|
||
Resources: | ||
|
||
MyFunction: | ||
Type: AWS::Serverless::Function | ||
Properties: | ||
Handler: index.handler | ||
InlineCode: | | ||
exports.handler = async function (event) { | ||
return { | ||
statusCode: 200, | ||
body: JSON.stringify({ message: "Hello, SAM!" }), | ||
} | ||
} | ||
Runtime: nodejs16.x | ||
|
||
ApiGatewayLambdaRole: | ||
Type: AWS::IAM::Role | ||
Properties: | ||
AssumeRolePolicyDocument: | ||
Version: '2012-10-17' | ||
Statement: | ||
- Effect: Allow | ||
Principal: {Service: apigateway.amazonaws.com} | ||
Action: sts:AssumeRole | ||
Policies: | ||
- PolicyName: AllowInvokeLambdaFunctions | ||
PolicyDocument: | ||
Version: '2012-10-17' | ||
Statement: | ||
- Effect: Allow | ||
Action: lambda:InvokeFunction | ||
Resource: '*' | ||
|
||
MyApi: | ||
Type: AWS::Serverless::Api | ||
Properties: | ||
Cors: "'*'" | ||
Auth: | ||
ApiKeyRequired: true | ||
AddApiKeyRequiredToCorsPreflight: false | ||
StageName: dev | ||
DefinitionBody: | ||
openapi: 3.0.1 | ||
paths: | ||
/hello: | ||
get: | ||
x-amazon-apigateway-integration: | ||
credentials: | ||
Fn::Sub: ${ApiGatewayLambdaRole.Arn} | ||
uri: | ||
Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${MyFunction.Arn}/invocations | ||
passthroughBehavior: when_no_match | ||
httpMethod: POST | ||
type: aws_proxy | ||
|
||
|
||
|
||
Outputs: | ||
WebEndpoint: | ||
Description: API Gateway endpoint URL | ||
Value: !Sub "https://${MyApi}.execute-api.${AWS::Region}.amazonaws.com/dev/hello" |
57 changes: 57 additions & 0 deletions
57
...tional/commands/validate/lib/models/api_with_custom_domains_regional_latency_routing.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
Parameters: | ||
MyRestRegionalDomainName: | ||
Type: String | ||
MyRestRegionalDomainCert: | ||
Type: String | ||
HostedZoneId: | ||
Type: String | ||
|
||
Globals: | ||
Api: | ||
Domain: | ||
DomainName: | ||
Ref: MyRestRegionalDomainName | ||
CertificateArn: | ||
Ref: MyRestRegionalDomainCert | ||
EndpointConfiguration: REGIONAL | ||
MutualTlsAuthentication: | ||
TruststoreUri: ${mtlsuri} | ||
TruststoreVersion: 0 | ||
SecurityPolicy: TLS_1_2 | ||
BasePath: | ||
- /get | ||
- /post | ||
Route53: | ||
HostedZoneId: | ||
Ref: HostedZoneId | ||
Region: eu-west-2 | ||
SetIdentifier: eu-west-2 | ||
DistributionDomainName: test.domain.com | ||
|
||
Resources: | ||
MyFunction: | ||
Type: AWS::Serverless::Function | ||
Properties: | ||
InlineCode: | | ||
exports.handler = async (event) => { | ||
const response = { | ||
statusCode: 200, | ||
body: JSON.stringify('Hello from Lambda!'), | ||
}; | ||
return response; | ||
}; | ||
Handler: index.handler | ||
Runtime: nodejs14.x | ||
Events: | ||
ImplicitGet: | ||
Type: Api | ||
Properties: | ||
Method: Get | ||
Path: /get | ||
ImplicitPost: | ||
Type: Api | ||
Properties: | ||
Method: Post | ||
Path: /post | ||
Metadata: | ||
SamTransformTest: true |
58 changes: 58 additions & 0 deletions
58
...l/commands/validate/lib/models/api_with_custom_domains_regional_latency_routing_ipv6.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
Parameters: | ||
MyRestRegionalDomainName: | ||
Type: String | ||
MyRestRegionalDomainCert: | ||
Type: String | ||
HostedZoneId: | ||
Type: String | ||
|
||
Globals: | ||
Api: | ||
Domain: | ||
DomainName: | ||
Ref: MyRestRegionalDomainName | ||
CertificateArn: | ||
Ref: MyRestRegionalDomainCert | ||
EndpointConfiguration: REGIONAL | ||
MutualTlsAuthentication: | ||
TruststoreUri: ${mtlsuri} | ||
TruststoreVersion: 0 | ||
SecurityPolicy: TLS_1_2 | ||
BasePath: | ||
- /get | ||
- /post | ||
Route53: | ||
HostedZoneId: | ||
Ref: HostedZoneId | ||
Region: eu-west-2 | ||
SetIdentifier: eu-west-2 | ||
DistributionDomainName: test.domain.com | ||
IpV6: true | ||
|
||
Resources: | ||
MyFunction: | ||
Type: AWS::Serverless::Function | ||
Properties: | ||
InlineCode: | | ||
exports.handler = async (event) => { | ||
const response = { | ||
statusCode: 200, | ||
body: JSON.stringify('Hello from Lambda!'), | ||
}; | ||
return response; | ||
}; | ||
Handler: index.handler | ||
Runtime: nodejs14.x | ||
Events: | ||
ImplicitGet: | ||
Type: Api | ||
Properties: | ||
Method: Get | ||
Path: /get | ||
ImplicitPost: | ||
Type: Api | ||
Properties: | ||
Method: Post | ||
Path: /post | ||
Metadata: | ||
SamTransformTest: true |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,3 +25,4 @@ Resources: | |
- numeric: | ||
- '>=' | ||
- 100 | ||
FilterPolicyScope: MessageAttributes |
62 changes: 62 additions & 0 deletions
62
...nctional/commands/validate/lib/models/http_api_lambda_auth_with_permissions_resource.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
Resources: | ||
HttpApiFunction: | ||
Type: AWS::Serverless::Function | ||
Properties: | ||
CodeUri: s3://sam-demo-bucket/todo_list.zip | ||
Handler: index.restapi | ||
Runtime: python3.7 | ||
Events: | ||
Basic: | ||
Type: HttpApi | ||
Properties: | ||
Path: /basic | ||
Method: GET | ||
ApiId: !Ref MyApi | ||
|
||
MyAuthFn: | ||
Type: AWS::Serverless::Function | ||
Properties: | ||
CodeUri: s3://bucket/key | ||
Handler: index.handler | ||
Runtime: nodejs12.x | ||
|
||
MyApi: | ||
Type: AWS::Serverless::HttpApi | ||
Properties: | ||
Tags: | ||
Tag1: value1 | ||
Tag2: value2 | ||
Auth: | ||
Authorizers: | ||
LambdaAuthWithEnablePropertyTrue: | ||
# should create permissions resource for this auth | ||
FunctionArn: !GetAtt MyAuthFn.Arn | ||
EnableFunctionDefaultPermissions: true | ||
AuthorizerPayloadFormatVersion: 1.0 | ||
LambdaAuthNoEnableProperty: | ||
# should not create permissions resource for this auth as http api doesn't create the resource by default | ||
FunctionArn: !GetAtt MyAuthFn.Arn | ||
AuthorizerPayloadFormatVersion: 1.0 | ||
LambdaAuthWithEnablePropertySetFalse: | ||
# should not create permissions resource for this auth | ||
FunctionArn: !GetAtt MyAuthFn.Arn | ||
AuthorizerPayloadFormatVersion: 1.0 | ||
EnableFunctionDefaultPermissions: false | ||
LambdaAuthFull: | ||
# should create permissions resource for this auth | ||
FunctionArn: !GetAtt MyAuthFn.Arn | ||
FunctionInvokeRole: !GetAtt MyAuthFnRole.Arn | ||
EnableFunctionDefaultPermissions: true | ||
Identity: | ||
Context: | ||
- contextVar | ||
Headers: | ||
- Authorization | ||
QueryStrings: | ||
- petId | ||
StageVariables: | ||
- stageVar | ||
ReauthorizeEvery: 60 | ||
AuthorizerPayloadFormatVersion: 2.0 | ||
EnableSimpleResponses: true | ||
DefaultAuthorizer: LambdaAuthWithEnablePropertyTrue |
Oops, something went wrong.