You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
EC2: a launch template's TagSpecifications and IamInstanceProfile are not parsed #471
Follow-up from #453, which made RunInstances merge a launch template with request-level parameters field by field.
The gap
parseLaunchTemplateData (emulator/ec2_plugin.go) does not parse TagSpecifications or IamInstanceProfile from LaunchTemplateData. So:
Tags in a template are silently dropped. An instance launched from a template carrying TagSpecifications comes up untagged. A consumer whose CDK/Terraform stack tags instances through the launch template rather than through RunInstances sees DescribeInstances report no tags, and a tag: filter returns nothing — with no error to explain why.
IamInstanceProfile is dropped. The instance reports no profile, so a consumer asserting the role attached to its instances has an assertion that cannot fail.
Because both fields are absent from the parsed structure, #453's per-field precedence matrix has nothing to assert for them: the request's value wins by default rather than by rule, which happens to match AWS's documented precedence but for the wrong reason. If either field is later parsed without the fallback being written, the precedence silently inverts.
Acceptance criteria
parseLaunchTemplateData parses TagSpecifications and IamInstanceProfile (both the Arn and Name forms)
CreateLaunchTemplate → DescribeLaunchTemplateVersions round-trips both
An instance launched from a template carrying TagSpecifications reports those tags from DescribeInstances, and a tag: filter finds it
An instance launched from a template carrying IamInstanceProfile reports it in DescribeInstances
Shipped in v0.86.0. One note on why this issue pulled another one into the release with it.
The read-back criterion was unsatisfiable as written. This issue asked for a CreateLaunchTemplate → read-back round-trip, and the natural way to do that is DescribeLaunchTemplates. The reference settles that it cannot: the response carries only summary fields (createTime, createdBy, defaultVersionNumber, latestVersionNumber, launchTemplateId, launchTemplateName) — no launchTemplateData
at all. DescribeLaunchTemplateVersions is the only operation that returns a template's
parameters, and substrate did not have it.
So rather than weaken the criterion to an indirect assertion (launch an instance, infer the
template's contents from it), #456 came into the release first and the criterion is
satisfied exactly as written. That is also why the two are sequenced the way they are.
Two behaviours worth flagging, both of which a consumer can get wrong:
Template tags replace rather than merge. A request naming any TagSpecification
discards the template's entirely, per the general RunInstances rule that "any
additional parameters that you specify for the new instance overwrite the corresponding
parameters included in the launch template". The reference gives no TagSpecifications-specific merge semantics, so this is the general rule applied — noted
as such in the comment rather than cited as a per-field statement.
Template tags are subject to both tag rules, checked in two places: at CreateLaunchTemplate / CreateLaunchTemplateVersion, and again at launch, because a
template stored before the checks existed can still carry a reserved key. That closes the
hole this issue specifically warned about — template tags becoming a second unrestricted
path for aws: keys.
Volume- and network-interface-scoped template tags remain unmodelled and are documented as
such rather than silently dropped.
Activity
fix(ec2): carry a launch template's tags and instance profile to the …
scttfrdmn commentedon Aug 2, 2026
Shipped in v0.86.0. One note on why this issue pulled another one into the release with it.
The read-back criterion was unsatisfiable as written. This issue asked for a
CreateLaunchTemplate→ read-back round-trip, and the natural way to do that isDescribeLaunchTemplates. The reference settles that it cannot: the response carriesonly summary fields (
createTime,createdBy,defaultVersionNumber,latestVersionNumber,launchTemplateId,launchTemplateName) — nolaunchTemplateDataat all.
DescribeLaunchTemplateVersionsis the only operation that returns a template'sparameters, and substrate did not have it.
So rather than weaken the criterion to an indirect assertion (launch an instance, infer the
template's contents from it), #456 came into the release first and the criterion is
satisfied exactly as written. That is also why the two are sequenced the way they are.
Two behaviours worth flagging, both of which a consumer can get wrong:
TagSpecificationdiscards the template's entirely, per the general
RunInstancesrule that "anyadditional parameters that you specify for the new instance overwrite the corresponding
parameters included in the launch template". The reference gives no
TagSpecifications-specific merge semantics, so this is the general rule applied — notedas such in the comment rather than cited as a per-field statement.
CreateLaunchTemplate/CreateLaunchTemplateVersion, and again at launch, because atemplate stored before the checks existed can still carry a reserved key. That closes the
hole this issue specifically warned about — template tags becoming a second unrestricted
path for
aws:keys.Volume- and network-interface-scoped template tags remain unmodelled and are documented as
such rather than silently dropped.