-
Notifications
You must be signed in to change notification settings - Fork 4.4k
(sns): fifo topic construct doesn't append .fifo to the topic name #12386
Copy link
Copy link
Closed
Labels
@aws-cdk/aws-snsRelated to Amazon Simple Notification ServiceRelated to Amazon Simple Notification ServicebugThis issue is a bug.This issue is a bug.effort/smallSmall work item – less than a day of effortSmall work item – less than a day of effortp1
Description
The SNS FIFO topics are failing to deploy because the topic name is missing .fifo at the end.
Reproduction Steps
Create a minimal cdk app with the following SNS FIFO topic and deploy it:
import * as sns from "@aws-cdk/aws-sns";
import * as cdk from "@aws-cdk/core";
class MyStack extends cdk.Stack {
constructor(scope: cdk.Construct, id: string, properties?: cdk.StackProps) {
super(scope, id, properties);
new sns.Topic(this, "MyTopic", {
fifo: true,
});
}
}
const app = new cdk.App();
new MyStack(app, "MyStack");What did you expect to happen?
The SNS topic should append .fifo to the topic name if topic: true and .fifo is not present already.
What actually happened?
The deploy failed:
9:48:48 PM | CREATE_FAILED | AWS::SNS::Topic | FanOutTopic
Invalid parameter: Topic Name (Service: AmazonSNS; Status Code: 400; Error Code: InvalidParameter; Request ID: xxxxx-xxxx-xxxx-xxxxx; Proxy: null)
Environment
- CDK CLI Version : v1.83.0
- Framework Version: v1.83.0
- Node.js Version: v12.20.0
- OS : Ubuntu 20
- Language (Version): TypeScript (4.1)
Other
It works if you manually set the topicName to include .fifo at the end, like this:
new sns.Topic(this, "MyTopic", {
fifo: true,
topicName: "MyTopic.fifo",
});This is 🐛 Bug Report
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
@aws-cdk/aws-snsRelated to Amazon Simple Notification ServiceRelated to Amazon Simple Notification ServicebugThis issue is a bug.This issue is a bug.effort/smallSmall work item – less than a day of effortSmall work item – less than a day of effortp1