Documentation

Index

Constants

View Source
const (
	RoleAlreadyExistsError = "Please choose a different name"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type EKS

type EKS struct {
	Client eksiface.EKSAPI
}

func NewEKS

func NewEKS(region string) *EKS

func (*EKS) DescribeCluster

func (e *EKS) DescribeCluster(ctx context.Context, clusterName string) (*eks.DescribeClusterOutput, error)

    DescribeCluster function provides cluster info

    type EKSIface

    type EKSIface interface {
    	DescribeCluster(ctx context.Context, clusterName string)
    }

    type IAM

    type IAM struct {
    	Client iamiface.IAMAPI
    }

    func NewIAM

    func NewIAM(region string) *IAM

    func (*IAM) AddPermissionBoundary

    func (i *IAM) AddPermissionBoundary(ctx context.Context, req IAMRoleRequest) error

      AddPermissionBoundary adds permission boundary to the existing roles

      func (*IAM) AttachInlineRolePolicy

      func (i *IAM) AttachInlineRolePolicy(ctx context.Context, req IAMRoleRequest) (*IAMRoleResponse, error)

        AttachInlineRolePolicy function attaches inline policy to the role

        func (*IAM) AttachManagedRolePolicy

        func (i *IAM) AttachManagedRolePolicy(ctx context.Context, policyArn string, roleName string) error

          AttachManagedRolePolicy function attaches managed policy to the role

          func (*IAM) CreateOIDCProvider

          func (i *IAM) CreateOIDCProvider(ctx context.Context, url string, aud string, certThumpPrint string) error

            CreateOIDCProvider creates OIDC IDP provider with AWS IAM

            func (*IAM) CreateRole

            func (i *IAM) CreateRole(ctx context.Context, req IAMRoleRequest) (*IAMRoleResponse, error)

              CreateRole creates/updates the role

              func (*IAM) DeleteInlinePolicy

              func (i *IAM) DeleteInlinePolicy(ctx context.Context, policyName string, roleName string) error

                DeleteInlinePolicy function deletes inline policy

                func (*IAM) DeleteRole

                func (i *IAM) DeleteRole(ctx context.Context, roleName string) error

                  DeleteRole function deletes the role in the account

                  func (*IAM) DetachRolePolicy

                  func (i *IAM) DetachRolePolicy(ctx context.Context, policyArn string, roleName string) error

                    DetachRolePolicy detaches a policy from role

                    func (*IAM) GetRole

                    func (i *IAM) GetRole(ctx context.Context, req IAMRoleRequest) (*iam.GetRoleOutput, error)

                      GetRole gets the role from aws iam

                      func (*IAM) GetRolePolicy

                      func (i *IAM) GetRolePolicy(ctx context.Context, req IAMRoleRequest) (*string, error)

                        GetRolePolicy gets the role from aws iam

                        func (*IAM) TagRole

                        func (i *IAM) TagRole(ctx context.Context, req IAMRoleRequest) (*IAMRoleResponse, error)

                          TagRole tags role with appropriate tags

                          func (*IAM) UpdateRole

                          func (i *IAM) UpdateRole(ctx context.Context, req IAMRoleRequest) (*IAMRoleResponse, error)

                            UpdateRole updates role

                            func (*IAM) VerifyTags

                            func (i *IAM) VerifyTags(ctx context.Context, req IAMRoleRequest) (*IAMRoleResponse, error)

                              VerifyTags function verifies the tags attached to the role

                              type IAMIface

                              type IAMIface interface {
                              	CreateRole(ctx context.Context, req IAMRoleRequest)
                              	UpdateRole(ctx context.Context, req IAMRoleRequest)
                              	DeleteRole(ctx context.Context, roleName string)
                              	AttachInlineRolePolicy(ctx context.Context, req IAMRoleRequest)
                              	AddPermissionBoundary(ctx context.Context, req IAMRoleRequest) error
                              	GetRolePolicy(ctx context.Context, req IAMRoleRequest) bool
                              }

                                IAMIface defines interface methods

                                type IAMRoleRequest

                                type IAMRoleRequest struct {
                                	Name                            string
                                	PolicyName                      string
                                	Description                     string
                                	SessionDuration                 int64
                                	TrustPolicy                     string
                                	PermissionPolicy                string
                                	ManagedPermissionBoundaryPolicy string
                                	ManagedPolicies                 []string
                                	Tags                            map[string]string
                                }

                                  IAMRoleRequest struct

                                  type IAMRoleResponse

                                  type IAMRoleResponse struct {
                                  	RoleARN string
                                  	RoleID  string
                                  }

                                  type STS

                                  type STS struct {
                                  	Client stsiface.STSAPI
                                  }

                                  func NewSTS

                                  func NewSTS(region string) *STS

                                  func (*STS) GetAccountID

                                  func (i *STS) GetAccountID(ctx context.Context) (string, error)

                                    GetAccountID loads aws accountID from sts caller identity

                                    type STSIface

                                    type STSIface interface {
                                    	GetAccountID(ctx context.Context) (string, error)
                                    }

                                    Source Files