Update Lambda and IAM role ARN validation rules #229
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Loosen the validation rules around versions slightly to allow for aliases like $LATEST to be used.
Update the STS session id pattern with an IAM role ARN pattern. Add link to role trust setup documentation.
This permits role ARNs like
arn:aws:iam::663487780041:role/LambdaTsCdkStack-nik-InvokerRole4DB2757E-QFh1yjd4kBYT
- the previous pattern matches STS session ids which are what you might seeGetCallerIdentity
return, but they are not a valid ARN that Restate Cloud can assume.I've also loosened up the validation pattern for function ARNs so that we can accept built-in and customer aliases like
arn:aws:lambda:eu-central-1:663487780041:function:my-greeter-v1:$LATEST
.Also, I feel strongly that the role ARN should be displayed immediately once the user selects Lambda deployment - in practice, this will be used ~100% of the time in Restate Cloud. Not setting one will only ever work if the Lambda is public-access, which is almost certainly a misconfiguration. I tried to make it work but could not get the layout right at all :-)