When a resource is created during an update process, the AWS::StackId value is not correct.
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "",
"Mappings": {},
"Outputs": {
},
"Parameters": {
"KeyName": {
"Description": "Name of an existing EC2 KeyPair to enable SSH access to the instances",
"Type": "String"
}
},
"Resources": {
"EC2": {
"Metadata": {
"stackid": {"Ref":"AWS::StackId"},
"stackname": {"Ref":"AWS::StackName"}
},
"Properties": {
"ImageId": "cirros-0.3.1-x86_64-uec",
"InstanceType": "m1.nano",
"KeyName": {"Ref": "KeyName"}
},
"Type":"AWS::EC2::Instance"
}
}
}
$ heat stack-create -f <template> -P "KeyName=test" my-stack
...
$ heat resource-metadata my-stack EC2
{
"stackid": "arn:openstack:heat::2bc5532bfd3e4263a949d810e6fc4e65:stacks/stack1/13caf13c-504a-4189-9c4a-9442ea58006d",
"stackname": "stack1"
}
$ heat stack-update -f simple.json -P "KeyName=test2" stack1
...
$ heat resource-metadata stack1 EC2
{
"stackid": "arn:openstack:heat::2bc5532bfd3e4263a949d810e6fc4e65:stacks/stack1/None",
"stackname": "stack1"
}
This is blocking when you want to use the stack id in the instance metadata (eg configuration files of Heat CFN tools).
Ouch.