Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add support for FindInMap in serverless app plugin #856

Merged
merged 5 commits into from
Mar 19, 2019

Conversation

honglu
Copy link
Contributor

@honglu honglu commented Mar 15, 2019

Description of changes:

  • Add FindInMap action
  • Support intrinsics in serverless app plugin to resolve ApplicationId and SemanticVersion under Location

Description of how you validated changes:
Added unit tests and end to end tests

Checklist:

  • Write/update tests
  • make pr passes

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@brettstack
Copy link
Contributor

Please fix the Travis error

samtranslator/intrinsics/actions.py Show resolved Hide resolved
samtranslator/intrinsics/actions.py Outdated Show resolved Hide resolved
tests/intrinsics/test_actions.py Show resolved Hide resolved
tests/plugins/application/test_serverless_app_plugin.py Outdated Show resolved Hide resolved
value = input_dict[self.intrinsic_name]

# FindInMap expects an array with 3 values
if not isinstance(value, list) or len(value) != 3:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also throw errors in the other scenarios where we return input_dict? Or are there cases where we can't statically resolve them but they may get successfully resolved at runtime during CFN change set execution?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right. In other scenarios, it is possible that some intrinsic functions are still left unresolved.

Copy link
Contributor

@brettstack brettstack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Type: 'AWS::Serverless::Application'
Properties:
Location:
ApplicationId: !Ref ApplicationIdParam
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good, thank you for adding support for this.

@keetonian keetonian merged commit 203bce1 into aws:develop Mar 19, 2019
@honglu honglu deleted the find-in-map branch March 19, 2019 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants