awsapi

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

This section is empty.

Types

type EKS added in v0.0.4

type EKS struct {
	Client eksiface.EKSAPI
}

func NewEKS added in v0.0.4

func NewEKS(region string) *EKS

func (*EKS) DescribeCluster added in v0.0.4

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

DescribeCluster function provides cluster info

type EKSIface added in v0.0.4

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 added in v0.0.4

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) (*iam.CreateRoleOutput, error)

CreateRole will try to create an IAM Role, or return back Nil if it can not be created

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) EnsureRole added in v0.0.8

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

EnsureRole ensures that a role exists, and that it has the appropriate configuration

func (*IAM) GetOrCreateRole added in v0.0.8

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

GetOrCreateRole will try to create a new IAM Role in AWS. If it exists already, it will use that role. In either case we return back an IAMRoleResponse{} object.

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 added in v0.0.4

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)
	EnsureRole(ctx context.Context, req IAMRoleRequest)
	UpdateRole(ctx context.Context, req IAMRoleRequest)
	DeleteRole(ctx context.Context, roleName string)
	GetRole(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
}

func NewIAMRoleResponseFromCreateRole added in v0.0.8

func NewIAMRoleResponseFromCreateRole(output iam.CreateRoleOutput) *IAMRoleResponse

func NewIAMRoleResponseFromGetRole added in v0.0.8

func NewIAMRoleResponseFromGetRole(output iam.GetRoleOutput) *IAMRoleResponse

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)
}

Jump to

Keyboard shortcuts

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