Role.customizeRoles question for random construct path scenario '<stackName>/LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8a/ServiceRole' #26004
Unanswered
matthewloller-vf
asked this question in
Q&A
Replies: 3 comments 3 replies
-
@matthewloller-vf I think you will need to use that first option. First synth the app to get the id and then you can add the |
Beta Was this translation helpful? Give feedback.
2 replies
-
I attempted a basic example however even though I was successfully able to update the customizeRoles object, the role was not replaced because it was already synthed... and we're unable to modify the path after the synth.
|
Beta Was this translation helpful? Give feedback.
0 replies
-
@matthewloller-vf the
Role.customizeRoles(app, {
});
Role.customizeRoles(app, {
usePrecreatedRoles: {
'TestStack/HelloWorldFunction/ServiceRole': 'BasicLogRetention',
'TestStack/LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8a/ServiceRole': 'BasicLogRetention',
}
}); |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I was wondering if anyone has solved this or if this is even currently supported but for the case when dealing with an abstracted construct and the construct path has some randomly generated id tacked on to the tail end (IE. when you specify the 'retention' field on a lambda and it generates a custom resource and a role)
How can we use this feature to swap that role out since that id is created at synth time. Are we able to wildcard that id somehow?
Role.customizeRoles(app, { usePrecreatedRoles: { '<stackName>/LogRetention123481923740981237408921374/ServiceRole': 'myRoleName' } });
Role.customizeRoles(app, { usePrecreatedRoles: { '<stackName>/LogRetention*/ServiceRole': 'myRoleName' } });
@corymhall
Beta Was this translation helpful? Give feedback.
All reactions