如何基于创建另一个 aws 资源来触发任何 aws 资源?
How to trigger an any aws resource based on creation of another aws resource?
我正在使用 cloudformation 模板构建 dynamo 数据库(见下文),一旦堆栈构建成功,我想 alert/notify/trigger 另一个 aws 资源,例如 lambda 函数或 step 函数或 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
您可以设置 SNS 主题和 lambda 函数以从堆栈创建中获取事件。 AWS 文档中给出了如何执行此操作的示例:
您必须调整示例和 lambda 以满足您的需要。
我正在使用 cloudformation 模板构建 dynamo 数据库(见下文),一旦堆栈构建成功,我想 alert/notify/trigger 另一个 aws 资源,例如 lambda 函数或 step 函数或 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
您可以设置 SNS 主题和 lambda 函数以从堆栈创建中获取事件。 AWS 文档中给出了如何执行此操作的示例:
您必须调整示例和 lambda 以满足您的需要。