diff --git a/cmd/create/accountroles/creators.go b/cmd/create/accountroles/creators.go index b307e6679..a11c0fc57 100644 --- a/cmd/create/accountroles/creators.go +++ b/cmd/create/accountroles/creators.go @@ -354,6 +354,8 @@ func (hcp *hcpManagedPoliciesCreator) printCommands(r *rosa.Runtime, input *acco createRole := buildCreateRoleCommand(accRoleName, file, iamTags, input) + commands = append(commands, createRole) + policyKeys := aws.GetHcpAccountRolePolicyKeys(file) for _, policyKey := range policyKeys { policyARN, err := aws.GetManagedPolicyARN(input.policies, policyKey) @@ -368,7 +370,7 @@ func (hcp *hcpManagedPoliciesCreator) printCommands(r *rosa.Runtime, input *acco } attachRolePolicy := buildAttachRolePolicyCommand(accRoleName, policyARN) - commands = append(commands, createRole, attachRolePolicy) + commands = append(commands, attachRolePolicy) } }