Skip to content

Commit

Permalink
Implement CloudFormation's physical_resource_id for Data Pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
hltbra committed Sep 17, 2015
1 parent 8623483 commit dafddb0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions moto/datapipeline/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ def __init__(self, name, unique_id):
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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand All @@ -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'])

0 comments on commit dafddb0

Please sign in to comment.