forked from aws/serverless-application-model
-
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.
fix: Fail when Intrinsics are in SourceVPC list instead of Intrinsics…
…SourceVPC (aws#1999)
- Loading branch information
Showing
6 changed files
with
127 additions
and
24 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
31 changes: 31 additions & 0 deletions
31
tests/translator/input/error_api_invalid_source_vpc_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,31 @@ | ||
Globals: | ||
Api: | ||
Auth: | ||
ResourcePolicy: | ||
SourceVpcBlacklist: [{"Ref":"SomeParameter"}] | ||
|
||
Parameters: | ||
SomeParameter: | ||
Type: String | ||
Default: param | ||
|
||
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: nodejs12.x | ||
Events: | ||
Api: | ||
Type: Api | ||
Properties: | ||
Method: Put | ||
Path: /get |
31 changes: 31 additions & 0 deletions
31
tests/translator/input/error_api_invalid_source_vpc_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,31 @@ | ||
Globals: | ||
Api: | ||
Auth: | ||
ResourcePolicy: | ||
SourceVpcWhitelist: [{"Ref":"SomeParameter"}] | ||
|
||
Parameters: | ||
SomeParameter: | ||
Type: String | ||
Default: param | ||
|
||
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: nodejs12.x | ||
Events: | ||
Api: | ||
Type: Api | ||
Properties: | ||
Method: Put | ||
Path: /get |
3 changes: 3 additions & 0 deletions
3
tests/translator/output/error_api_invalid_source_vpc_blacklist.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"errorMessage": "Invalid Serverless Application Specification document. Number of errors found: 1. SourceVpcBlacklist must be a list of strings. Use IntrinsicVpcBlacklist instead for values that use Intrinsic Functions" | ||
} |
3 changes: 3 additions & 0 deletions
3
tests/translator/output/error_api_invalid_source_vpc_whitelist.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"errorMessage": "Invalid Serverless Application Specification document. Number of errors found: 1. SourceVpcWhitelist must be a list of strings. Use IntrinsicVpcWhitelist instead for values that use Intrinsic Functions" | ||
} |