iam

package
v0.4.1-pre03 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2021 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrCode added in v0.2.0

func ErrCode(msg string, err error) error

Types

type Condition

type Condition map[string]ConditionStatement

Condition maps a condition operator to the condition-key/condition-value statement ie. "{ "StringEquals" : { "aws:username" : "johndoe" }}" for more information, see https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition.html

type ConditionStatement

type ConditionStatement map[string]interface{}

ConditionStatement maps condition-key to condition-value ie. "{ "aws:username" : "johndoe" }"

type IAM added in v0.2.0

type IAM struct {
	Service iamiface.IAMAPI
	// contains filtered or unexported fields
}

func New added in v0.2.0

func New(opts ...IAMOption) IAM

func (*IAM) AddUserToGroup added in v0.2.0

func (i *IAM) AddUserToGroup(ctx context.Context, userName, groupName string) error

AddUserToGroup adds an existing user to an existing group

func (*IAM) AttachGroupPolicy added in v0.2.0

func (i *IAM) AttachGroupPolicy(ctx context.Context, groupName, policyArn string) error

func (*IAM) CreateAccessKey added in v0.3.0

func (i *IAM) CreateAccessKey(ctx context.Context, name string) (*iam.AccessKey, error)

func (*IAM) CreateGroup added in v0.2.0

func (i *IAM) CreateGroup(ctx context.Context, name, path string) (*iam.Group, error)

CreateGroup handles creating an IAM group

func (*IAM) CreatePolicy added in v0.2.0

func (i *IAM) CreatePolicy(ctx context.Context, name, path, policyDoc string) (*iam.Policy, error)

func (*IAM) CreateUser added in v0.2.0

func (i *IAM) CreateUser(ctx context.Context, name, path string, tags []*iam.Tag) (*iam.User, error)

func (*IAM) DeleteAccessKey added in v0.3.0

func (i *IAM) DeleteAccessKey(ctx context.Context, name, keyId string) error

func (*IAM) DeleteUser added in v0.2.0

func (i *IAM) DeleteUser(ctx context.Context, name string) error

func (*IAM) GetDefaultPolicyVersion added in v0.2.0

func (i *IAM) GetDefaultPolicyVersion(ctx context.Context, arn, version string) (*iam.PolicyVersion, error)

func (*IAM) GetGroupWithPath added in v0.2.0

func (i *IAM) GetGroupWithPath(ctx context.Context, name, path string) (*iam.Group, error)

GetGroup gets the details of an IAM group

func (*IAM) GetPolicyByName added in v0.2.0

func (i *IAM) GetPolicyByName(ctx context.Context, name, path string) (*iam.Policy, error)

func (*IAM) GetUserWithPath added in v0.2.0

func (i *IAM) GetUserWithPath(ctx context.Context, path, name string) (*iam.User, error)

GetUserWithPath gets details about a user and returns an error if the path doesn't match

func (*IAM) ListAccessKeys added in v0.2.0

func (i *IAM) ListAccessKeys(ctx context.Context, name string) ([]*iam.AccessKeyMetadata, error)

func (*IAM) ListAttachedGroupPolicies added in v0.2.0

func (i *IAM) ListAttachedGroupPolicies(ctx context.Context, groupName, path string) ([]string, error)

func (*IAM) ListGroupsForUser added in v0.2.0

func (i *IAM) ListGroupsForUser(ctx context.Context, name string) ([]string, error)

func (*IAM) ListUsers added in v0.2.0

func (i *IAM) ListUsers(ctx context.Context, path string) ([]string, error)

ListUsers lists all of the users in a path prefix, "/" by default

func (*IAM) RemoveUserFromGroup added in v0.2.0

func (i *IAM) RemoveUserFromGroup(ctx context.Context, userName, groupName string) error

RemoveUserFromGroup removes a user from a group

func (*IAM) TagUser added in v0.3.0

func (i *IAM) TagUser(ctx context.Context, name string, tags []*iam.Tag) error

func (*IAM) UpdatePolicy added in v0.2.0

func (i *IAM) UpdatePolicy(ctx context.Context, arn, policyDoc string) error

func (*IAM) WaitForPolicy added in v0.2.0

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

func (*IAM) WaitForUser added in v0.2.0

func (i *IAM) WaitForUser(ctx context.Context, name string) error

type IAMOption added in v0.2.0

type IAMOption func(*IAM)

func WithCredentials added in v0.2.0

func WithCredentials(key, secret, token, region string) IAMOption

func WithSession added in v0.2.0

func WithSession(sess *session.Session) IAMOption

type PolicyDocument

type PolicyDocument struct {
	Version   string
	Statement []StatementEntry
}

type StatementEntry

type StatementEntry struct {
	Action    []string
	Condition Condition `json:",omitempty"`
	Effect    string
	Principal string   `json:",omitempty"`
	Resource  []string `json:",omitempty"`
	Sid       string   `json:",omitempty"`
}

Jump to

Keyboard shortcuts

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