bug: Auto Scaling instances lose the IAM profile inherited from a launch template #72
Replies: 1 comment 1 reply
|
Retested on 2026-10-10 against unmodified All ten Auto Scaling instances across profile Name/Arn and explicit version 2, Resolved image index: |
Uh oh!
There was an error while loading. Please reload this page.
Auto Scaling instances lose
IamInstanceProfileinherited from a launch template, although the IAM profile exists and an explicit profile on a directRunInstancescall works.Tested on unmodified
localstack/localstack-pro:dev, resolved 2026-10-10:sha256:513f218caf22d1fcb115f055225c96c7140813efcb23e48c9e24b688cdb31cd4sha256:b104c9b43442fba4e1e00ab68c447681b08db6dc6128273d105e1db5c87e5ab3EC2_VM_MANAGER=mock, public EC2/Auto Scaling/IAM APIs, no extensions or patches.Expected: both instances in each two-instance ASG expose the selected profile ARN in
DescribeInstances, for both launch-templateIamInstanceProfile.Nameand.Arnforms.Observed: both ASG instances omit
IamInstanceProfilein each form. The explicit-profile direct-launch controls expose the correct ARN. Profile loss prevents a guest metadata provider from discovering the intended instance role; this report's standalone reproduction establishes the API metadata defect, not a production AWS comparison or a full guest test.Run against a disposable LocalStack container at port 4566:
The virtual AMI above is for LocalStack's mock VM manager. This script must not target AWS. Remove the disposable container to remove its fixture resources. All credentials and account IDs in the script are dummy values.
The output contains two passing explicit direct-launch controls and four failing ASG profile observations. The same profile also needs to be visible in the native EC2 instance-profile association API. In the installed public Moto model, the template profile appears not to be inherited through the ASG-to-EC2 backend call; resolving it with native account/partition validation and attaching it through the native association operation restores the API behavior in a separate component check. Keeping that ownership in the native model would avoid downstream metadata workarounds.
All reactions