instanceprofile

package
v1.14.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 20, 2026 License: Apache-2.0 Imports: 12 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatPath added in v1.13.0

func FormatPath(segments ...string) string

FormatPath builds an IAM path from segments, e.g. FormatPath("karpenter", region, clusterName, nodeClassUID) returns "/karpenter/{region}/{clusterName}/{nodeClassUID}/".

func GetProfileCacheKey added in v1.8.0

func GetProfileCacheKey(profileName string) string

func IsRoleNotFoundError added in v1.7.0

func IsRoleNotFoundError(err error) bool

IsRoleNotFoundError converts a smithy.APIError returned by AddRoleToInstanceProfile to a RoleNotFoundError.

Types

type DefaultProvider added in v0.36.0

type DefaultProvider struct {
	// contains filtered or unexported fields
}

func NewDefaultProvider added in v0.37.0

func NewDefaultProvider(
	iamapi sdk.IAMAPI,
	instanceProfileCache *cache.Cache,
	roleCache *cache.Cache,
	protectedProfileCache *cache.Cache,
	region string,
) *DefaultProvider

func (*DefaultProvider) Create added in v0.36.0

func (p *DefaultProvider) Create(
	ctx context.Context,
	instanceProfileName string,
	roleName string,
	tags map[string]string,
	path string,
) error

func (*DefaultProvider) Delete added in v0.36.0

func (p *DefaultProvider) Delete(ctx context.Context, instanceProfileName string) error

func (*DefaultProvider) Get added in v1.4.0

func (p *DefaultProvider) Get(ctx context.Context, instanceProfileName string) (*iamtypes.InstanceProfile, error)

func (*DefaultProvider) IsProtected added in v1.7.0

func (p *DefaultProvider) IsProtected(profileName string) bool

func (*DefaultProvider) ListProfiles added in v1.13.0

func (p *DefaultProvider) ListProfiles(ctx context.Context, pathPrefix string) ([]*iamtypes.InstanceProfile, error)

func (*DefaultProvider) SetProtectedState added in v1.7.0

func (p *DefaultProvider) SetProtectedState(profileName string, protected bool)

type Provider

type Provider interface {
	Get(context.Context, string) (*iamtypes.InstanceProfile, error)
	Create(context.Context, string, string, map[string]string, string) error
	Delete(context.Context, string) error
	ListProfiles(context.Context, string) ([]*iamtypes.InstanceProfile, error)
	IsProtected(string) bool
	SetProtectedState(string, bool)
}

type RoleNotFoundErrorCache added in v1.7.0

type RoleNotFoundErrorCache struct {
	*cache.Cache
}

RoleNotFoundErrorCache is a wrapper around a go-cache for handling role not found errors returned by AddRoleToInstanceProfile.

func (RoleNotFoundErrorCache) HasError added in v1.7.0

func (rc RoleNotFoundErrorCache) HasError(roleName string) (error, bool)

HasError returns the last RoleNotFoundError encountered when attempting to add the given role to an instance profile.

func (RoleNotFoundErrorCache) SetError added in v1.7.0

func (rc RoleNotFoundErrorCache) SetError(roleName string, err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL