本文整理汇总了Python中cfn_sphere.aws.cfn.CloudFormation.handle_stack_event方法的典型用法代码示例。如果您正苦于以下问题:Python CloudFormation.handle_stack_event方法的具体用法?Python CloudFormation.handle_stack_event怎么用?Python CloudFormation.handle_stack_event使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cfn_sphere.aws.cfn.CloudFormation
的用法示例。
在下文中一共展示了CloudFormation.handle_stack_event方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_handle_stack_event_raises_exception_on_rollback_complete
# 需要导入模块: from cfn_sphere.aws.cfn import CloudFormation [as 别名]
# 或者: from cfn_sphere.aws.cfn.CloudFormation import handle_stack_event [as 别名]
def test_handle_stack_event_raises_exception_on_rollback_complete(self, _):
event = {
'PhysicalResourceId': 'arn:aws:sns:eu-west-1:1234567890:my-topic',
'StackName': 'my-stack',
'LogicalResourceId': 'VPC',
'StackId': 'arn:aws:cloudformation:eu-west-1:1234567890:stack/my-stack/my-stack-id',
'ResourceType': 'AWS::CloudFormation::Stack',
'Timestamp': datetime.datetime(2016, 4, 1, 8, 3, 27, 548000, tzinfo=tzutc()),
'EventId': 'my-event-id',
'ResourceStatus': 'ROLLBACK_COMPLETE'
}
valid_from_timestamp = datetime.datetime(2016, 4, 1, 8, 3, 25, 548000, tzinfo=tzutc())
cfn = CloudFormation()
with self.assertRaises(CfnStackActionFailedException):
cfn.handle_stack_event(event, valid_from_timestamp, "CREATE_COMPLETE")
示例2: test_handle_stack_event_returns_none_if_event_has_not_expected_state
# 需要导入模块: from cfn_sphere.aws.cfn import CloudFormation [as 别名]
# 或者: from cfn_sphere.aws.cfn.CloudFormation import handle_stack_event [as 别名]
def test_handle_stack_event_returns_none_if_event_has_not_expected_state(self, _):
event = {
'PhysicalResourceId': 'arn:aws:cloudformation:eu-west-1:1234567890:stack/my-stack/my-stack-id',
'StackName': 'my-stack',
'LogicalResourceId': 'cfn-sphere-test-vpc',
'StackId': 'arn:aws:cloudformation:eu-west-1:1234567890:stack/my-stack/my-stack-id',
'ResourceType': 'AWS::CloudFormation::Stack',
'Timestamp': datetime.datetime(2016, 4, 1, 8, 3, 27, 548000, tzinfo=tzutc()),
'EventId': 'my-event-id',
'ResourceStatus': 'CREATE_IN_PROGRESS'
}
valid_from_timestamp = datetime.datetime(2016, 4, 1, 8, 3, 25, 548000, tzinfo=tzutc())
cfn = CloudFormation()
result = cfn.handle_stack_event(event, valid_from_timestamp, "CREATE_COMPLETE")
self.assertIsNone(result)
示例3: test_handle_stack_event_returns_none_if_event_is_no_stack_event
# 需要导入模块: from cfn_sphere.aws.cfn import CloudFormation [as 别名]
# 或者: from cfn_sphere.aws.cfn.CloudFormation import handle_stack_event [as 别名]
def test_handle_stack_event_returns_none_if_event_is_no_stack_event(self, _):
event = {
'PhysicalResourceId': 'arn:aws:sns:eu-west-1:1234567890:my-topic',
'StackName': 'my-stack',
'LogicalResourceId': 'Topic',
'StackId': 'arn:aws:cloudformation:eu-west-1:1234567890:stack/my-stack/my-stack-id',
'ResourceType': 'AWS::SNS::Topic',
'Timestamp': datetime.datetime(2016, 4, 1, 8, 3, 27, 548000, tzinfo=tzutc()),
'EventId': 'my-event-id',
'ResourceStatus': 'CREATE_COMPLETE'
}
valid_from_timestamp = datetime.datetime(2016, 4, 1, 8, 3, 25, 548000, tzinfo=tzutc())
cfn = CloudFormation()
result = cfn.handle_stack_event(event, valid_from_timestamp, "CREATE_COMPLETE", "my-stack")
self.assertIsNone(result)
示例4: test_handle_stack_event_returns_none_on_rollback_in_progress_state
# 需要导入模块: from cfn_sphere.aws.cfn import CloudFormation [as 别名]
# 或者: from cfn_sphere.aws.cfn.CloudFormation import handle_stack_event [as 别名]
def test_handle_stack_event_returns_none_on_rollback_in_progress_state(self, _):
event = {
'PhysicalResourceId': 'arn:aws:sns:eu-west-1:1234567890:my-topic',
'StackName': 'my-stack',
'LogicalResourceId': 'VPC',
'StackId': 'arn:aws:cloudformation:eu-west-1:1234567890:stack/my-stack/my-stack-id',
'ResourceType': 'AWS::CloudFormation::Stack',
'Timestamp': datetime.datetime(2016, 4, 1, 8, 3, 27, 548000, tzinfo=tzutc()),
'EventId': 'my-event-id',
'ResourceStatus': 'ROLLBACK_IN_PROGRESS',
'ResourceStatusReason': 'Foo'
}
valid_from_timestamp = datetime.datetime(2016, 4, 1, 8, 3, 25, 548000, tzinfo=tzutc())
cfn = CloudFormation()
result = cfn.handle_stack_event(event, valid_from_timestamp, "CREATE_COMPLETE")
self.assertIsNone(result)