I'm new to AWS CloudFormation, I've used it to deploy CloudTrail to a number of accounts without issue however I'm trying to use one centralised SNS Topic that each CloudTrail can use, if I edit via the CloudTrail GUI it works but I can't get CloudFormation to work.
---
AWSTemplateFormatVersion: '2010-09-09'
Description: Centralised CloudTrail
Resources:
CloudTrail:
Type: "AWS::CloudTrail::Trail"
Properties:
EnableLogFileValidation: 'false'
IncludeGlobalServiceEvents: 'true'
IsLogging: 'true'
IsMultiRegionTrail: 'true'
S3BucketName: company-cloudtrail-au
TrailName: Trail1
SnsTopicName: SNSTopic
I'm trying to use the ARN for the SNS Topic (example below) but I can't figure out how to tell CloudFormation to use the ARN instead of the Name, if I just put the name in then it creates a new SNS topic in each child account.
If I go to the GUI after CloudFormation is deployed I can then point it to the correct ARN and it's centralised but it's not ideal, let me know if SNS isn't meant to be shared across accounts or if there is a better way to do this.
Example ARN for SNS Topic - arn:aws:sns:ap-southeast-1:1111111111:SNSTopic