-
Notifications
You must be signed in to change notification settings - Fork 219
Add custom role to cloudwatch event which trigger step functions #317
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
Conversation
Possible fix for this issue serverless-operations#306 It allows to add already created role to CloudWatch event
|
@bucha09 LGTM and should work, can you add some tests around it? |
It allows to use already created role in CloudWatch event which trigger StepFunctions
Possible fix for this issue serverless-operations#306
Made some research and add some fixes to code. It'll use iamRole when it defined in serverless.yml or if not defined, then leave as it was (create new role). Made some research and add some fixes to code. It'll use iamRole when it defined in serverless.yml or if not defined, then leave as it was (create new role). cloudwatchEvent: cloudformation template and if iamRole is defined:
then cloudformation template: |
fix: fixed eslint
fix: add description in readme.md
|
@theburningmonk Finally, I've fixed issues and add description in readme.md, fixed lint problems. Tested, and looks like everything is ok |
|
@bucha09 I don't understand your example.. are the cloudformation templates pasted the wrong way round? |
| "Arn": { "Ref": "${stateMachineLogicalId}" }, | ||
| "Id": "${cloudWatchId}", | ||
| "RoleArn": { | ||
| ${IamRole ? `"RoleArn":"${IamRole}"` : `"RoleArn": { |
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 feels a bit weird, having the entire blob inside an if/else, can you do the if-else on ln47 when you assign the value of IamRole instead?
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.
@theburningmonk I'll do my best)
|
@theburningmonk Now, cloudformation paste correct RoleArn if Role is defined in serverless.yml. If Role isn't defined in serverless.yml then leave as it was (it'll create new role) |
|
@bucha09 sorry, I meant the example you cited here. When you set the IAM role explicitly I'd have expected the CloudFormation template to reflect that: is that not the case?
|
|
@theburningmonk cloudwatchEvent: then cloudformation template: "State": "ENABLED", and if iamRole is defined: then cloudformation template |
|
🎉 This PR is included in version 2.17.4 🎉 The release is available on: Your semantic-release bot 📦🚀 |
|
@theburningmonk Thanks! |
Add custom role to cloudwatch event which trigger step functions

Possible fix for this issue #306 It allows to add already created role to CloudWatch event