iam

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2020 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrCode

func ErrCode(msg string, err error) error

ErrCode converts AWS errors to standardized ecs-api errors

Types

type IAM

type IAM struct {
	Service         iamiface.IAMAPI
	DefaultKmsKeyID string
}

IAM is a wrapper around the aws IAM service with some default config info

func NewSession

func NewSession(account common.Account) IAM

NewSession creates a new IAM session

func (*IAM) CreateRole

func (i *IAM) CreateRole(ctx context.Context, input *iam.CreateRoleInput) (*iam.Role, error)

CreateRole handles creating an IAM role

func (*IAM) DefaultTaskExecutionPolicy

func (i *IAM) DefaultTaskExecutionPolicy(path string) ([]byte, error)

DefaultTaskExecutionPolicy generates the default policy for ECS task execution

func (*IAM) DefaultTaskExecutionRole

func (i *IAM) DefaultTaskExecutionRole(ctx context.Context, path string) (string, error)

DefaultTaskExecutionRole generates the default role (if it doesn't exist) for ECS task execution and returns the ARN

func (*IAM) DeleteRole

func (i *IAM) DeleteRole(ctx context.Context, input *iam.DeleteRoleInput) error

DeleteRole handles deleting an IAM role

func (*IAM) GetRole

func (i *IAM) GetRole(ctx context.Context, input *iam.GetRoleInput) (*iam.Role, error)

GetRole handles getting information about an IAM role

func (*IAM) PutRolePolicy

func (i *IAM) PutRolePolicy(ctx context.Context, input *iam.PutRolePolicyInput) error

PutRolePolicy handles attaching an inline policy to IAM role

type PolicyDoc

type PolicyDoc struct {
	Version   string
	Statement []PolicyStatement
}

PolicyDoc collects the policy statements

type PolicyStatement

type PolicyStatement struct {
	Effect    string
	Action    []string
	Resource  []string            `json:",omitempty"`
	Principal map[string][]string `json:",omitempty"`
}

PolicyStatement is an individual IAM Policy statement

Jump to

Keyboard shortcuts

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