fix(assume-role): resolve the IAM provider by category instead of specification slug - #50
Open
agustincelentano wants to merge 2 commits into
Open
fix(assume-role): resolve the IAM provider by category instead of specification slug#50agustincelentano wants to merge 2 commits into
agustincelentano wants to merge 2 commits into
Conversation
…cification slug np provider list ignores --specification_slug and returns every provider under the nrn, so the lookup took whichever provider came first and the role never resolved. Filter by the identity-access-control category, which the API honors.
andres-nullplatform
approved these changes
Sep 4, 2026
…ope can remove the role The AWS provider lists a role's instance profiles before deleting it; without this action every tofu destroy fails on aws_iam_role.lambda and the scope is left in failed with the role behind.
agustincelentano
force-pushed
the
fix/iam-provider-lookup
branch
from
September 4, 2026 21:09
42a8304 to
25768e7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
provider_arn_for_selectorrunsnp provider list --nrn <account> --specification_slug aws-iam-configurationand takes the first result. The API ignores--specification_slugand returns every provider registered under the nrn (13 in our account, the IAM one in position 6), so the lookup returns an unrelated provider, the selector never matches andASSUME_ROLE_ARNstays empty. Workflows then run with the pod's IRSA identity and fail on the first call that needs the scope role (for us:route53:GetHostedZoneinsetup_dns).Reproduced with np CLI 2.8.0 (worker image) and 2.10.0 (agent pod).
Fix
Filter with
--categories identity-access-control, which the API honors and returns exactly the IAM provider. Test stubs updated to the new flag; the 17 bats cases inassume_role_lib.batspass.Also: delete-scope leaves the function role behind
aws_iam_role.lambdafails to destroy withAccessDenied: iam:ListInstanceProfilesForRole: the AWS provider lists a role's instance profiles before deleting it and the requirements policy does not grant that action. The scope ends infailedwith the role left in the account. Second commit adds the action to the requirements policy.