【问题标题】:How to trigger an any aws resource based on creation of another aws resource?如何基于创建另一个 aws 资源来触发任何 aws 资源?
【发布时间】:2022-02-01 08:52:45
【问题描述】:

我正在使用 cloudformation 模板构建 dynamo db(见下文),一旦堆栈构建成功,我想提醒/通知/触发另一个 aws 资源,如 lambda 函数或步进函数或 aws 数据管道开始这样我就可以开始填充发电机了。一旦 cloudformation 堆栈创建成功,触发另一个进程或 aws 资源的最佳方法是什么?

AWSTemplateFormatVersion: 2010-09-09
Description: AWS CloudFormation Template To Create a DynamoDB

Parameters:
  HashKeyElementName:
    Type: String
    Default: Id
    Description: Hash Key Name
  HashKeyElementType:
    Type: String
    Default: S
    Description: Hash Key Type
Resources:
  Table:
    Type: AWS::DynamoDB::Table
    Properties:
      TableName: MyTable
      AttributeDefinitions:
        - 
          AttributeName: !Ref HashKeyElementName
          AttributeType: !Ref HashKeyElementType
      KeySchema:
        - 
          AttributeName: !Ref HashKeyElementName
          KeyType: HASH
      ProvisionedThroughput:
        ReadCapacityUnits: 5
        WriteCapacityUnits: 5 
Outputs:
  MyTable:
    Description: Table Created using this template.
    Value: !Ref Table

【问题讨论】:

标签: amazon-web-services amazon-cloudformation


【解决方案1】:

您可以设置 SNS 主题和 lambda 函数以从堆栈创建中获取事件。 AWS 文档中给出了如何做到这一点的示例:

您必须调整示例和 lambda 以满足您的需求。

【讨论】:

    猜你喜欢
    • 2019-05-11
    • 1970-01-01
    • 2019-08-27
    • 1970-01-01
    • 1970-01-01
    • 2018-12-14
    • 2021-10-05
    • 2022-01-03
    • 2019-10-02
    相关资源
    最近更新 更多