-
Notifications
You must be signed in to change notification settings - Fork 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
feat(stepfunctions-tasks): add optional role property to EvaluateExpressionProps #29288
feat(stepfunctions-tasks): add optional role property to EvaluateExpressionProps #29288
Conversation
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.
The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.
A comment requesting an exemption should contain the text Exemption Request
. Additionally, if clarification is needed add Clarification Request
to a comment.
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
} | ||
|
||
if (props.role) { | ||
uuid += props.role.node.addr; |
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.
I am not totally sure if this is the right way to go about this. But the point is, I want the role to be part of the signature of the function created, so if I want to use different roles in one part of the stack or don't set a role at all, it will create different functions, instead of the first occurrence blocking all of the others.
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.
Is there a risk of this uuid being too long?
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.
I could not find one documented. Also, addr should have a fixed length of 42. SingletonFunction eventually passes it to tryFindChild
. So that is where a length constraint could potentially come up, but otherwise, I think the risk is very low/none.
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.
More likely, what I'm worried about is this addr value changing between deployments and deleting/recreating the function. I'm not sure I understand how the value of addr is calculated well enough to guarantee that won't happen
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.
Are you able to test that? Does it change?
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.
What is the value of props.role.node.addr
? Could we use the props.role.roleName/roleArn
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.
What is the value of props.role.node.addr?
https://docs.aws.amazon.com/cdk/api/v2/docs/constructs.Node.html#addr
tl:dr; SHA-1 of the components of the construct path.
Could we use the props.role.roleName/roleArn instead?
No. this could be a token and change between deployments.
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.
Were you able to test if the value of props.role.node.addr
changes between deployments? From the description, Addresses are calculated using a SHA-1 of the components of the construct path.
, I'm not confident that it would be the same between deployments.
packages/aws-cdk-lib/aws-stepfunctions-tasks/lib/evaluate-expression.ts
Outdated
Show resolved
Hide resolved
} | ||
|
||
if (props.role) { | ||
uuid += props.role.node.addr; |
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.
What is the value of props.role.node.addr
? Could we use the props.role.roleName/roleArn
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.
Just one question and docstring change.
This PR has been in the MERGE CONFLICTS state for 3 weeks, and looks abandoned. To keep this PR from being closed, please continue work on it. If not, it will automatically be closed in a week. |
https://docs.aws.amazon.com/cdk/api/v2/docs/constructs.Node.html#addr tl:dr; SHA-1 of the components of the construct path.
No. this could be a token and change between deployments. |
This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state. |
da1d06c
to
6d82f21
Compare
6d82f21
to
695a608
Compare
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.
The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.
A comment requesting an exemption should contain the text Exemption Request
. Additionally, if clarification is needed add Clarification Request
to a comment.
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state. |
This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state. |
1 similar comment
This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state. |
This PR has been in the MERGE CONFLICTS state for 3 weeks, and looks abandoned. To keep this PR from being closed, please continue work on it. If not, it will automatically be closed in a week. |
This PR has been deemed to be abandoned, and will be automatically closed. Please create a new PR for these changes if you think this decision has been made in error. |
Comments on closed issues and PRs are hard for our team to see. |
Issue # (if applicable)
Closes #29350.
Reason for this change
This change enables customers who need more control over IAM roles and whose environments do not allow them to use auto-generated roles to use EvaluateExpression.
Description of changes
Added a
role
property toEvaluateExpressionProps
that allows customers to bring their own role. This would replace the role that is auto-generated by SingletonFunction when creating the Lambda Function used inside EvaluateExpression.Description of how you validated changes
Added new unit test that validates created Function uses role created externally
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license