-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Condition handling (for issue #142) #653
Conversation
Whitespce correction
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great! Looking forward to the additions you mentioned.
- Added get_passthrough_resource_attributes to Resource currently only returns Condition - Added make_conditional to intrinsics surrounds data with Fn:If and returns AWS::NoValue if the condition is false SamFunction - _construct_role of SamFunction now passes condition to created role - _construct_version of SamFunction now adds condition to version - _construct_alias of SamFunction now passes Condition to alias PushEvents - All events: _construct_permission passes passthrough attributes - CloudWatchEvent gives event_rule same condition as function - S3 gives event_rule same condition as function - S3 Conditional DependsOn for the bucket (undocumented used!!) (see comments) - S3 conditional LambdaConfigurations added Tests - Added test case s3_with_condition (+updated function_with_condition) - test_cloudwatchlogs_event_source.py mock fixed Still not done... This is harder than I though, some help would be appreciated :-)
Discussion: In the code I add a Tag: Key value: sam:ConditionalDependsOn:logical-id (logical-id of the permission in this case) Regards Jacco |
Push event conditionals
@Jacco Thank you for submitting this PR! Are there any other outstanding items that you are going to address, or is this PR ready for review? |
@keetonian I think it is ready for review. In the post above I point out a possible issue about conditional DependsOns. Another issue might be the lack of tests, to test all possible scenario's with conditionals. But since its currently unsupported (Condition properties are essentially ignored). I think it could be released as a beta feature to get some bug reports/improvement requests (maybe with a command line parameter to activate). Personally I do not have enough experience to oversee all the consequences. |
* document new property FilterPolicy in the SNS event source * add unit test for sns event source * implement new property FilterPolicy for SNS event source * reorder the filter elements in the translated CloudFormation templates to align with the order in the original SAM template. * add example lambda_sns_filter_policy * add newline at the end of the yaml file
@brettstack is this blocked by those outstanding items mentioned by @Jacco ? Sounds like he is waiting on review? I know I'm new here, but is there anything I can do to help either of you? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good. Couple of minor comments.
Whitespce correction
- Added get_passthrough_resource_attributes to Resource currently only returns Condition - Added make_conditional to intrinsics surrounds data with Fn:If and returns AWS::NoValue if the condition is false SamFunction - _construct_role of SamFunction now passes condition to created role - _construct_version of SamFunction now adds condition to version - _construct_alias of SamFunction now passes Condition to alias PushEvents - All events: _construct_permission passes passthrough attributes - CloudWatchEvent gives event_rule same condition as function - S3 gives event_rule same condition as function - S3 Conditional DependsOn for the bucket (undocumented used!!) (see comments) - S3 conditional LambdaConfigurations added Tests - Added test case s3_with_condition (+updated function_with_condition) - test_cloudwatchlogs_event_source.py mock fixed Still not done... This is harder than I though, some help would be appreciated :-)
Push event conditionals
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excited for this feature!
@keetonian I will have a look. Am a bit busy ATM so it might take some time. |
Ok, no worries then. Thanks again for your work on this! |
*Issue #142 *
Description of changes:
This is my first PR, I know there is still work to do:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.