-
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.
Update aws-sam-translator Dependency (#1448)
* Added test templates as a part of SAM 1.15.1 release * removed templates of application resource type and corrected the errors in sam template validator * removed the application resource yaml files * fix: set isolated.txt to have aws-sam-translator (1.15.1) * Bump start-api integ tests from 300 to 600
- Loading branch information
Showing
39 changed files
with
970 additions
and
87 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
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,4 +25,4 @@ Resources: | |
type: object | ||
properties: | ||
username: | ||
type: string | ||
type: string |
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
51 changes: 51 additions & 0 deletions
51
tests/functional/commands/validate/lib/models/api_with_apikey_default_override.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,51 @@ | ||
Resources: | ||
MyApiWithAuth: | ||
Type: "AWS::Serverless::Api" | ||
Properties: | ||
StageName: Prod | ||
Auth: | ||
ApiKeyRequired: true | ||
|
||
MyFunctionWithApiKeyRequiredDefault: | ||
Type: AWS::Serverless::Function | ||
Properties: | ||
CodeUri: s3://bucket/key | ||
Handler: index.handler | ||
Runtime: nodejs8.10 | ||
Events: | ||
MyApiWithApiKeyRequiredDefault: | ||
Type: Api | ||
Properties: | ||
RestApiId: !Ref MyApiWithAuth | ||
Path: /ApiKeyDefault | ||
Method: get | ||
MyFunctionWithApiKeyRequiredTrue: | ||
Type: AWS::Serverless::Function | ||
Properties: | ||
CodeUri: s3://bucket/key | ||
Handler: index.handler | ||
Runtime: nodejs8.10 | ||
Events: | ||
MyApiWithApiKeyRequiredTrue: | ||
Type: Api | ||
Properties: | ||
RestApiId: !Ref MyApiWithAuth | ||
Path: /ApiKeyTrue | ||
Method: get | ||
Auth: | ||
ApiKeyRequired: true | ||
MyFunctionWithApiKeyRequiredFalse: | ||
Type: AWS::Serverless::Function | ||
Properties: | ||
CodeUri: s3://bucket/key | ||
Handler: index.handler | ||
Runtime: nodejs8.10 | ||
Events: | ||
MyApiWithApiKeyRequiredFalse: | ||
Type: Api | ||
Properties: | ||
RestApiId: !Ref MyApiWithAuth | ||
Path: /ApiKeyFalse | ||
Method: get | ||
Auth: | ||
ApiKeyRequired: false |
21 changes: 21 additions & 0 deletions
21
tests/functional/commands/validate/lib/models/api_with_apikey_required.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,21 @@ | ||
Resources: | ||
MyApiWithoutAuth: | ||
Type: "AWS::Serverless::Api" | ||
Properties: | ||
StageName: Prod | ||
|
||
MyFunctionWithApiKeyRequired: | ||
Type: AWS::Serverless::Function | ||
Properties: | ||
CodeUri: s3://bucket/key | ||
Handler: index.handler | ||
Runtime: nodejs8.10 | ||
Events: | ||
MyApiWithApiKeyRequired: | ||
Type: Api | ||
Properties: | ||
RestApiId: !Ref MyApiWithoutAuth | ||
Path: /ApiKeyRequiredTrue | ||
Method: get | ||
Auth: | ||
ApiKeyRequired: true |
22 changes: 22 additions & 0 deletions
22
tests/functional/commands/validate/lib/models/api_with_apikey_required_openapi_3.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,22 @@ | ||
Resources: | ||
MyApiWithoutAuth: | ||
Type: "AWS::Serverless::Api" | ||
Properties: | ||
StageName: Prod | ||
OpenApiVersion: '3.0.1' | ||
|
||
MyFunctionWithApiKeyRequired: | ||
Type: AWS::Serverless::Function | ||
Properties: | ||
CodeUri: s3://bucket/key | ||
Handler: index.handler | ||
Runtime: nodejs8.10 | ||
Events: | ||
MyApiWithApiKeyRequired: | ||
Type: Api | ||
Properties: | ||
RestApiId: !Ref MyApiWithoutAuth | ||
Path: /ApiKeyRequiredTrue | ||
Method: get | ||
Auth: | ||
ApiKeyRequired: 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
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
25 changes: 25 additions & 0 deletions
25
tests/functional/commands/validate/lib/models/api_with_aws_account_blacklist.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,25 @@ | ||
Globals: | ||
Api: | ||
Auth: | ||
ResourcePolicy: | ||
AwsAccountBlacklist: ['12345'] | ||
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: nodejs8.10 | ||
Events: | ||
Api: | ||
Type: Api | ||
Properties: | ||
Method: Put | ||
Path: /get |
28 changes: 28 additions & 0 deletions
28
tests/functional/commands/validate/lib/models/api_with_aws_account_whitelist.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,28 @@ | ||
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: nodejs8.10 | ||
Events: | ||
Api: | ||
Type: Api | ||
Properties: | ||
Auth: | ||
ResourcePolicy: | ||
AwsAccountWhitelist: [ | ||
"12345" | ||
] | ||
AwsAccountBlacklist: [ | ||
"67890" | ||
] | ||
Method: Put | ||
Path: /get |
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
29 changes: 29 additions & 0 deletions
29
...ctional/commands/validate/lib/models/api_with_default_aws_iam_auth_and_no_auth_route.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,29 @@ | ||
Resources: | ||
MyApiWithAwsIamAuth: | ||
Type: "AWS::Serverless::Api" | ||
Properties: | ||
StageName: Prod | ||
Auth: | ||
DefaultAuthorizer: AWS_IAM | ||
|
||
MyFunctionWithAwsIamAuth: | ||
Type: AWS::Serverless::Function | ||
Properties: | ||
CodeUri: s3://bucket/key | ||
Handler: index.handler | ||
Runtime: nodejs8.10 | ||
Events: | ||
MyApiWithAwsIamAuth: | ||
Type: Api | ||
Properties: | ||
RestApiId: !Ref MyApiWithAwsIamAuth | ||
Path: / | ||
Method: post | ||
MyApiWithNoAuth: | ||
Type: Api | ||
Properties: | ||
RestApiId: !Ref MyApiWithAwsIamAuth | ||
Path: / | ||
Method: get | ||
Auth: | ||
Authorizer: 'NONE' |
56 changes: 56 additions & 0 deletions
56
tests/functional/commands/validate/lib/models/api_with_incompatible_stage_name.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,56 @@ | ||
Resources: | ||
HyphenFunction: | ||
Type: AWS::Serverless::Function | ||
Properties: | ||
CodeUri: s3://sam-demo-bucket/member_portal.zip | ||
Handler: index.gethtml | ||
Runtime: nodejs4.3 | ||
Events: | ||
GetHtml: | ||
Type: Api | ||
Properties: | ||
RestApiId: HyphenApi | ||
Path: / | ||
Method: get | ||
RequestModel: | ||
Model: User | ||
Required: true | ||
|
||
HyphenApi: | ||
Type: AWS::Serverless::Api | ||
Properties: | ||
StageName: hoge-fuga | ||
Models: | ||
User: | ||
type: object | ||
properties: | ||
username: | ||
type: string | ||
|
||
UnderscoreFunction: | ||
Type: AWS::Serverless::Function | ||
Properties: | ||
CodeUri: s3://sam-demo-bucket/member_portal.zip | ||
Handler: index.gethtml | ||
Runtime: nodejs4.3 | ||
Events: | ||
GetHtml: | ||
Type: Api | ||
Properties: | ||
RestApiId: UnderscoreApi | ||
Path: / | ||
Method: get | ||
RequestModel: | ||
Model: User | ||
Required: true | ||
|
||
UnderscoreApi: | ||
Type: AWS::Serverless::Api | ||
Properties: | ||
StageName: hoge_fuga | ||
Models: | ||
User: | ||
type: object | ||
properties: | ||
username: | ||
type: string |
Oops, something went wrong.