-
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.
fix: allow parameters to be passed through to
SamTranslatorWrapper
(#…
…1961) * fix: allow parameters to be passed through to `SamTranslatorWrapper` Why is this change necessary? * Some plugins require that intrinsics are resolved and parameter information be present. How does it address the issue? * Passing parameters that have parameters and pseudo parameters resolved fixes the issue. * Also tested with local invoke and deploy What side effects does this change have? * None at this point. * fix: integration tests Why is this change necessary? * Integration testing for intrinsics. How does it address the issue? * Test use cases where the function invoke and deploys work and shouldnt work. * fix: test assertions - line numbers Why is this change necessary? * Container Implementation may have changed, which changes the line numbers in the assertion. How does it address the issue? * Updated to correct line number in the assertion. What side effects does this change have? * None * fix: address comments
- Loading branch information
Showing
11 changed files
with
201 additions
and
16 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
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
20 changes: 20 additions & 0 deletions
20
tests/integration/testdata/invoke/layers/layer-bad-template.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,20 @@ | ||
AWSTemplateFormatVersion : '2010-09-09' | ||
Transform: AWS::Serverless-2016-10-31 | ||
Description: Invalid template with bad layer intrinsic. | ||
|
||
Parameters: | ||
|
||
LayerVersion: | ||
Default: 1 | ||
Type: String | ||
|
||
Resources: | ||
LayerBadInstrinsic: | ||
Type: AWS::Serverless::Function | ||
Properties: | ||
Handler: layer-main.handler | ||
Runtime: python3.6 | ||
CodeUri: . | ||
Timeout: 20 | ||
Layers: | ||
- "arn:aws:lambda:us-west-2:111111111101:layer:layerDoesNotExist:${LayerVersion}" |
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
67 changes: 67 additions & 0 deletions
67
tests/integration/testdata/invoke/template-pseudo-params.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,67 @@ | ||
AWSTemplateFormatVersion: '2010-09-09' | ||
Transform: AWS::Serverless-2016-10-31 | ||
Description: Run intrinsics and fill in pseudo parameters first, ApplicationIds used are aws sample app arns. | ||
|
||
Mappings: | ||
MappingExample: | ||
eu-west-1: | ||
ApplicationId: arn:aws:serverlessrepo:us-east-1:077246666028:applications/hello-world | ||
eu-west-2: | ||
ApplicationId: arn:aws:serverlessrepo:us-east-1:077246666028:applications/hello-world | ||
eu-west-3: | ||
ApplicationId: arn:aws:serverlessrepo:us-east-1:077246666028:applications/hello-world | ||
eu-central-1: | ||
ApplicationId: arn:aws:serverlessrepo:us-east-1:077246666028:applications/hello-world | ||
eu-north-1: | ||
ApplicationId: arn:aws:serverlessrepo:us-east-1:077246666028:applications/hello-world | ||
us-east-1: | ||
ApplicationId: arn:aws:serverlessrepo:us-east-1:077246666028:applications/hello-world | ||
us-east-2: | ||
ApplicationId: arn:aws:serverlessrepo:us-east-1:077246666028:applications/hello-world | ||
us-west-1: | ||
ApplicationId: arn:aws:serverlessrepo:us-east-1:077246666028:applications/hello-world | ||
us-west-2: | ||
ApplicationId: arn:aws:serverlessrepo:us-east-1:077246666028:applications/hello-world | ||
ap-east-1: | ||
ApplicationId: arn:aws:serverlessrepo:us-east-1:077246666028:applications/hello-world | ||
ap-south-1: | ||
ApplicationId: arn:aws:serverlessrepo:us-east-1:077246666028:applications/hello-world | ||
ap-northeast-2: | ||
ApplicationId: arn:aws:serverlessrepo:us-east-1:077246666028:applications/hello-world | ||
ap-southeast-1: | ||
ApplicationId: arn:aws:serverlessrepo:us-east-1:077246666028:applications/hello-world | ||
ap-southeast-2: | ||
ApplicationId: arn:aws:serverlessrepo:us-east-1:077246666028:applications/hello-world | ||
ap-northeast-1: | ||
ApplicationId: arn:aws:serverlessrepo:us-east-1:077246666028:applications/hello-world | ||
ca-central-1: | ||
ApplicationId: arn:aws:serverlessrepo:us-east-1:077246666028:applications/hello-world | ||
me-south-1: | ||
ApplicationId: arn:aws:serverlessrepo:us-east-1:077246666028:applications/hello-world | ||
sa-east-1: | ||
ApplicationId: arn:aws:serverlessrepo:us-east-1:077246666028:applications/hello-world | ||
|
||
Resources: | ||
|
||
HelloworldApplication: | ||
Type: AWS::Serverless::Application | ||
Properties: | ||
Location: | ||
ApplicationId: !FindInMap [MappingExample, !Ref AWS::Region, ApplicationId] | ||
SemanticVersion: 1.0.4 | ||
Parameters: | ||
IdentityNameParameter: TestName | ||
|
||
HelloWorldServerlessFunction: | ||
Type: AWS::Serverless::Function | ||
Properties: | ||
Handler: main.intrinsics_handler | ||
Runtime: python3.7 | ||
CodeUri: . | ||
Timeout: 600 | ||
Environment: | ||
Variables: | ||
ApplicationId: !FindInMap [MappingExample, !Ref AWS::Region, ApplicationId] | ||
|
||
|
||
|
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