From dafddb094bb917f475ee5b079258d553fe135421 Mon Sep 17 00:00:00 2001 From: Hugo Lopes Tavares Date: Thu, 17 Sep 2015 15:19:36 -0400 Subject: [PATCH] Implement CloudFormation's physical_resource_id for Data Pipeline --- moto/datapipeline/models.py | 4 ++++ .../test_cloudformation_stack_integration.py | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/moto/datapipeline/models.py b/moto/datapipeline/models.py index 1b97c01d1..b6a70b5f1 100644 --- a/moto/datapipeline/models.py +++ b/moto/datapipeline/models.py @@ -30,6 +30,10 @@ class Pipeline(object): self.objects = [] self.status = "PENDING" + @property + def physical_resource_id(self): + return self.pipeline_id + def to_meta_json(self): return { "id": self.pipeline_id, diff --git a/tests/test_cloudformation/test_cloudformation_stack_integration.py b/tests/test_cloudformation/test_cloudformation_stack_integration.py index f84535425..a38a1029b 100644 --- a/tests/test_cloudformation/test_cloudformation_stack_integration.py +++ b/tests/test_cloudformation/test_cloudformation_stack_integration.py @@ -1462,7 +1462,7 @@ def test_datapipeline(): } cf_conn = boto.cloudformation.connect_to_region("us-east-1") template_json = json.dumps(dp_template) - cf_conn.create_stack( + stack_id = cf_conn.create_stack( "test_stack", template_body=template_json, ) @@ -1472,3 +1472,7 @@ def test_datapipeline(): data_pipelines['pipelineIdList'].should.have.length_of(1) data_pipelines['pipelineIdList'][0]['name'].should.equal('testDataPipeline') + + stack_resources = cf_conn.list_stack_resources(stack_id) + stack_resources.should.have.length_of(1) + stack_resources[0].physical_resource_id.should.equal(data_pipelines['pipelineIdList'][0]['id'])