Skip to content
Discussion options

You must be logged in to vote

Since the underlying CloudFormation resource AWS::RDS::DBInstance has the AssociatedRoles property that refers to roles associated with the DB instance, it's possible to modify the CDK resource using the node field:

  const instanceRole = new iam.Role(this, 'RDSLambdaRole', {
    assumedBy: new iam.ServicePrincipal('rds.amazonaws.com'),
    roleName: 'rds-lambda-role',
    description: 'Give RDS Postgres instance permission to invoke lambda',
    inlinePolicies: {
      InstanceConnectPolicy: new iam.PolicyDocument({
        statements: [
          new iam.PolicyStatement({
            effect: iam.Effect.ALLOW,
            actions: ['lambda:InvokeFunction'],
            resources: [

Replies: 3 comments 6 replies

Comment options

You must be logged in to vote
4 replies
@revmischa
Comment options

@pahud
Comment options

@pahud
Comment options

@rtcpw
Comment options

Answer selected by mrgrain
Comment options

You must be logged in to vote
2 replies
@rupalimishra-v2
Comment options

@rtcpw
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
7 participants