kubernetes/kops · error

error building iam instance profile

Error message

error building iam instance profile: %v

What it means

Linking the instance group to its IAM instance profile failed while building the elastigroup; the referenced profile task could not be resolved, usually because of an earlier IAM model error.

Solutions

  1. Check earlier IAM model errors in the log for the root cause
  2. Verify the instance group's IAM profile configuration
  3. Re-run kops update after fixing IAM settings
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at pkg/model/awsmodel/spotinst.go:282 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05). Data as JSON: /api/errors/e6be0fc4dda719a0. Report an issue: GitHub.

Appendix: source

Thrown at pkg/model/awsmodel/spotinst.go:282

			group.DrainingTimeout, err = parseInt(v)
			if err != nil {
				return err
			}

		case SpotInstanceGroupLabelHealthCheckType:
			group.HealthCheckType = new(strings.ToUpper(v))
		}
	}

	// Spot percentage.
	if group.SpotPercentage == nil {
		group.SpotPercentage = defaultSpotPercentage(ig)
	}

	// Instance profile.
	group.IAMInstanceProfile, err = b.LinkToIAMInstanceProfile(ig)
	if err != nil {
		return fmt.Errorf("error building iam instance profile: %v", err)
	}

	// Root volume.
	group.RootVolumeOpts, err = b.buildRootVolumeOpts(ig)
	if err != nil {
		return fmt.Errorf("error building root volume options: %v", err)
	}

	// Tenancy.
	if ig.Spec.Tenancy != "" {
		group.Tenancy = new(ig.Spec.Tenancy)
	}

	// Security groups.
	group.SecurityGroups, err = b.buildSecurityGroups(c, ig)
	if err != nil {
		return fmt.Errorf("error building security groups: %v", err)
	}

View on GitHub (pinned to 4c8573c808)