I have a CDK stack that creates both a lambda and a SNS topic. The policies are set to allow the lambda to publish to the SNS topic.
I am having a hard time trying to specify the Topic ARN within my lambda runtime code as it is technically not created yet, just in the stack.
How can I reference the Topic ARN in the Lambda code so lambda publishes to the topic? Lambda is written in python. I am using the fromAsset method (https://docs.aws.amazon.com/cdk/api/latest/docs/aws-lambda-readme.html) to specify my lambda runtime code in my stack.
sns = boto3.client('sns')
responce = sns.publish(
TopicArn="arn would go here --- not sure what to put here w/ no arn",
Message="my_message"
)