{"record":{"id":"2e3beeca87bbc7ca","repo":"kubernetes/kops","slug":"instance-role-profile-with-id-q-not-found","errorCode":null,"errorMessage":"instance role profile with id %q not found","messagePattern":"instance role profile with id %q not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/awstasks/iaminstanceprofile.go","lineNumber":114,"sourceCode":"\nfunc (e *IAMInstanceProfile) Run(c *fi.CloudupContext) error {\n\treturn fi.CloudupDefaultDeltaRunMethod(e, c)\n}\n\nfunc (s *IAMInstanceProfile) CheckChanges(a, e, changes *IAMInstanceProfile) error {\n\tif a != nil {\n\t\tif fi.ValueOf(e.Name) == \"\" && !fi.ValueOf(e.Shared) {\n\t\t\treturn fi.RequiredField(\"Name\")\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (_ *IAMInstanceProfile) RenderAWS(t *awsup.AWSAPITarget, a, e, changes *IAMInstanceProfile) error {\n\tctx := context.TODO()\n\tif fi.ValueOf(e.Shared) {\n\t\tif a == nil {\n\t\t\treturn fmt.Errorf(\"instance role profile with id %q not found\", fi.ValueOf(e.ID))\n\t\t}\n\t} else if a == nil {\n\t\tklog.V(2).Infof(\"Creating IAMInstanceProfile with Name:%q\", *e.Name)\n\n\t\trequest := &iam.CreateInstanceProfileInput{\n\t\t\tInstanceProfileName: e.Name,\n\t\t}\n\n\t\tresponse, err := t.Cloud.IAM().CreateInstanceProfile(ctx, request)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error creating IAMInstanceProfile: %v\", err)\n\t\t}\n\n\t\ttagRequest := &iam.TagInstanceProfileInput{\n\t\t\tInstanceProfileName: e.Name,\n\t\t\tTags:                mapToIAMTags(e.Tags),\n\t\t}\n\t\t_, err = t.Cloud.IAM().TagInstanceProfile(ctx, tagRequest)","sourceCodeStart":96,"sourceCodeEnd":132,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/awstasks/iaminstanceprofile.go#L96-L132","documentation":"RenderAWS for IAMInstanceProfile requires that when e.Shared is set, the shared profile already exists (a != nil from Find). If the existing profile could not be found, it fails with 'instance role profile with id %q not found'. This is a validation error, not an AWS API failure.","triggerScenarios":"Cluster spec sets a shared IAM instance profile (Shared=true) with an ID/name, but the referenced profile does not exist in the account or Find failed to resolve it before render.","commonSituations":"Typo in the shared profile ID/name; profile deleted out-of-band; cross-account profile referenced; IAM permissions prevented Find from seeing the profile.","solutions":["Verify the shared instance profile ID/name exists: aws iam get-instance-profile --instance-profile-name <name>.","Correct the shared value in the cluster spec (Shared/ID fields).","Remove the Shared flag to let kOps create and manage the profile itself.","Check iam:GetInstanceProfile permission so Find can resolve the shared profile."],"exampleFix":"// before\nshared: true\nid: arn:aws:iam::123456789012:instance-profile/nodes.old\n// after\nshared: true\nid: arn:aws:iam::123456789012:instance-profile/nodes.cluster-name.k8s.local","handlingStrategy":"validation","validationCode":"// Fail fast before apply when shared is set\nif fi.ValueOf(e.Shared) && fi.ValueOf(e.ID) == \"\" {\n    return fmt.Errorf(\"shared IAMInstanceProfile requires a valid ID\")\n}\naws iam get-instance-profile --instance-profile-name <name> || echo \"shared profile missing\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Verify shared profile existence before enabling Shared mode","Copy the exact profile ID/ARN from the AWS console or CLI","Prefer kOps-managed profiles unless the shared profile is guaranteed to exist"],"tags":["aws","iam","instance-profile","configuration"],"backgroundTag":"resource-not-found","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}