在AWS Cloud Formation模板中揭示Snstopic topicarn:我如何在我的SNS主题的云形式脚本中公开我的主题?

发布于 2025-02-10 21:10:31 字数 1062 浏览 0 评论 0原文

我想通过cloudformation模板在我的堆栈中的cloudformation模板中揭示我的snstopic的主题arn值(在我的代码代码段底部的输出部分中引用),以与我在资源中暴露在资源中的方式相似的方式通过服务目录创建鼻孔。我试图通过使用点表示法在YAML脚本的“输出”部分中引用它来访问它,但到目前为止一直没有成功。我怎么能这样做?我想这样做,以便将来其他人使用我的脚本来搜索另一个地方的主题来订阅它。

要注意的另一个重要的事情是,在资源代码块的“属性”部分下,下面的已提供的产品ID会生成snstopic。

Resources:

  LabTrainingSnsTopic:
    Type: "AWS::ServiceCatalog::CloudFormationProvisionedProduct"
    Properties:
      ProductId: prod-4iafsjovqrsrm # Sns Topic 
      ProvisioningArtifactName: "v1.1" # Must be an actual version number. 
      ProvisionedProductName: !Ref ProvisionedProductName
...
Outputs:

AccountID:
  Description: The account in which this was built.
  Value: !Ref 'AWS::AccountId'
TopicArn:
  Description: Arn of the topic we created
  Value: !GetAtt LabTrainingHigSnsTopic.ProvisionedProductName.Resources.SNSTopic

服务目录屏幕截图 cloudformation屏幕快照

I'd like to expose the TopicArn Value (referenced in the outputs section at the bottom of my code snippet) of my SNStopic via Cloudformation template in the outputs tab of my stack in a similar manner to the way it's exposed in the resources when I create an SNStopic through the service catalog. I tried to access it by referencing it in the outputs section of my yaml script using dot notation but have been unsuccessful thus far. How might I be able to do so? I'm looking to do this so others using my script in the future won't have to go searching for the TopicArn in another place in order to subscribe to it.

Another important thing to note is that the provisioned product id below, under the properties section of the resources code block generates an SNSTopic.

Resources:

  LabTrainingSnsTopic:
    Type: "AWS::ServiceCatalog::CloudFormationProvisionedProduct"
    Properties:
      ProductId: prod-4iafsjovqrsrm # Sns Topic 
      ProvisioningArtifactName: "v1.1" # Must be an actual version number. 
      ProvisionedProductName: !Ref ProvisionedProductName
...
Outputs:

AccountID:
  Description: The account in which this was built.
  Value: !Ref 'AWS::AccountId'
TopicArn:
  Description: Arn of the topic we created
  Value: !GetAtt LabTrainingHigSnsTopic.ProvisionedProductName.Resources.SNSTopic

service catalog screenshot
cloudformation screenshot

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文