actions

package
v0.0.0-...-1e4f5fb Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: Apache-2.0 Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountWrapper

type AccountWrapper struct {
	IamClient *iam.Client
}

AccountWrapper encapsulates AWS Identity and Access Management (IAM) account actions used in the examples. It contains an IAM service client that is used to perform account actions.

func (AccountWrapper) GetAccountPasswordPolicy

func (wrapper AccountWrapper) GetAccountPasswordPolicy(ctx context.Context) (*types.PasswordPolicy, error)

GetAccountPasswordPolicy gets the account password policy for the current account. If no policy has been set, a NoSuchEntityException is error is returned.

func (AccountWrapper) ListSAMLProviders

func (wrapper AccountWrapper) ListSAMLProviders(ctx context.Context) ([]types.SAMLProviderListEntry, error)

ListSAMLProviders gets the SAML providers for the account.

type GroupWrapper

type GroupWrapper struct {
	IamClient *iam.Client
}

GroupWrapper encapsulates AWS Identity and Access Management (IAM) group actions used in the examples. It contains an IAM service client that is used to perform group actions.

func (GroupWrapper) ListGroups

func (wrapper GroupWrapper) ListGroups(ctx context.Context, maxGroups int32) ([]types.Group, error)

ListGroups lists up to maxGroups number of groups.

type PolicyDocument

type PolicyDocument struct {
	Version   string
	Statement []PolicyStatement
}

PolicyDocument defines a policy document as a Go struct that can be serialized to JSON.

type PolicyStatement

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

PolicyStatement defines a statement in a policy document.

type PolicyWrapper

type PolicyWrapper struct {
	IamClient *iam.Client
}

PolicyWrapper encapsulates AWS Identity and Access Management (IAM) policy actions used in the examples. It contains an IAM service client that is used to perform policy actions.

func (PolicyWrapper) CreatePolicy

func (wrapper PolicyWrapper) CreatePolicy(ctx context.Context, policyName string, actions []string,
	resourceArn string) (*types.Policy, error)

CreatePolicy creates a policy that grants a list of actions to the specified resource. PolicyDocument shows how to work with a policy document as a data structure and serialize it to JSON by using Go's JSON marshaler.

func (PolicyWrapper) DeletePolicy

func (wrapper PolicyWrapper) DeletePolicy(ctx context.Context, policyArn string) error

DeletePolicy deletes a policy.

func (PolicyWrapper) GetPolicy

func (wrapper PolicyWrapper) GetPolicy(ctx context.Context, policyArn string) (*types.Policy, error)

GetPolicy gets data about a policy.

func (PolicyWrapper) ListPolicies

func (wrapper PolicyWrapper) ListPolicies(ctx context.Context, maxPolicies int32) ([]types.Policy, error)

ListPolicies gets up to maxPolicies policies.

type RoleWrapper

type RoleWrapper struct {
	IamClient *iam.Client
}

RoleWrapper encapsulates AWS Identity and Access Management (IAM) role actions used in the examples. It contains an IAM service client that is used to perform role actions.

func (RoleWrapper) AttachRolePolicy

func (wrapper RoleWrapper) AttachRolePolicy(ctx context.Context, policyArn string, roleName string) error

AttachRolePolicy attaches a policy to a role.

func (RoleWrapper) CreateRole

func (wrapper RoleWrapper) CreateRole(ctx context.Context, roleName string, trustedUserArn string) (*types.Role, error)

CreateRole creates a role that trusts a specified user. The trusted user can assume the role to acquire its permissions. PolicyDocument shows how to work with a policy document as a data structure and serialize it to JSON by using Go's JSON marshaler.

func (RoleWrapper) CreateServiceLinkedRole

func (wrapper RoleWrapper) CreateServiceLinkedRole(ctx context.Context, serviceName string, description string) (
	*types.Role, error)

CreateServiceLinkedRole creates a service-linked role that is owned by the specified service.

func (RoleWrapper) DeleteRole

func (wrapper RoleWrapper) DeleteRole(ctx context.Context, roleName string) error

DeleteRole deletes a role. All attached policies must be detached before a role can be deleted.

func (RoleWrapper) DeleteServiceLinkedRole

func (wrapper RoleWrapper) DeleteServiceLinkedRole(ctx context.Context, roleName string) error

DeleteServiceLinkedRole deletes a service-linked role.

func (RoleWrapper) DetachRolePolicy

func (wrapper RoleWrapper) DetachRolePolicy(ctx context.Context, roleName string, policyArn string) error

DetachRolePolicy detaches a policy from a role.

func (RoleWrapper) GetRole

func (wrapper RoleWrapper) GetRole(ctx context.Context, roleName string) (*types.Role, error)

GetRole gets data about a role.

func (RoleWrapper) ListAttachedRolePolicies

func (wrapper RoleWrapper) ListAttachedRolePolicies(ctx context.Context, roleName string) ([]types.AttachedPolicy, error)

ListAttachedRolePolicies lists the policies that are attached to the specified role.

func (RoleWrapper) ListRolePolicies

func (wrapper RoleWrapper) ListRolePolicies(ctx context.Context, roleName string) ([]string, error)

ListRolePolicies lists the inline policies for a role.

func (RoleWrapper) ListRoles

func (wrapper RoleWrapper) ListRoles(ctx context.Context, maxRoles int32) ([]types.Role, error)

ListRoles gets up to maxRoles roles.

type UserWrapper

type UserWrapper struct {
	IamClient *iam.Client
}

UserWrapper encapsulates user actions used in the examples. It contains an IAM service client that is used to perform user actions.

func (UserWrapper) CreateAccessKeyPair

func (wrapper UserWrapper) CreateAccessKeyPair(ctx context.Context, userName string) (*types.AccessKey, error)

CreateAccessKeyPair creates an access key for a user. The returned access key contains the ID and secret credentials needed to use the key.

func (UserWrapper) CreateUser

func (wrapper UserWrapper) CreateUser(ctx context.Context, userName string) (*types.User, error)

CreateUser creates a new user with the specified name.

func (UserWrapper) CreateUserPolicy

func (wrapper UserWrapper) CreateUserPolicy(ctx context.Context, userName string, policyName string, actions []string,
	roleArn string) error

CreateUserPolicy adds an inline policy to a user. This example creates a policy that grants a list of actions on a specified role. PolicyDocument shows how to work with a policy document as a data structure and serialize it to JSON by using Go's JSON marshaler.

func (UserWrapper) DeleteAccessKey

func (wrapper UserWrapper) DeleteAccessKey(ctx context.Context, userName string, keyId string) error

DeleteAccessKey deletes an access key from a user.

func (UserWrapper) DeleteUser

func (wrapper UserWrapper) DeleteUser(ctx context.Context, userName string) error

DeleteUser deletes a user.

func (UserWrapper) DeleteUserPolicy

func (wrapper UserWrapper) DeleteUserPolicy(ctx context.Context, userName string, policyName string) error

DeleteUserPolicy deletes an inline policy from a user.

func (UserWrapper) GetUser

func (wrapper UserWrapper) GetUser(ctx context.Context, userName string) (*types.User, error)

GetUser gets data about a user.

func (UserWrapper) ListAccessKeys

func (wrapper UserWrapper) ListAccessKeys(ctx context.Context, userName string) ([]types.AccessKeyMetadata, error)

ListAccessKeys lists the access keys for the specified user.

func (UserWrapper) ListUserPolicies

func (wrapper UserWrapper) ListUserPolicies(ctx context.Context, userName string) ([]string, error)

ListUserPolicies lists the inline policies for the specified user.

func (UserWrapper) ListUsers

func (wrapper UserWrapper) ListUsers(ctx context.Context, maxUsers int32) ([]types.User, error)

ListUsers gets up to maxUsers number of users.

Jump to

Keyboard shortcuts

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