AWS Architech
Published in

AWS Architech

AWS CDK: attach permissions to existing role

The great thing about AWS CDK is that it handles a lot of things under the hood for you. This includes IAM permissioning.

What if you need to extend the permissions of a service role that’s created by CDK for a resource that is in your CDK?

It’s simple.

Say you have a Lambda function,

const doSomethingLambda = new NodejsFunction(this, 'do-something-lambda', {
memorySize: 1024,
timeout: cdk.Duration.seconds(5),
runtime: lambda.Runtime.NODEJS_14_X

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store