Update stackset create operation to correctly return the resource's ID. (#3709)

* Update stackset create operation to correctly return the resource's ID.

* Add test confirming create_stack_set response.
This commit is contained in:
Jakub Musko 2021-02-18 19:04:12 +01:00 committed by GitHub
parent d07e287b37
commit b6d7704b23
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -438,7 +438,7 @@ class CloudFormationResponse(BaseResponse):
return json.dumps(
{
"CreateStackSetResponse": {
"CreateStackSetResult": {"StackSetId": stackset.stackset_id}
"CreateStackSetResult": {"StackSetId": stackset.id}
}
}
)
@ -926,7 +926,7 @@ LIST_EXPORTS_RESPONSE = """<ListExportsResponse xmlns="http://cloudformation.ama
CREATE_STACK_SET_RESPONSE_TEMPLATE = """<CreateStackSetResponse xmlns="http://internal.amazon.com/coral/com.amazonaws.maestro.service.v20160713/">
<CreateStackSetResult>
<StackSetId>{{ stackset.stackset_id }}</StackSetId>
<StackSetId>{{ stackset.id }}</StackSetId>
</CreateStackSetResult>
<ResponseMetadata>
<RequestId>f457258c-391d-41d1-861f-example</RequestId>

View File

@ -603,13 +603,14 @@ def test_boto3_delete_stack_set():
@mock_cloudformation
def test_boto3_create_stack_set():
cf_conn = boto3.client("cloudformation", region_name="us-east-1")
cf_conn.create_stack_set(
response = cf_conn.create_stack_set(
StackSetName="test_stack_set", TemplateBody=dummy_template_json
)
cf_conn.describe_stack_set(StackSetName="test_stack_set")["StackSet"][
"TemplateBody"
].should.equal(dummy_template_json)
response["StackSetId"].should_not.be.empty
@mock_cloudformation