Skip to content

The stack’s other name

 2 min Convox needed rack-scoped cloud identities while keeping short application names and recognizing stacks created under the old naming scheme.
Published

Feb 8, 2016

An application could be called web inside a rack without being uniquely named web across the cloud account. My Convox proposals separated the short name people used from the CloudFormation stack name.

The new physical name included the rack prefix. A Name tag retained the short name, and the model’s StackName() method supplied the cloud-facing identity to creation, update, resource lookup, and release operations.

That left existing stacks to recognize. The revised proposal tried the bound name first and fell back to the unprefixed name when lookup returned the relevant AWS validation error. It also checked rack ownership rather than treating any matching name as sufficient.

Both that proposal and its earlier version closed without merging.

A later merged follow-up made the service model’s decision explicit through IsBound():

Stored state Interpretation
Nil tag map New object; default to the bound naming scheme
Name tag present Bound stack
Non-nil tag map without Name Legacy unbound stack

StackName() then used that one predicate to choose the prefixed or literal name. The marker introduced by the new representation also identified which representation an existing object used.

The distinction had to survive every operation, not just stack creation. Prefixing writes while continuing to look up the short name would create resources the application could no longer find. The model method gave those callers one place to obtain the right identity while both generations existed.