iam

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// EKSFargateService is the service to trust for fargate pod execution roles.
	EKSFargateService = "eks-fargate-pods.amazonaws.com"
)

Variables

This section is empty.

Functions

func ControlPlaneTrustRelationship

func ControlPlaneTrustRelationship(enableFargate bool) *iamv1.PolicyDocument

ControlPlaneTrustRelationship will generate a ControlPlane PolicyDocument.

func FargateTrustRelationship added in v0.6.5

func FargateTrustRelationship() *iamv1.PolicyDocument

FargateTrustRelationship will generate a Fargate PolicyDocument.

func NodegroupTrustRelationship

func NodegroupTrustRelationship() *iamv1.PolicyDocument

NodegroupTrustRelationship will generate a Nodegroup PolicyDocument.

func RoleTags

func RoleTags(key string, additionalTags infrav1.Tags) []*iam.Tag

RoleTags returns the tags for the given role.

Types

type IAMService

type IAMService struct {
	logr.Logger
	IAMClient iamiface.IAMAPI
}

IAMService defines the specs for an IAM service.

func (*IAMService) CreateOIDCProvider added in v0.6.4

func (s *IAMService) CreateOIDCProvider(cluster *eks.Cluster) (string, error)

CreateOIDCProvider will create an OIDC provider.

func (*IAMService) CreateRole

func (s *IAMService) CreateRole(
	roleName string,
	key string,
	trustRelationship *iamv1.PolicyDocument,
	additionalTags infrav1.Tags,
) (*iam.Role, error)

CreateRole will create a role from the IAMService.

func (*IAMService) DeleteOIDCProvider added in v0.6.4

func (s *IAMService) DeleteOIDCProvider(arn *string) error

DeleteOIDCProvider will delete an OIDC provider.

func (*IAMService) DeleteRole

func (s *IAMService) DeleteRole(name string) error

DeleteRole will delete a role from the IAMService.

func (*IAMService) EnsurePoliciesAttached

func (s *IAMService) EnsurePoliciesAttached(role *iam.Role, policies []*string) (bool, error)

EnsurePoliciesAttached will ensure the IAMService has policies attached.

func (*IAMService) EnsureTagsAndPolicy

func (s *IAMService) EnsureTagsAndPolicy(
	role *iam.Role,
	key string,
	trustRelationship *iamv1.PolicyDocument,
	additionalTags infrav1.Tags,
) (bool, error)

EnsureTagsAndPolicy will ensure any tags and policies against the IAMService.

func (*IAMService) GetIAMRole

func (s *IAMService) GetIAMRole(name string) (*iam.Role, error)

GetIAMRole will return the IAM role for the IAMService.

func (*IAMService) IsUnmanaged

func (s *IAMService) IsUnmanaged(role *iam.Role, key string) bool

IsUnmanaged will check if a given role and tag are unmanaged against the IAMService.

Jump to

Keyboard shortcuts

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