title: Cross Account SNS Lambda Subscription using CDK
body: <p>I have 2 AWS CDK applications running in separate AWS accounts, and I'm trying to add CDK to get a lambda in one AWS account to subscribe to notifications in the other AWS account.</p>
  <p>I tried adding the subscription in the lambda account, but this didn't work, since the SNS account doesn't grant permissions.</p>
  <p>CDK in the SNS account:</p>
  <pre><code>val myTopic = Topic(this, &quot;my-topic-id&quot;, TopicProps.builder()
              .displayName(&quot;topicName&quot;)
              .topicName(&quot;topicName&quot;)
              .build())
  </code></pre>
  <p>CDK in the Lambda account:</p>
  <pre><code>val myLambda = Function(...)
  
  val crossAccountTopic = Topic.fromTopicArn(this, &quot;topic-id&quot;, &quot;arn:aws:sns:&lt;region&gt;:&lt;accountId&gt;:topicName&quot;)
  
  crossAccountTopic.addSubscription(LambdaSubscription(myLambda))
  </code></pre>
  <p>Has anyone tried something like this? Is there a way to grant access purely with changes to CDK in both accounts? Or is a manual action required? There may be a way to do this by granting access through IAM roles, so I will investigate this further.</p>