Documentation ¶
Index ¶
- type AccountWrapper
- type GroupWrapper
- type PolicyDocument
- type PolicyStatement
- type PolicyWrapper
- func (wrapper PolicyWrapper) CreatePolicy(ctx context.Context, policyName string, actions []string, resourceArn string) (*types.Policy, error)
- func (wrapper PolicyWrapper) DeletePolicy(ctx context.Context, policyArn string) error
- func (wrapper PolicyWrapper) GetPolicy(ctx context.Context, policyArn string) (*types.Policy, error)
- func (wrapper PolicyWrapper) ListPolicies(ctx context.Context, maxPolicies int32) ([]types.Policy, error)
- type RoleWrapper
- func (wrapper RoleWrapper) AttachRolePolicy(ctx context.Context, policyArn string, roleName string) error
- func (wrapper RoleWrapper) CreateRole(ctx context.Context, roleName string, trustedUserArn string) (*types.Role, error)
- func (wrapper RoleWrapper) CreateServiceLinkedRole(ctx context.Context, serviceName string, description string) (*types.Role, error)
- func (wrapper RoleWrapper) DeleteRole(ctx context.Context, roleName string) error
- func (wrapper RoleWrapper) DeleteServiceLinkedRole(ctx context.Context, roleName string) error
- func (wrapper RoleWrapper) DetachRolePolicy(ctx context.Context, roleName string, policyArn string) error
- func (wrapper RoleWrapper) GetRole(ctx context.Context, roleName string) (*types.Role, error)
- func (wrapper RoleWrapper) ListAttachedRolePolicies(ctx context.Context, roleName string) ([]types.AttachedPolicy, error)
- func (wrapper RoleWrapper) ListRolePolicies(ctx context.Context, roleName string) ([]string, error)
- func (wrapper RoleWrapper) ListRoles(ctx context.Context, maxRoles int32) ([]types.Role, error)
- type UserWrapper
- func (wrapper UserWrapper) CreateAccessKeyPair(ctx context.Context, userName string) (*types.AccessKey, error)
- func (wrapper UserWrapper) CreateUser(ctx context.Context, userName string) (*types.User, error)
- func (wrapper UserWrapper) CreateUserPolicy(ctx context.Context, userName string, policyName string, actions []string, ...) error
- func (wrapper UserWrapper) DeleteAccessKey(ctx context.Context, userName string, keyId string) error
- func (wrapper UserWrapper) DeleteUser(ctx context.Context, userName string) error
- func (wrapper UserWrapper) DeleteUserPolicy(ctx context.Context, userName string, policyName string) error
- func (wrapper UserWrapper) GetUser(ctx context.Context, userName string) (*types.User, error)
- func (wrapper UserWrapper) ListAccessKeys(ctx context.Context, userName string) ([]types.AccessKeyMetadata, error)
- func (wrapper UserWrapper) ListUserPolicies(ctx context.Context, userName string) ([]string, error)
- func (wrapper UserWrapper) ListUsers(ctx context.Context, maxUsers int32) ([]types.User, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountWrapper ¶
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 ¶
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 ¶
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 ¶
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 ¶
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) 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 ¶
ListRolePolicies lists the inline policies for a role.
type UserWrapper ¶
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 ¶
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) 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 ¶
ListUserPolicies lists the inline policies for the specified user.