Skip to content

COPILOT_SNS_TOPIC_ARNS in Cloudformation Template Uses Incorrect AccountID #2949

@tsmith-rv

Description

@tsmith-rv

When creating an application that has a publish section in the manifest file, an SNS Topic will be created when you deploy your application and according to the documentation the ARN of the newly created SNS Topic(s) will be injected into your task environment in the COPILOT_SNS_TOPIC_ARNS variable.

So, in my application, I am using two separate accounts. I ran my initial copilot init for my app using what I'll call the prod account, but have a separate environment in another account that we'll call nonprod.

Right now, when deploying my application to my nonprod environment/account, while building the ARN for the SNS Topic it is hardcoding the Account ID from the prod account. In my cloudformation template you see (using fake account IDs):

- Name: COPILOT_SNS_TOPIC_ARNS
  Value: '{"readyForProcessing":"arn:aws:sns:us-east-1:111111111prod:pf-athena-nonprod-ingest-readyForProcessing"}'

However, I would expect to see:

- Name: COPILOT_SNS_TOPIC_ARNS
  Value: '{"readyForProcessing":"arn:aws:sns:us-east-1:22222222nonprod:pf-athena-nonprod-ingest-readyForProcessing"}'

Or maybe even (I think this is the better way to do it):

- Name: COPILOT_SNS_TOPIC_ARNS
  Value: !Sub '{"readyForProcessing":"arn:aws:sns:us-east-1:${AWS::AccountId}:pf-athena-nonprod-ingest-readyForProcessing"}'

I'm using the latest release (v1.11.0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/bugIssues that are bugs.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions