forked from aws/aws-sam-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: update to aws-sam-translator 1.36.0 (aws#2917)
- Loading branch information
Showing
12 changed files
with
429 additions
and
5 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
117 changes: 117 additions & 0 deletions
117
tests/functional/commands/validate/lib/models/api_with_swagger_authorizer_none.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,117 @@ | ||
Resources: | ||
MyApiWithCognitoAuth: | ||
Type: "AWS::Serverless::Api" | ||
Properties: | ||
StageName: Prod | ||
Auth: | ||
Authorizers: | ||
MyCognitoAuth: | ||
UserPoolArn: !GetAtt MyUserPool.Arn | ||
DefaultAuthorizer: MyCognitoAuth | ||
|
||
MyApiWithLambdaTokenAuth: | ||
Type: "AWS::Serverless::Api" | ||
Properties: | ||
StageName: Prod | ||
Auth: | ||
Authorizers: | ||
MyLambdaTokenAuth: | ||
FunctionArn: !GetAtt MyAuthFn.Arn | ||
DefaultAuthorizer: MyLambdaTokenAuth | ||
|
||
MyApiWithLambdaRequestAuth: | ||
Type: "AWS::Serverless::Api" | ||
Properties: | ||
StageName: Prod | ||
DefinitionBody: | ||
swagger: 2.0 | ||
info: | ||
version: '1.0' | ||
title: !Ref AWS::StackName | ||
schemes: | ||
- https | ||
paths: | ||
"/lambda-request": | ||
get: | ||
x-amazon-apigateway-integration: | ||
httpMethod: POST | ||
type: aws_proxy | ||
uri: !Sub arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${MyFn.Arn}/invocations | ||
passthroughBehavior: when_no_match | ||
responses: {} | ||
Auth: | ||
Authorizers: | ||
MyLambdaRequestAuth: | ||
FunctionPayloadType: REQUEST | ||
FunctionArn: !GetAtt MyAuthFn.Arn | ||
Identity: | ||
Headers: | ||
- Authorization1 | ||
DefaultAuthorizer: MyLambdaRequestAuth | ||
|
||
MyAuthFn: | ||
Type: AWS::Serverless::Function | ||
Properties: | ||
InlineCode: | | ||
exports.handler = async (event) => { | ||
return { | ||
statusCode: 200, | ||
body: JSON.stringify(event), | ||
headers: {} | ||
} | ||
} | ||
Handler: index.handler | ||
Runtime: nodejs8.10 | ||
|
||
MyFn: | ||
Type: AWS::Serverless::Function | ||
Properties: | ||
InlineCode: | | ||
exports.handler = async (event) => { | ||
return { | ||
statusCode: 200, | ||
body: JSON.stringify(event), | ||
headers: {} | ||
} | ||
} | ||
Handler: index.handler | ||
Runtime: nodejs8.10 | ||
Events: | ||
Cognito: | ||
Type: Api | ||
Properties: | ||
RestApiId: !Ref MyApiWithCognitoAuth | ||
Method: get | ||
Auth: | ||
Authorizer: NONE | ||
Path: /cognito | ||
LambdaToken: | ||
Type: Api | ||
Properties: | ||
RestApiId: !Ref MyApiWithLambdaTokenAuth | ||
Method: get | ||
Auth: | ||
Authorizer: NONE | ||
Path: /lambda-token | ||
LambdaRequest: | ||
Type: Api | ||
Properties: | ||
RestApiId: !Ref MyApiWithLambdaRequestAuth | ||
Auth: | ||
Authorizer: NONE | ||
Method: get | ||
Path: /lambda-request | ||
|
||
MyUserPool: | ||
Type: AWS::Cognito::UserPool | ||
Properties: | ||
UserPoolName: UserPoolName | ||
Policies: | ||
PasswordPolicy: | ||
MinimumLength: 8 | ||
UsernameAttributes: | ||
Schema: | ||
- AttributeDataType: String | ||
Name: email | ||
Required: false |
102 changes: 102 additions & 0 deletions
102
.../functional/commands/validate/lib/models/api_with_usageplans_shared_attributes_three.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,102 @@ | ||
Globals: | ||
Api: | ||
Auth: | ||
ApiKeyRequired: true | ||
UsagePlan: | ||
CreateUsagePlan: SHARED | ||
|
||
Conditions: | ||
C1: | ||
Fn::Equals: | ||
- test | ||
- test | ||
C2: | ||
Fn::Equals: | ||
- test | ||
- test | ||
|
||
Resources: | ||
MyApiOne: | ||
Type: AWS::Serverless::Api | ||
Condition: C1 | ||
UpdateReplacePolicy: Delete | ||
Properties: | ||
StageName: Prod | ||
|
||
MyApiTwo: | ||
Type: AWS::Serverless::Api | ||
Condition: C2 | ||
UpdateReplacePolicy: Snapshot | ||
Properties: | ||
StageName: Prod | ||
|
||
MyApiThree: | ||
Type: AWS::Serverless::Api | ||
Properties: | ||
StageName: Prod | ||
|
||
MyFunctionOne: | ||
Type: AWS::Serverless::Function | ||
Properties: | ||
Handler: index.handler | ||
Runtime: nodejs12.x | ||
InlineCode: | | ||
exports.handler = async (event) => { | ||
return { | ||
statusCode: 200, | ||
body: JSON.stringify(event), | ||
headers: {} | ||
} | ||
} | ||
Events: | ||
ApiKey: | ||
Type: Api | ||
Properties: | ||
RestApiId: | ||
Ref: MyApiOne | ||
Method: get | ||
Path: /path/one | ||
|
||
MyFunctionTwo: | ||
Type: AWS::Serverless::Function | ||
Properties: | ||
Handler: index.handler | ||
Runtime: nodejs12.x | ||
InlineCode: | | ||
exports.handler = async (event) => { | ||
return { | ||
statusCode: 200, | ||
body: JSON.stringify(event), | ||
headers: {} | ||
} | ||
} | ||
Events: | ||
ApiKey: | ||
Type: Api | ||
Properties: | ||
RestApiId: | ||
Ref: MyApiTwo | ||
Method: get | ||
Path: /path/two | ||
|
||
MyFunctionThree: | ||
Type: AWS::Serverless::Function | ||
Properties: | ||
Handler: index.handler | ||
Runtime: nodejs12.x | ||
InlineCode: | | ||
exports.handler = async (event) => { | ||
return { | ||
statusCode: 200, | ||
body: JSON.stringify(event), | ||
headers: {} | ||
} | ||
} | ||
Events: | ||
ApiKey: | ||
Type: Api | ||
Properties: | ||
RestApiId: | ||
Ref: MyApiThree | ||
Method: get | ||
Path: /path/three |
75 changes: 75 additions & 0 deletions
75
tests/functional/commands/validate/lib/models/api_with_usageplans_shared_attributes_two.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,75 @@ | ||
Globals: | ||
Api: | ||
Auth: | ||
ApiKeyRequired: true | ||
UsagePlan: | ||
CreateUsagePlan: SHARED | ||
|
||
Conditions: | ||
C1: | ||
Fn::Equals: | ||
- test | ||
- test | ||
C2: | ||
Fn::Equals: | ||
- test | ||
- test | ||
|
||
Resources: | ||
MyApiOne: | ||
Type: AWS::Serverless::Api | ||
DeletionPolicy: Delete | ||
Condition: C1 | ||
Properties: | ||
StageName: Prod | ||
|
||
MyApiTwo: | ||
Type: AWS::Serverless::Api | ||
DeletionPolicy: Retain | ||
Condition: C2 | ||
Properties: | ||
StageName: Prod | ||
|
||
MyFunctionOne: | ||
Type: AWS::Serverless::Function | ||
Properties: | ||
Handler: index.handler | ||
Runtime: nodejs12.x | ||
InlineCode: | | ||
exports.handler = async (event) => { | ||
return { | ||
statusCode: 200, | ||
body: JSON.stringify(event), | ||
headers: {} | ||
} | ||
} | ||
Events: | ||
ApiKey: | ||
Type: Api | ||
Properties: | ||
RestApiId: | ||
Ref: MyApiOne | ||
Method: get | ||
Path: /path/one | ||
|
||
MyFunctionTwo: | ||
Type: AWS::Serverless::Function | ||
Properties: | ||
Handler: index.handler | ||
Runtime: nodejs12.x | ||
InlineCode: | | ||
exports.handler = async (event) => { | ||
return { | ||
statusCode: 200, | ||
body: JSON.stringify(event), | ||
headers: {} | ||
} | ||
} | ||
Events: | ||
ApiKey: | ||
Type: Api | ||
Properties: | ||
RestApiId: | ||
Ref: MyApiTwo | ||
Method: get | ||
Path: /path/two |
23 changes: 23 additions & 0 deletions
23
...commands/validate/lib/models/function_with_deployment_preference_alarms_intrinsic_if.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,23 @@ | ||
Conditions: | ||
MyCondition: | ||
Fn::Equals: | ||
- true | ||
- false | ||
Resources: | ||
MinimalFunction: | ||
Type: "AWS::Serverless::Function" | ||
Properties: | ||
CodeUri: s3://sam-demo-bucket/hello.zip | ||
Handler: hello.handler | ||
Runtime: python2.7 | ||
AutoPublishAlias: live | ||
DeploymentPreference: | ||
Type: Linear10PercentEvery3Minutes | ||
Alarms: | ||
Fn::If: | ||
- MyCondition | ||
- - Alarm1 | ||
- Alarm2 | ||
- Alarm3 | ||
- - Alarm1 | ||
- Alarm5 |
32 changes: 32 additions & 0 deletions
32
tests/functional/commands/validate/lib/models/implicit_api_deletion_policy_precedence.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,32 @@ | ||
Resources: | ||
RestApiFunction: | ||
Type: AWS::Serverless::Function | ||
DeletionPolicy: Delete | ||
UpdateReplacePolicy: Retain | ||
Properties: | ||
CodeUri: s3://sam-demo-bucket/todo_list.zip | ||
Handler: index.restapi | ||
Runtime: nodejs12.x | ||
Policies: AmazonDynamoDBFullAccess | ||
Events: | ||
GetHtml: | ||
Type: Api | ||
Properties: | ||
Path: /{proxy+} | ||
Method: any | ||
|
||
GetHtmlFunction: | ||
Type: AWS::Serverless::Function | ||
DeletionPolicy: Retain | ||
UpdateReplacePolicy: Retain | ||
Properties: | ||
CodeUri: s3://sam-demo-bucket/todo_list.zip | ||
Handler: index.gethtml | ||
Runtime: nodejs12.x | ||
Policies: AmazonDynamoDBReadOnlyAccess | ||
Events: | ||
GetHtml: | ||
Type: Api | ||
Properties: | ||
Path: /{proxy++} | ||
Method: any |
Oops, something went wrong.