Allow CloudFormation stack tags to be updated
Limitations: * does not update the tags of the resources in the stack. that can be implemented later. * does not support the supposed feature of clearing tags by passing an empty value that boto3 mentions in its documentation. I could not find anything in the request body to indicate when an empty value was passed.
This commit is contained in:
parent
a6e762340d
commit
6f4cb512ac
4 changed files with 43 additions and 6 deletions
|
|
@ -424,7 +424,7 @@ def test_update_stack():
|
|||
|
||||
|
||||
@mock_cloudformation_deprecated
|
||||
def test_update_stack():
|
||||
def test_update_stack_with_previous_template():
|
||||
conn = boto.connect_cloudformation()
|
||||
conn.create_stack(
|
||||
"test_stack",
|
||||
|
|
@ -482,6 +482,26 @@ def test_update_stack_with_parameters():
|
|||
assert stack.parameters[0].value == "192.168.0.1/16"
|
||||
|
||||
|
||||
@mock_cloudformation_deprecated
|
||||
def test_update_stack_replace_tags():
|
||||
conn = boto.connect_cloudformation()
|
||||
conn.create_stack(
|
||||
"test_stack",
|
||||
template_body=dummy_template_json,
|
||||
tags={"foo": "bar"},
|
||||
)
|
||||
conn.update_stack(
|
||||
"test_stack",
|
||||
template_body=dummy_template_json,
|
||||
tags={"foo": "baz"},
|
||||
)
|
||||
|
||||
stack = conn.describe_stacks()[0]
|
||||
stack.stack_status.should.equal("UPDATE_COMPLETE")
|
||||
# since there is one tag it doesn't come out as a list
|
||||
dict(stack.tags).should.equal({"foo": "baz"})
|
||||
|
||||
|
||||
@mock_cloudformation_deprecated
|
||||
def test_update_stack_when_rolled_back():
|
||||
conn = boto.connect_cloudformation()
|
||||
|
|
|
|||
|
|
@ -258,12 +258,15 @@ def test_describe_updated_stack():
|
|||
cf_conn.create_stack(
|
||||
StackName="test_stack",
|
||||
TemplateBody=dummy_template_json,
|
||||
Tags=[{'Key': 'foo', 'Value': 'bar'}],
|
||||
)
|
||||
|
||||
cf_conn.update_stack(
|
||||
StackName="test_stack",
|
||||
RoleARN='arn:aws:iam::123456789012:role/moto',
|
||||
TemplateBody=dummy_update_template_json)
|
||||
TemplateBody=dummy_update_template_json,
|
||||
Tags=[{'Key': 'foo', 'Value': 'baz'}],
|
||||
)
|
||||
|
||||
stack = cf_conn.describe_stacks(StackName="test_stack")['Stacks'][0]
|
||||
stack_id = stack['StackId']
|
||||
|
|
@ -272,6 +275,7 @@ def test_describe_updated_stack():
|
|||
stack_by_id['StackName'].should.equal("test_stack")
|
||||
stack_by_id['StackStatus'].should.equal("UPDATE_COMPLETE")
|
||||
stack_by_id['RoleARN'].should.equal('arn:aws:iam::123456789012:role/moto')
|
||||
stack_by_id['Tags'].should.equal([{'Key': 'foo', 'Value': 'baz'}])
|
||||
|
||||
|
||||
@mock_cloudformation
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue