AWS SDK for Go (PILOT)
API Reference

PREVIEW DOCUMENTATION - This is a preview of a new format for the AWS SDK for Go API Reference documentation. For the current AWS SDK for Go API Reference, see https://docs.aws.amazon.com/sdk-for-go/api/.

We welcome your feedback on this new version of the documentation. Send your comments to aws-sdkdocs-feedback@amazon.com.

IAM

import "github.com/aws/aws-sdk-go/service/iam"

type IAM struct { *client.Client }

IAM provides the API operation methods for making requests to AWS Identity and Access Management. See this package's package overview docs for details on the service.

IAM methods are safe to use concurrently. It is not safe to modify mutate any of the struct's properties though.

Client

Type: *client.Client

Method

AddClientIDToOpenIDConnectProvider

func (c *IAM) AddClientIDToOpenIDConnectProvider(input *AddClientIDToOpenIDConnectProviderInput) (*AddClientIDToOpenIDConnectProviderOutput, error)

AddClientIDToOpenIDConnectProvider API operation for AWS Identity and Access Management.

Adds a new client ID (also known as audience) to the list of client IDs already registered for the specified IAM OpenID Connect (OIDC) provider resource.

This operation is idempotent; it does not fail or return an error if you add an existing client ID to the provider.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation AddClientIDToOpenIDConnectProvider for usage and error information.

Returned Error Codes:

  • ErrCodeInvalidInputException "InvalidInput" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeLimitExceededException "LimitExceeded" The request was rejected because it attempted to create resources beyond the current AWS account limits. The error message describes the limit exceeded.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/AddClientIDToOpenIDConnectProvider

Example

IAM AddClientIDToOpenIDConnectProvider shared00

To add a client ID (audience) to an Open-ID Connect (OIDC) provider

The following add-client-id-to-open-id-connect-provider command adds the client ID my-application-ID to the OIDC provider named server.example.com:

{ svc := iam.New(session.New()) input := &iam.AddClientIDToOpenIDConnectProviderInput{ ClientID: aws.String("my-application-ID"), OpenIDConnectProviderArn: aws.String("arn:aws:iam::123456789012:oidc-provider/server.example.com"), } result, err := svc.AddClientIDToOpenIDConnectProvider(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case iam.ErrCodeInvalidInputException: fmt.Println(iam.ErrCodeInvalidInputException, aerr.Error()) case iam.ErrCodeNoSuchEntityException: fmt.Println(iam.ErrCodeNoSuchEntityException, aerr.Error()) case iam.ErrCodeLimitExceededException: fmt.Println(iam.ErrCodeLimitExceededException, aerr.Error()) case iam.ErrCodeServiceFailureException: fmt.Println(iam.ErrCodeServiceFailureException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

AddClientIDToOpenIDConnectProviderRequest

func (c *IAM) AddClientIDToOpenIDConnectProviderRequest(input *AddClientIDToOpenIDConnectProviderInput) (req *request.Request, output *AddClientIDToOpenIDConnectProviderOutput)

AddClientIDToOpenIDConnectProviderRequest generates a "aws/request.Request" representing the client's request for the AddClientIDToOpenIDConnectProvider operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See AddClientIDToOpenIDConnectProvider for more information on using the AddClientIDToOpenIDConnectProvider API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the AddClientIDToOpenIDConnectProviderRequest method. req, resp := client.AddClientIDToOpenIDConnectProviderRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/AddClientIDToOpenIDConnectProvider

AddClientIDToOpenIDConnectProviderWithContext

func (c *IAM) AddClientIDToOpenIDConnectProviderWithContext(ctx aws.Context, input *AddClientIDToOpenIDConnectProviderInput, opts ...request.Option) (*AddClientIDToOpenIDConnectProviderOutput, error)

AddClientIDToOpenIDConnectProviderWithContext is the same as AddClientIDToOpenIDConnectProvider with the addition of the ability to pass a context and additional request options.

See AddClientIDToOpenIDConnectProvider for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

AddRoleToInstanceProfile

func (c *IAM) AddRoleToInstanceProfile(input *AddRoleToInstanceProfileInput) (*AddRoleToInstanceProfileOutput, error)

AddRoleToInstanceProfile API operation for AWS Identity and Access Management.

Adds the specified IAM role to the specified instance profile. An instance profile can contain only one role, and this limit cannot be increased. You can remove the existing role and then add a different role to an instance profile. You must then wait for the change to appear across all of AWS because of eventual consistency (https://en.wikipedia.org/wiki/Eventual_consistency). To force the change, you must disassociate the instance profile (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DisassociateIamInstanceProfile.html) and then associate the instance profile (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_AssociateIamInstanceProfile.html), or you can stop your instance and then restart it.

The caller of this API must be granted the PassRole permission on the IAM role by a permissions policy.

For more information about roles, go to Working with Roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/WorkingWithRoles.html). For more information about instance profiles, go to About Instance Profiles (https://docs.aws.amazon.com/IAM/latest/UserGuide/AboutInstanceProfiles.html).

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation AddRoleToInstanceProfile for usage and error information.

Returned Error Codes:

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeEntityAlreadyExistsException "EntityAlreadyExists" The request was rejected because it attempted to create a resource that already exists.

  • ErrCodeLimitExceededException "LimitExceeded" The request was rejected because it attempted to create resources beyond the current AWS account limits. The error message describes the limit exceeded.

  • ErrCodeUnmodifiableEntityException "UnmodifiableEntity" The request was rejected because only the service that depends on the service-linked role can modify or delete the role on your behalf. The error message includes the name of the service that depends on this service-linked role. You must request the change through that service.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/AddRoleToInstanceProfile

Example

IAM AddRoleToInstanceProfile shared00

To add a role to an instance profile

The following command adds the role named S3Access to the instance profile named Webserver:

{ svc := iam.New(session.New()) input := &iam.AddRoleToInstanceProfileInput{ InstanceProfileName: aws.String("Webserver"), RoleName: aws.String("S3Access"), } result, err := svc.AddRoleToInstanceProfile(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case iam.ErrCodeNoSuchEntityException: fmt.Println(iam.ErrCodeNoSuchEntityException, aerr.Error()) case iam.ErrCodeEntityAlreadyExistsException: fmt.Println(iam.ErrCodeEntityAlreadyExistsException, aerr.Error()) case iam.ErrCodeLimitExceededException: fmt.Println(iam.ErrCodeLimitExceededException, aerr.Error()) case iam.ErrCodeUnmodifiableEntityException: fmt.Println(iam.ErrCodeUnmodifiableEntityException, aerr.Error()) case iam.ErrCodeServiceFailureException: fmt.Println(iam.ErrCodeServiceFailureException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

AddRoleToInstanceProfileRequest

func (c *IAM) AddRoleToInstanceProfileRequest(input *AddRoleToInstanceProfileInput) (req *request.Request, output *AddRoleToInstanceProfileOutput)

AddRoleToInstanceProfileRequest generates a "aws/request.Request" representing the client's request for the AddRoleToInstanceProfile operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See AddRoleToInstanceProfile for more information on using the AddRoleToInstanceProfile API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the AddRoleToInstanceProfileRequest method. req, resp := client.AddRoleToInstanceProfileRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/AddRoleToInstanceProfile

AddRoleToInstanceProfileWithContext

func (c *IAM) AddRoleToInstanceProfileWithContext(ctx aws.Context, input *AddRoleToInstanceProfileInput, opts ...request.Option) (*AddRoleToInstanceProfileOutput, error)

AddRoleToInstanceProfileWithContext is the same as AddRoleToInstanceProfile with the addition of the ability to pass a context and additional request options.

See AddRoleToInstanceProfile for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

AddUserToGroup

func (c *IAM) AddUserToGroup(input *AddUserToGroupInput) (*AddUserToGroupOutput, error)

AddUserToGroup API operation for AWS Identity and Access Management.

Adds the specified user to the specified group.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation AddUserToGroup for usage and error information.

Returned Error Codes:

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeLimitExceededException "LimitExceeded" The request was rejected because it attempted to create resources beyond the current AWS account limits. The error message describes the limit exceeded.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/AddUserToGroup

Example

IAM AddUserToGroup shared00

To add a user to an IAM group

The following command adds an IAM user named Bob to the IAM group named Admins:

{ svc := iam.New(session.New()) input := &iam.AddUserToGroupInput{ GroupName: aws.String("Admins"), UserName: aws.String("Bob"), } result, err := svc.AddUserToGroup(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case iam.ErrCodeNoSuchEntityException: fmt.Println(iam.ErrCodeNoSuchEntityException, aerr.Error()) case iam.ErrCodeLimitExceededException: fmt.Println(iam.ErrCodeLimitExceededException, aerr.Error()) case iam.ErrCodeServiceFailureException: fmt.Println(iam.ErrCodeServiceFailureException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

AddUserToGroupRequest

func (c *IAM) AddUserToGroupRequest(input *AddUserToGroupInput) (req *request.Request, output *AddUserToGroupOutput)

AddUserToGroupRequest generates a "aws/request.Request" representing the client's request for the AddUserToGroup operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See AddUserToGroup for more information on using the AddUserToGroup API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the AddUserToGroupRequest method. req, resp := client.AddUserToGroupRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/AddUserToGroup

AddUserToGroupWithContext

func (c *IAM) AddUserToGroupWithContext(ctx aws.Context, input *AddUserToGroupInput, opts ...request.Option) (*AddUserToGroupOutput, error)

AddUserToGroupWithContext is the same as AddUserToGroup with the addition of the ability to pass a context and additional request options.

See AddUserToGroup for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

AttachGroupPolicy

func (c *IAM) AttachGroupPolicy(input *AttachGroupPolicyInput) (*AttachGroupPolicyOutput, error)

AttachGroupPolicy API operation for AWS Identity and Access Management.

Attaches the specified managed policy to the specified IAM group.

You use this API to attach a managed policy to a group. To embed an inline policy in a group, use PutGroupPolicy.

For more information about policies, see Managed Policies and Inline Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) in the IAM User Guide.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation AttachGroupPolicy for usage and error information.

Returned Error Codes:

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeLimitExceededException "LimitExceeded" The request was rejected because it attempted to create resources beyond the current AWS account limits. The error message describes the limit exceeded.

  • ErrCodeInvalidInputException "InvalidInput" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

  • ErrCodePolicyNotAttachableException "PolicyNotAttachable" The request failed because AWS service role policies can only be attached to the service-linked role for that service.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/AttachGroupPolicy

Example

IAM AttachGroupPolicy shared00

To attach a managed policy to an IAM group

The following command attaches the AWS managed policy named ReadOnlyAccess to the IAM group named Finance.

{ svc := iam.New(session.New()) input := &iam.AttachGroupPolicyInput{ GroupName: aws.String("Finance"), PolicyArn: aws.String("arn:aws:iam::aws:policy/ReadOnlyAccess"), } result, err := svc.AttachGroupPolicy(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case iam.ErrCodeNoSuchEntityException: fmt.Println(iam.ErrCodeNoSuchEntityException, aerr.Error()) case iam.ErrCodeLimitExceededException: fmt.Println(iam.ErrCodeLimitExceededException, aerr.Error()) case iam.ErrCodeInvalidInputException: fmt.Println(iam.ErrCodeInvalidInputException, aerr.Error()) case iam.ErrCodePolicyNotAttachableException: fmt.Println(iam.ErrCodePolicyNotAttachableException, aerr.Error()) case iam.ErrCodeServiceFailureException: fmt.Println(iam.ErrCodeServiceFailureException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

AttachGroupPolicyRequest

func (c *IAM) AttachGroupPolicyRequest(input *AttachGroupPolicyInput) (req *request.Request, output *AttachGroupPolicyOutput)

AttachGroupPolicyRequest generates a "aws/request.Request" representing the client's request for the AttachGroupPolicy operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See AttachGroupPolicy for more information on using the AttachGroupPolicy API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the AttachGroupPolicyRequest method. req, resp := client.AttachGroupPolicyRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/AttachGroupPolicy

AttachGroupPolicyWithContext

func (c *IAM) AttachGroupPolicyWithContext(ctx aws.Context, input *AttachGroupPolicyInput, opts ...request.Option) (*AttachGroupPolicyOutput, error)

AttachGroupPolicyWithContext is the same as AttachGroupPolicy with the addition of the ability to pass a context and additional request options.

See AttachGroupPolicy for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

AttachRolePolicy

func (c *IAM) AttachRolePolicy(input *AttachRolePolicyInput) (*AttachRolePolicyOutput, error)

AttachRolePolicy API operation for AWS Identity and Access Management.

Attaches the specified managed policy to the specified IAM role. When you attach a managed policy to a role, the managed policy becomes part of the role's permission (access) policy.

You cannot use a managed policy as the role's trust policy. The role's trust policy is created at the same time as the role, using CreateRole. You can update a role's trust policy using UpdateAssumeRolePolicy.

Use this API to attach a managed policy to a role. To embed an inline policy in a role, use PutRolePolicy. For more information about policies, see Managed Policies and Inline Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) in the IAM User Guide.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation AttachRolePolicy for usage and error information.

Returned Error Codes:

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeLimitExceededException "LimitExceeded" The request was rejected because it attempted to create resources beyond the current AWS account limits. The error message describes the limit exceeded.

  • ErrCodeInvalidInputException "InvalidInput" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

  • ErrCodeUnmodifiableEntityException "UnmodifiableEntity" The request was rejected because only the service that depends on the service-linked role can modify or delete the role on your behalf. The error message includes the name of the service that depends on this service-linked role. You must request the change through that service.

  • ErrCodePolicyNotAttachableException "PolicyNotAttachable" The request failed because AWS service role policies can only be attached to the service-linked role for that service.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/AttachRolePolicy

Example

IAM AttachRolePolicy shared00

To attach a managed policy to an IAM role

The following command attaches the AWS managed policy named ReadOnlyAccess to the IAM role named ReadOnlyRole.

{ svc := iam.New(session.New()) input := &iam.AttachRolePolicyInput{ PolicyArn: aws.String("arn:aws:iam::aws:policy/ReadOnlyAccess"), RoleName: aws.String("ReadOnlyRole"), } result, err := svc.AttachRolePolicy(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case iam.ErrCodeNoSuchEntityException: fmt.Println(iam.ErrCodeNoSuchEntityException, aerr.Error()) case iam.ErrCodeLimitExceededException: fmt.Println(iam.ErrCodeLimitExceededException, aerr.Error()) case iam.ErrCodeInvalidInputException: fmt.Println(iam.ErrCodeInvalidInputException, aerr.Error()) case iam.ErrCodeUnmodifiableEntityException: fmt.Println(iam.ErrCodeUnmodifiableEntityException, aerr.Error()) case iam.ErrCodePolicyNotAttachableException: fmt.Println(iam.ErrCodePolicyNotAttachableException, aerr.Error()) case iam.ErrCodeServiceFailureException: fmt.Println(iam.ErrCodeServiceFailureException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

AttachRolePolicyRequest

func (c *IAM) AttachRolePolicyRequest(input *AttachRolePolicyInput) (req *request.Request, output *AttachRolePolicyOutput)

AttachRolePolicyRequest generates a "aws/request.Request" representing the client's request for the AttachRolePolicy operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See AttachRolePolicy for more information on using the AttachRolePolicy API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the AttachRolePolicyRequest method. req, resp := client.AttachRolePolicyRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/AttachRolePolicy

AttachRolePolicyWithContext

func (c *IAM) AttachRolePolicyWithContext(ctx aws.Context, input *AttachRolePolicyInput, opts ...request.Option) (*AttachRolePolicyOutput, error)

AttachRolePolicyWithContext is the same as AttachRolePolicy with the addition of the ability to pass a context and additional request options.

See AttachRolePolicy for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

AttachUserPolicy

func (c *IAM) AttachUserPolicy(input *AttachUserPolicyInput) (*AttachUserPolicyOutput, error)

AttachUserPolicy API operation for AWS Identity and Access Management.

Attaches the specified managed policy to the specified user.

You use this API to attach a managed policy to a user. To embed an inline policy in a user, use PutUserPolicy.

For more information about policies, see Managed Policies and Inline Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) in the IAM User Guide.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation AttachUserPolicy for usage and error information.

Returned Error Codes:

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeLimitExceededException "LimitExceeded" The request was rejected because it attempted to create resources beyond the current AWS account limits. The error message describes the limit exceeded.

  • ErrCodeInvalidInputException "InvalidInput" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

  • ErrCodePolicyNotAttachableException "PolicyNotAttachable" The request failed because AWS service role policies can only be attached to the service-linked role for that service.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/AttachUserPolicy

Example

IAM AttachUserPolicy shared00

To attach a managed policy to an IAM user

The following command attaches the AWS managed policy named AdministratorAccess to the IAM user named Alice.

{ svc := iam.New(session.New()) input := &iam.AttachUserPolicyInput{ PolicyArn: aws.String("arn:aws:iam::aws:policy/AdministratorAccess"), UserName: aws.String("Alice"), } result, err := svc.AttachUserPolicy(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case iam.ErrCodeNoSuchEntityException: fmt.Println(iam.ErrCodeNoSuchEntityException, aerr.Error()) case iam.ErrCodeLimitExceededException: fmt.Println(iam.ErrCodeLimitExceededException, aerr.Error()) case iam.ErrCodeInvalidInputException: fmt.Println(iam.ErrCodeInvalidInputException, aerr.Error()) case iam.ErrCodePolicyNotAttachableException: fmt.Println(iam.ErrCodePolicyNotAttachableException, aerr.Error()) case iam.ErrCodeServiceFailureException: fmt.Println(iam.ErrCodeServiceFailureException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

AttachUserPolicyRequest

func (c *IAM) AttachUserPolicyRequest(input *AttachUserPolicyInput) (req *request.Request, output *AttachUserPolicyOutput)

AttachUserPolicyRequest generates a "aws/request.Request" representing the client's request for the AttachUserPolicy operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See AttachUserPolicy for more information on using the AttachUserPolicy API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the AttachUserPolicyRequest method. req, resp := client.AttachUserPolicyRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/AttachUserPolicy

AttachUserPolicyWithContext

func (c *IAM) AttachUserPolicyWithContext(ctx aws.Context, input *AttachUserPolicyInput, opts ...request.Option) (*AttachUserPolicyOutput, error)

AttachUserPolicyWithContext is the same as AttachUserPolicy with the addition of the ability to pass a context and additional request options.

See AttachUserPolicy for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

ChangePassword

func (c *IAM) ChangePassword(input *ChangePasswordInput) (*ChangePasswordOutput, error)

ChangePassword API operation for AWS Identity and Access Management.

Changes the password of the IAM user who is calling this operation. The AWS account root user password is not affected by this operation.

To change the password for a different user, see UpdateLoginProfile. For more information about modifying passwords, see Managing Passwords (https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_ManagingLogins.html) in the IAM User Guide.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation ChangePassword for usage and error information.

Returned Error Codes:

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeInvalidUserTypeException "InvalidUserType" The request was rejected because the type of user for the transaction was incorrect.

  • ErrCodeLimitExceededException "LimitExceeded" The request was rejected because it attempted to create resources beyond the current AWS account limits. The error message describes the limit exceeded.

  • ErrCodeEntityTemporarilyUnmodifiableException "EntityTemporarilyUnmodifiable" The request was rejected because it referenced an entity that is temporarily unmodifiable, such as a user name that was deleted and then recreated. The error indicates that the request is likely to succeed if you try again after waiting several minutes. The error message describes the entity.

  • ErrCodePasswordPolicyViolationException "PasswordPolicyViolation" The request was rejected because the provided password did not meet the requirements imposed by the account password policy.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ChangePassword

Example

IAM ChangePassword shared00

To change the password for your IAM user

The following command changes the password for the current IAM user.

{ svc := iam.New(session.New()) input := &iam.ChangePasswordInput{ NewPassword: aws.String("]35d/{pB9Fo9wJ"), OldPassword: aws.String("3s0K_;xh4~8XXI"), } result, err := svc.ChangePassword(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case iam.ErrCodeNoSuchEntityException: fmt.Println(iam.ErrCodeNoSuchEntityException, aerr.Error()) case iam.ErrCodeInvalidUserTypeException: fmt.Println(iam.ErrCodeInvalidUserTypeException, aerr.Error()) case iam.ErrCodeLimitExceededException: fmt.Println(iam.ErrCodeLimitExceededException, aerr.Error()) case iam.ErrCodeEntityTemporarilyUnmodifiableException: fmt.Println(iam.ErrCodeEntityTemporarilyUnmodifiableException, aerr.Error()) case iam.ErrCodePasswordPolicyViolationException: fmt.Println(iam.ErrCodePasswordPolicyViolationException, aerr.Error()) case iam.ErrCodeServiceFailureException: fmt.Println(iam.ErrCodeServiceFailureException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

ChangePasswordRequest

func (c *IAM) ChangePasswordRequest(input *ChangePasswordInput) (req *request.Request, output *ChangePasswordOutput)

ChangePasswordRequest generates a "aws/request.Request" representing the client's request for the ChangePassword operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See ChangePassword for more information on using the ChangePassword API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the ChangePasswordRequest method. req, resp := client.ChangePasswordRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ChangePassword

ChangePasswordWithContext

func (c *IAM) ChangePasswordWithContext(ctx aws.Context, input *ChangePasswordInput, opts ...request.Option) (*ChangePasswordOutput, error)

ChangePasswordWithContext is the same as ChangePassword with the addition of the ability to pass a context and additional request options.

See ChangePassword for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

CreateAccessKey

func (c *IAM) CreateAccessKey(input *CreateAccessKeyInput) (*CreateAccessKeyOutput, error)

CreateAccessKey API operation for AWS Identity and Access Management.

Creates a new AWS secret access key and corresponding AWS access key ID for the specified user. The default status for new keys is Active.

If you do not specify a user name, IAM determines the user name implicitly based on the AWS access key ID signing the request. This operation works for access keys under the AWS account. Consequently, you can use this operation to manage AWS account root user credentials. This is true even if the AWS account has no associated users.

For information about limits on the number of keys you can create, see Limitations on IAM Entities (https://docs.aws.amazon.com/IAM/latest/UserGuide/LimitationsOnEntities.html) in the IAM User Guide.

To ensure the security of your AWS account, the secret access key is accessible only during key and user creation. You must save the key (for example, in a text file) if you want to be able to access it again. If a secret key is lost, you can delete the access keys for the associated user and then create new keys.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation CreateAccessKey for usage and error information.

Returned Error Codes:

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeLimitExceededException "LimitExceeded" The request was rejected because it attempted to create resources beyond the current AWS account limits. The error message describes the limit exceeded.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateAccessKey

Example

IAM CreateAccessKey shared00

To create an access key for an IAM user

The following command creates an access key (access key ID and secret access key) for the IAM user named Bob.

{ svc := iam.New(session.New()) input := &iam.CreateAccessKeyInput{ UserName: aws.String("Bob"), } result, err := svc.CreateAccessKey(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case iam.ErrCodeNoSuchEntityException: fmt.Println(iam.ErrCodeNoSuchEntityException, aerr.Error()) case iam.ErrCodeLimitExceededException: fmt.Println(iam.ErrCodeLimitExceededException, aerr.Error()) case iam.ErrCodeServiceFailureException: fmt.Println(iam.ErrCodeServiceFailureException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

CreateAccessKeyRequest

func (c *IAM) CreateAccessKeyRequest(input *CreateAccessKeyInput) (req *request.Request, output *CreateAccessKeyOutput)

CreateAccessKeyRequest generates a "aws/request.Request" representing the client's request for the CreateAccessKey operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See CreateAccessKey for more information on using the CreateAccessKey API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the CreateAccessKeyRequest method. req, resp := client.CreateAccessKeyRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateAccessKey

CreateAccessKeyWithContext

func (c *IAM) CreateAccessKeyWithContext(ctx aws.Context, input *CreateAccessKeyInput, opts ...request.Option) (*CreateAccessKeyOutput, error)

CreateAccessKeyWithContext is the same as CreateAccessKey with the addition of the ability to pass a context and additional request options.

See CreateAccessKey for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

CreateAccountAlias

func (c *IAM) CreateAccountAlias(input *CreateAccountAliasInput) (*CreateAccountAliasOutput, error)

CreateAccountAlias API operation for AWS Identity and Access Management.

Creates an alias for your AWS account. For information about using an AWS account alias, see Using an Alias for Your AWS Account ID (https://docs.aws.amazon.com/IAM/latest/UserGuide/AccountAlias.html) in the IAM User Guide.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation CreateAccountAlias for usage and error information.

Returned Error Codes:

  • ErrCodeEntityAlreadyExistsException "EntityAlreadyExists" The request was rejected because it attempted to create a resource that already exists.

  • ErrCodeLimitExceededException "LimitExceeded" The request was rejected because it attempted to create resources beyond the current AWS account limits. The error message describes the limit exceeded.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateAccountAlias

Example

IAM CreateAccountAlias shared00

To create an account alias

The following command associates the alias examplecorp to your AWS account.

{ svc := iam.New(session.New()) input := &iam.CreateAccountAliasInput{ AccountAlias: aws.String("examplecorp"), } result, err := svc.CreateAccountAlias(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case iam.ErrCodeEntityAlreadyExistsException: fmt.Println(iam.ErrCodeEntityAlreadyExistsException, aerr.Error()) case iam.ErrCodeLimitExceededException: fmt.Println(iam.ErrCodeLimitExceededException, aerr.Error()) case iam.ErrCodeServiceFailureException: fmt.Println(iam.ErrCodeServiceFailureException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

CreateAccountAliasRequest

func (c *IAM) CreateAccountAliasRequest(input *CreateAccountAliasInput) (req *request.Request, output *CreateAccountAliasOutput)

CreateAccountAliasRequest generates a "aws/request.Request" representing the client's request for the CreateAccountAlias operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See CreateAccountAlias for more information on using the CreateAccountAlias API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the CreateAccountAliasRequest method. req, resp := client.CreateAccountAliasRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateAccountAlias

CreateAccountAliasWithContext

func (c *IAM) CreateAccountAliasWithContext(ctx aws.Context, input *CreateAccountAliasInput, opts ...request.Option) (*CreateAccountAliasOutput, error)

CreateAccountAliasWithContext is the same as CreateAccountAlias with the addition of the ability to pass a context and additional request options.

See CreateAccountAlias for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

CreateGroup

func (c *IAM) CreateGroup(input *CreateGroupInput) (*CreateGroupOutput, error)

CreateGroup API operation for AWS Identity and Access Management.

Creates a new group.

For information about the number of groups you can create, see Limitations on IAM Entities (https://docs.aws.amazon.com/IAM/latest/UserGuide/LimitationsOnEntities.html) in the IAM User Guide.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation CreateGroup for usage and error information.

Returned Error Codes:

  • ErrCodeLimitExceededException "LimitExceeded" The request was rejected because it attempted to create resources beyond the current AWS account limits. The error message describes the limit exceeded.

  • ErrCodeEntityAlreadyExistsException "EntityAlreadyExists" The request was rejected because it attempted to create a resource that already exists.

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateGroup

Example

IAM CreateGroup shared00

To create an IAM group

The following command creates an IAM group named Admins.

{ svc := iam.New(session.New()) input := &iam.CreateGroupInput{ GroupName: aws.String("Admins"), } result, err := svc.CreateGroup(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case iam.ErrCodeLimitExceededException: fmt.Println(iam.ErrCodeLimitExceededException, aerr.Error()) case iam.ErrCodeEntityAlreadyExistsException: fmt.Println(iam.ErrCodeEntityAlreadyExistsException, aerr.Error()) case iam.ErrCodeNoSuchEntityException: fmt.Println(iam.ErrCodeNoSuchEntityException, aerr.Error()) case iam.ErrCodeServiceFailureException: fmt.Println(iam.ErrCodeServiceFailureException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

CreateGroupRequest

func (c *IAM) CreateGroupRequest(input *CreateGroupInput) (req *request.Request, output *CreateGroupOutput)

CreateGroupRequest generates a "aws/request.Request" representing the client's request for the CreateGroup operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See CreateGroup for more information on using the CreateGroup API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the CreateGroupRequest method. req, resp := client.CreateGroupRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateGroup

CreateGroupWithContext

func (c *IAM) CreateGroupWithContext(ctx aws.Context, input *CreateGroupInput, opts ...request.Option) (*CreateGroupOutput, error)

CreateGroupWithContext is the same as CreateGroup with the addition of the ability to pass a context and additional request options.

See CreateGroup for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

CreateInstanceProfile

func (c *IAM) CreateInstanceProfile(input *CreateInstanceProfileInput) (*CreateInstanceProfileOutput, error)

CreateInstanceProfile API operation for AWS Identity and Access Management.

Creates a new instance profile. For information about instance profiles, go to About Instance Profiles (https://docs.aws.amazon.com/IAM/latest/UserGuide/AboutInstanceProfiles.html).

For information about the number of instance profiles you can create, see Limitations on IAM Entities (https://docs.aws.amazon.com/IAM/latest/UserGuide/LimitationsOnEntities.html) in the IAM User Guide.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation CreateInstanceProfile for usage and error information.

Returned Error Codes:

  • ErrCodeEntityAlreadyExistsException "EntityAlreadyExists" The request was rejected because it attempted to create a resource that already exists.

  • ErrCodeLimitExceededException "LimitExceeded" The request was rejected because it attempted to create resources beyond the current AWS account limits. The error message describes the limit exceeded.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateInstanceProfile

Example

IAM CreateInstanceProfile shared00

To create an instance profile

The following command creates an instance profile named Webserver that is ready to have a role attached and then be associated with an EC2 instance.

{ svc := iam.New(session.New()) input := &iam.CreateInstanceProfileInput{ InstanceProfileName: aws.String("Webserver"), } result, err := svc.CreateInstanceProfile(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case iam.ErrCodeEntityAlreadyExistsException: fmt.Println(iam.ErrCodeEntityAlreadyExistsException, aerr.Error()) case iam.ErrCodeLimitExceededException: fmt.Println(iam.ErrCodeLimitExceededException, aerr.Error()) case iam.ErrCodeServiceFailureException: fmt.Println(iam.ErrCodeServiceFailureException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

CreateInstanceProfileRequest

func (c *IAM) CreateInstanceProfileRequest(input *CreateInstanceProfileInput) (req *request.Request, output *CreateInstanceProfileOutput)

CreateInstanceProfileRequest generates a "aws/request.Request" representing the client's request for the CreateInstanceProfile operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See CreateInstanceProfile for more information on using the CreateInstanceProfile API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the CreateInstanceProfileRequest method. req, resp := client.CreateInstanceProfileRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateInstanceProfile

CreateInstanceProfileWithContext

func (c *IAM) CreateInstanceProfileWithContext(ctx aws.Context, input *CreateInstanceProfileInput, opts ...request.Option) (*CreateInstanceProfileOutput, error)

CreateInstanceProfileWithContext is the same as CreateInstanceProfile with the addition of the ability to pass a context and additional request options.

See CreateInstanceProfile for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

CreateLoginProfile

func (c *IAM) CreateLoginProfile(input *CreateLoginProfileInput) (*CreateLoginProfileOutput, error)

CreateLoginProfile API operation for AWS Identity and Access Management.

Creates a password for the specified user, giving the user the ability to access AWS services through the AWS Management Console. For more information about managing passwords, see Managing Passwords (https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_ManagingLogins.html) in the IAM User Guide.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation CreateLoginProfile for usage and error information.

Returned Error Codes:

  • ErrCodeEntityAlreadyExistsException "EntityAlreadyExists" The request was rejected because it attempted to create a resource that already exists.

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodePasswordPolicyViolationException "PasswordPolicyViolation" The request was rejected because the provided password did not meet the requirements imposed by the account password policy.

  • ErrCodeLimitExceededException "LimitExceeded" The request was rejected because it attempted to create resources beyond the current AWS account limits. The error message describes the limit exceeded.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateLoginProfile

Example

IAM CreateLoginProfile shared00

To create an instance profile

The following command changes IAM user Bob's password and sets the flag that required Bob to change the password the next time he signs in.

{ svc := iam.New(session.New()) input := &iam.CreateLoginProfileInput{ Password: aws.String("h]6EszR}vJ*m"), PasswordResetRequired: aws.Bool(true), UserName: aws.String("Bob"), } result, err := svc.CreateLoginProfile(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case iam.ErrCodeEntityAlreadyExistsException: fmt.Println(iam.ErrCodeEntityAlreadyExistsException, aerr.Error()) case iam.ErrCodeNoSuchEntityException: fmt.Println(iam.ErrCodeNoSuchEntityException, aerr.Error()) case iam.ErrCodePasswordPolicyViolationException: fmt.Println(iam.ErrCodePasswordPolicyViolationException, aerr.Error()) case iam.ErrCodeLimitExceededException: fmt.Println(iam.ErrCodeLimitExceededException, aerr.Error()) case iam.ErrCodeServiceFailureException: fmt.Println(iam.ErrCodeServiceFailureException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

CreateLoginProfileRequest

func (c *IAM) CreateLoginProfileRequest(input *CreateLoginProfileInput) (req *request.Request, output *CreateLoginProfileOutput)

CreateLoginProfileRequest generates a "aws/request.Request" representing the client's request for the CreateLoginProfile operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See CreateLoginProfile for more information on using the CreateLoginProfile API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the CreateLoginProfileRequest method. req, resp := client.CreateLoginProfileRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateLoginProfile

CreateLoginProfileWithContext

func (c *IAM) CreateLoginProfileWithContext(ctx aws.Context, input *CreateLoginProfileInput, opts ...request.Option) (*CreateLoginProfileOutput, error)

CreateLoginProfileWithContext is the same as CreateLoginProfile with the addition of the ability to pass a context and additional request options.

See CreateLoginProfile for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

CreateOpenIDConnectProvider

func (c *IAM) CreateOpenIDConnectProvider(input *CreateOpenIDConnectProviderInput) (*CreateOpenIDConnectProviderOutput, error)

CreateOpenIDConnectProvider API operation for AWS Identity and Access Management.

Creates an IAM entity to describe an identity provider (IdP) that supports OpenID Connect (OIDC) (http://openid.net/connect/).

The OIDC provider that you create with this operation can be used as a principal in a role's trust policy. Such a policy establishes a trust relationship between AWS and the OIDC provider.

When you create the IAM OIDC provider, you specify the following:

  • The URL of the OIDC identity provider (IdP) to trust

  • A list of client IDs (also known as audiences) that identify the application or applications that are allowed to authenticate using the OIDC provider

  • A list of thumbprints of the server certificate(s) that the IdP uses.

You get all of this information from the OIDC IdP that you want to use to access AWS.

Because trust for the OIDC provider is derived from the IAM provider that this operation creates, it is best to limit access to the CreateOpenIDConnectProvider operation to highly privileged users.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation CreateOpenIDConnectProvider for usage and error information.

Returned Error Codes:

  • ErrCodeInvalidInputException "InvalidInput" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

  • ErrCodeEntityAlreadyExistsException "EntityAlreadyExists" The request was rejected because it attempted to create a resource that already exists.

  • ErrCodeLimitExceededException "LimitExceeded" The request was rejected because it attempted to create resources beyond the current AWS account limits. The error message describes the limit exceeded.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateOpenIDConnectProvider

Example

IAM CreateOpenIDConnectProvider shared00

To create an instance profile

The following example defines a new OIDC provider in IAM with a client ID of my-application-id and pointing at the server with a URL of https://server.example.com.

{ svc := iam.New(session.New()) input := &iam.CreateOpenIDConnectProviderInput{ ClientIDList: []*string{ aws.String("my-application-id"), }, ThumbprintList: []*string{ aws.String("3768084dfb3d2b68b7897bf5f565da8efEXAMPLE"), }, Url: aws.String("https://server.example.com"), } result, err := svc.CreateOpenIDConnectProvider(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case iam.ErrCodeInvalidInputException: fmt.Println(iam.ErrCodeInvalidInputException, aerr.Error()) case iam.ErrCodeEntityAlreadyExistsException: fmt.Println(iam.ErrCodeEntityAlreadyExistsException, aerr.Error()) case iam.ErrCodeLimitExceededException: fmt.Println(iam.ErrCodeLimitExceededException, aerr.Error()) case iam.ErrCodeServiceFailureException: fmt.Println(iam.ErrCodeServiceFailureException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

CreateOpenIDConnectProviderRequest

func (c *IAM) CreateOpenIDConnectProviderRequest(input *CreateOpenIDConnectProviderInput) (req *request.Request, output *CreateOpenIDConnectProviderOutput)

CreateOpenIDConnectProviderRequest generates a "aws/request.Request" representing the client's request for the CreateOpenIDConnectProvider operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See CreateOpenIDConnectProvider for more information on using the CreateOpenIDConnectProvider API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the CreateOpenIDConnectProviderRequest method. req, resp := client.CreateOpenIDConnectProviderRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateOpenIDConnectProvider

CreateOpenIDConnectProviderWithContext

func (c *IAM) CreateOpenIDConnectProviderWithContext(ctx aws.Context, input *CreateOpenIDConnectProviderInput, opts ...request.Option) (*CreateOpenIDConnectProviderOutput, error)

CreateOpenIDConnectProviderWithContext is the same as CreateOpenIDConnectProvider with the addition of the ability to pass a context and additional request options.

See CreateOpenIDConnectProvider for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

CreatePolicy

func (c *IAM) CreatePolicy(input *CreatePolicyInput) (*CreatePolicyOutput, error)

CreatePolicy API operation for AWS Identity and Access Management.

Creates a new managed policy for your AWS account.

This operation creates a policy version with a version identifier of v1 and sets v1 as the policy's default version. For more information about policy versions, see Versioning for Managed Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-versions.html) in the IAM User Guide.

For more information about managed policies in general, see Managed Policies and Inline Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) in the IAM User Guide.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation CreatePolicy for usage and error information.

Returned Error Codes:

  • ErrCodeInvalidInputException "InvalidInput" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

  • ErrCodeLimitExceededException "LimitExceeded" The request was rejected because it attempted to create resources beyond the current AWS account limits. The error message describes the limit exceeded.

  • ErrCodeEntityAlreadyExistsException "EntityAlreadyExists" The request was rejected because it attempted to create a resource that already exists.

  • ErrCodeMalformedPolicyDocumentException "MalformedPolicyDocument" The request was rejected because the policy document was malformed. The error message describes the specific error.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreatePolicy

CreatePolicyRequest

func (c *IAM) CreatePolicyRequest(input *CreatePolicyInput) (req *request.Request, output *CreatePolicyOutput)

CreatePolicyRequest generates a "aws/request.Request" representing the client's request for the CreatePolicy operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See CreatePolicy for more information on using the CreatePolicy API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the CreatePolicyRequest method. req, resp := client.CreatePolicyRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreatePolicy

CreatePolicyVersion

func (c *IAM) CreatePolicyVersion(input *CreatePolicyVersionInput) (*CreatePolicyVersionOutput, error)

CreatePolicyVersion API operation for AWS Identity and Access Management.

Creates a new version of the specified managed policy. To update a managed policy, you create a new policy version. A managed policy can have up to five versions. If the policy has five versions, you must delete an existing version using DeletePolicyVersion before you create a new version.

Optionally, you can set the new version as the policy's default version. The default version is the version that is in effect for the IAM users, groups, and roles to which the policy is attached.

For more information about managed policy versions, see Versioning for Managed Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-versions.html) in the IAM User Guide.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation CreatePolicyVersion for usage and error information.

Returned Error Codes:

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeMalformedPolicyDocumentException "MalformedPolicyDocument" The request was rejected because the policy document was malformed. The error message describes the specific error.

  • ErrCodeInvalidInputException "InvalidInput" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

  • ErrCodeLimitExceededException "LimitExceeded" The request was rejected because it attempted to create resources beyond the current AWS account limits. The error message describes the limit exceeded.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreatePolicyVersion

CreatePolicyVersionRequest

func (c *IAM) CreatePolicyVersionRequest(input *CreatePolicyVersionInput) (req *request.Request, output *CreatePolicyVersionOutput)

CreatePolicyVersionRequest generates a "aws/request.Request" representing the client's request for the CreatePolicyVersion operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See CreatePolicyVersion for more information on using the CreatePolicyVersion API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the CreatePolicyVersionRequest method. req, resp := client.CreatePolicyVersionRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreatePolicyVersion

CreatePolicyVersionWithContext

func (c *IAM) CreatePolicyVersionWithContext(ctx aws.Context, input *CreatePolicyVersionInput, opts ...request.Option) (*CreatePolicyVersionOutput, error)

CreatePolicyVersionWithContext is the same as CreatePolicyVersion with the addition of the ability to pass a context and additional request options.

See CreatePolicyVersion for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

CreatePolicyWithContext

func (c *IAM) CreatePolicyWithContext(ctx aws.Context, input *CreatePolicyInput, opts ...request.Option) (*CreatePolicyOutput, error)

CreatePolicyWithContext is the same as CreatePolicy with the addition of the ability to pass a context and additional request options.

See CreatePolicy for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

CreateRole

func (c *IAM) CreateRole(input *CreateRoleInput) (*CreateRoleOutput, error)

CreateRole API operation for AWS Identity and Access Management.

Creates a new role for your AWS account. For more information about roles, go to IAM Roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/WorkingWithRoles.html). For information about limitations on role names and the number of roles you can create, go to Limitations on IAM Entities (https://docs.aws.amazon.com/IAM/latest/UserGuide/LimitationsOnEntities.html) in the IAM User Guide.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation CreateRole for usage and error information.

Returned Error Codes:

  • ErrCodeLimitExceededException "LimitExceeded" The request was rejected because it attempted to create resources beyond the current AWS account limits. The error message describes the limit exceeded.

  • ErrCodeInvalidInputException "InvalidInput" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

  • ErrCodeEntityAlreadyExistsException "EntityAlreadyExists" The request was rejected because it attempted to create a resource that already exists.

  • ErrCodeMalformedPolicyDocumentException "MalformedPolicyDocument" The request was rejected because the policy document was malformed. The error message describes the specific error.

  • ErrCodeConcurrentModificationException "ConcurrentModification" The request was rejected because multiple requests to change this object were submitted simultaneously. Wait a few minutes and submit your request again.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateRole

Example

IAM CreateRole shared00

To create an IAM role

The following command creates a role named Test-Role and attaches a trust policy to it that is provided as a URL-encoded JSON string.

{ svc := iam.New(session.New()) input := &iam.CreateRoleInput{ AssumeRolePolicyDocument: aws.String("<URL-encoded-JSON>"), Path: aws.String("/"), RoleName: aws.String("Test-Role"), } result, err := svc.CreateRole(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case iam.ErrCodeLimitExceededException: fmt.Println(iam.ErrCodeLimitExceededException, aerr.Error()) case iam.ErrCodeInvalidInputException: fmt.Println(iam.ErrCodeInvalidInputException, aerr.Error()) case iam.ErrCodeEntityAlreadyExistsException: fmt.Println(iam.ErrCodeEntityAlreadyExistsException, aerr.Error()) case iam.ErrCodeMalformedPolicyDocumentException: fmt.Println(iam.ErrCodeMalformedPolicyDocumentException, aerr.Error()) case iam.ErrCodeConcurrentModificationException: fmt.Println(iam.ErrCodeConcurrentModificationException, aerr.Error()) case iam.ErrCodeServiceFailureException: fmt.Println(iam.ErrCodeServiceFailureException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

CreateRoleRequest

func (c *IAM) CreateRoleRequest(input *CreateRoleInput) (req *request.Request, output *CreateRoleOutput)

CreateRoleRequest generates a "aws/request.Request" representing the client's request for the CreateRole operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See CreateRole for more information on using the CreateRole API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the CreateRoleRequest method. req, resp := client.CreateRoleRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateRole

CreateRoleWithContext

func (c *IAM) CreateRoleWithContext(ctx aws.Context, input *CreateRoleInput, opts ...request.Option) (*CreateRoleOutput, error)

CreateRoleWithContext is the same as CreateRole with the addition of the ability to pass a context and additional request options.

See CreateRole for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

CreateSAMLProvider

func (c *IAM) CreateSAMLProvider(input *CreateSAMLProviderInput) (*CreateSAMLProviderOutput, error)

CreateSAMLProvider API operation for AWS Identity and Access Management.

Creates an IAM resource that describes an identity provider (IdP) that supports SAML 2.0.

The SAML provider resource that you create with this operation can be used as a principal in an IAM role's trust policy. Such a policy can enable federated users who sign-in using the SAML IdP to assume the role. You can create an IAM role that supports Web-based single sign-on (SSO) to the AWS Management Console or one that supports API access to AWS.

When you create the SAML provider resource, you upload a SAML metadata document that you get from your IdP. That document includes the issuer's name, expiration information, and keys that can be used to validate the SAML authentication response (assertions) that the IdP sends. You must generate the metadata document using the identity management software that is used as your organization's IdP.

This operation requires Signature Version 4 (https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html).

For more information, see Enabling SAML 2.0 Federated Users to Access the AWS Management Console (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-saml.html) and About SAML 2.0-based Federation (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_saml.html) in the IAM User Guide.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation CreateSAMLProvider for usage and error information.

Returned Error Codes:

  • ErrCodeInvalidInputException "InvalidInput" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

  • ErrCodeEntityAlreadyExistsException "EntityAlreadyExists" The request was rejected because it attempted to create a resource that already exists.

  • ErrCodeLimitExceededException "LimitExceeded" The request was rejected because it attempted to create resources beyond the current AWS account limits. The error message describes the limit exceeded.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateSAMLProvider

CreateSAMLProviderRequest

func (c *IAM) CreateSAMLProviderRequest(input *CreateSAMLProviderInput) (req *request.Request, output *CreateSAMLProviderOutput)

CreateSAMLProviderRequest generates a "aws/request.Request" representing the client's request for the CreateSAMLProvider operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See CreateSAMLProvider for more information on using the CreateSAMLProvider API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the CreateSAMLProviderRequest method. req, resp := client.CreateSAMLProviderRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateSAMLProvider

CreateSAMLProviderWithContext

func (c *IAM) CreateSAMLProviderWithContext(ctx aws.Context, input *CreateSAMLProviderInput, opts ...request.Option) (*CreateSAMLProviderOutput, error)

CreateSAMLProviderWithContext is the same as CreateSAMLProvider with the addition of the ability to pass a context and additional request options.

See CreateSAMLProvider for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

CreateServiceLinkedRole

func (c *IAM) CreateServiceLinkedRole(input *CreateServiceLinkedRoleInput) (*CreateServiceLinkedRoleOutput, error)

CreateServiceLinkedRole API operation for AWS Identity and Access Management.

Creates an IAM role that is linked to a specific AWS service. The service controls the attached policies and when the role can be deleted. This helps ensure that the service is not broken by an unexpectedly changed or deleted role, which could put your AWS resources into an unknown state. Allowing the service to control the role helps improve service stability and proper cleanup when a service and its role are no longer needed. For more information, see Using Service-Linked Roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/using-service-linked-roles.html) in the IAM User Guide.

To attach a policy to this service-linked role, you must make the request using the AWS service that depends on this role.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation CreateServiceLinkedRole for usage and error information.

Returned Error Codes:

  • ErrCodeInvalidInputException "InvalidInput" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

  • ErrCodeLimitExceededException "LimitExceeded" The request was rejected because it attempted to create resources beyond the current AWS account limits. The error message describes the limit exceeded.

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateServiceLinkedRole

CreateServiceLinkedRoleRequest

func (c *IAM) CreateServiceLinkedRoleRequest(input *CreateServiceLinkedRoleInput) (req *request.Request, output *CreateServiceLinkedRoleOutput)

CreateServiceLinkedRoleRequest generates a "aws/request.Request" representing the client's request for the CreateServiceLinkedRole operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See CreateServiceLinkedRole for more information on using the CreateServiceLinkedRole API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the CreateServiceLinkedRoleRequest method. req, resp := client.CreateServiceLinkedRoleRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateServiceLinkedRole

CreateServiceLinkedRoleWithContext

func (c *IAM) CreateServiceLinkedRoleWithContext(ctx aws.Context, input *CreateServiceLinkedRoleInput, opts ...request.Option) (*CreateServiceLinkedRoleOutput, error)

CreateServiceLinkedRoleWithContext is the same as CreateServiceLinkedRole with the addition of the ability to pass a context and additional request options.

See CreateServiceLinkedRole for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

CreateServiceSpecificCredential

func (c *IAM) CreateServiceSpecificCredential(input *CreateServiceSpecificCredentialInput) (*CreateServiceSpecificCredentialOutput, error)

CreateServiceSpecificCredential API operation for AWS Identity and Access Management.

Generates a set of credentials consisting of a user name and password that can be used to access the service specified in the request. These credentials are generated by IAM, and can be used only for the specified service.

You can have a maximum of two sets of service-specific credentials for each supported service per user.

The only supported service at this time is AWS CodeCommit.

You can reset the password to a new service-generated value by calling ResetServiceSpecificCredential.

For more information about service-specific credentials, see Using IAM with AWS CodeCommit: Git Credentials, SSH Keys, and AWS Access Keys (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_ssh-keys.html) in the IAM User Guide.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation CreateServiceSpecificCredential for usage and error information.

Returned Error Codes:

  • ErrCodeLimitExceededException "LimitExceeded" The request was rejected because it attempted to create resources beyond the current AWS account limits. The error message describes the limit exceeded.

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeServiceNotSupportedException "NotSupportedService" The specified service does not support service-specific credentials.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateServiceSpecificCredential

CreateServiceSpecificCredentialRequest

func (c *IAM) CreateServiceSpecificCredentialRequest(input *CreateServiceSpecificCredentialInput) (req *request.Request, output *CreateServiceSpecificCredentialOutput)

CreateServiceSpecificCredentialRequest generates a "aws/request.Request" representing the client's request for the CreateServiceSpecificCredential operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See CreateServiceSpecificCredential for more information on using the CreateServiceSpecificCredential API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the CreateServiceSpecificCredentialRequest method. req, resp := client.CreateServiceSpecificCredentialRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateServiceSpecificCredential

CreateServiceSpecificCredentialWithContext

func (c *IAM) CreateServiceSpecificCredentialWithContext(ctx aws.Context, input *CreateServiceSpecificCredentialInput, opts ...request.Option) (*CreateServiceSpecificCredentialOutput, error)

CreateServiceSpecificCredentialWithContext is the same as CreateServiceSpecificCredential with the addition of the ability to pass a context and additional request options.

See CreateServiceSpecificCredential for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

CreateUser

func (c *IAM) CreateUser(input *CreateUserInput) (*CreateUserOutput, error)

CreateUser API operation for AWS Identity and Access Management.

Creates a new IAM user for your AWS account.

For information about limitations on the number of IAM users you can create, see Limitations on IAM Entities (https://docs.aws.amazon.com/IAM/latest/UserGuide/LimitationsOnEntities.html) in the IAM User Guide.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation CreateUser for usage and error information.

Returned Error Codes:

  • ErrCodeLimitExceededException "LimitExceeded" The request was rejected because it attempted to create resources beyond the current AWS account limits. The error message describes the limit exceeded.

  • ErrCodeEntityAlreadyExistsException "EntityAlreadyExists" The request was rejected because it attempted to create a resource that already exists.

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeInvalidInputException "InvalidInput" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

  • ErrCodeConcurrentModificationException "ConcurrentModification" The request was rejected because multiple requests to change this object were submitted simultaneously. Wait a few minutes and submit your request again.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateUser

Example

IAM CreateUser shared00

To create an IAM user

The following create-user command creates an IAM user named Bob in the current account.

{ svc := iam.New(session.New()) input := &iam.CreateUserInput{ UserName: aws.String("Bob"), } result, err := svc.CreateUser(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case iam.ErrCodeLimitExceededException: fmt.Println(iam.ErrCodeLimitExceededException, aerr.Error()) case iam.ErrCodeEntityAlreadyExistsException: fmt.Println(iam.ErrCodeEntityAlreadyExistsException, aerr.Error()) case iam.ErrCodeNoSuchEntityException: fmt.Println(iam.ErrCodeNoSuchEntityException, aerr.Error()) case iam.ErrCodeInvalidInputException: fmt.Println(iam.ErrCodeInvalidInputException, aerr.Error()) case iam.ErrCodeConcurrentModificationException: fmt.Println(iam.ErrCodeConcurrentModificationException, aerr.Error()) case iam.ErrCodeServiceFailureException: fmt.Println(iam.ErrCodeServiceFailureException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

CreateUserRequest

func (c *IAM) CreateUserRequest(input *CreateUserInput) (req *request.Request, output *CreateUserOutput)

CreateUserRequest generates a "aws/request.Request" representing the client's request for the CreateUser operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See CreateUser for more information on using the CreateUser API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the CreateUserRequest method. req, resp := client.CreateUserRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateUser

CreateUserWithContext

func (c *IAM) CreateUserWithContext(ctx aws.Context, input *CreateUserInput, opts ...request.Option) (*CreateUserOutput, error)

CreateUserWithContext is the same as CreateUser with the addition of the ability to pass a context and additional request options.

See CreateUser for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

CreateVirtualMFADevice

func (c *IAM) CreateVirtualMFADevice(input *CreateVirtualMFADeviceInput) (*CreateVirtualMFADeviceOutput, error)

CreateVirtualMFADevice API operation for AWS Identity and Access Management.

Creates a new virtual MFA device for the AWS account. After creating the virtual MFA, use EnableMFADevice to attach the MFA device to an IAM user. For more information about creating and working with virtual MFA devices, go to Using a Virtual MFA Device (https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_VirtualMFA.html) in the IAM User Guide.

For information about limits on the number of MFA devices you can create, see Limitations on Entities (https://docs.aws.amazon.com/IAM/latest/UserGuide/LimitationsOnEntities.html) in the IAM User Guide.

The seed information contained in the QR code and the Base32 string should be treated like any other secret access information, such as your AWS access keys or your passwords. After you provision your virtual device, you should ensure that the information is destroyed following secure procedures.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation CreateVirtualMFADevice for usage and error information.

Returned Error Codes:

  • ErrCodeLimitExceededException "LimitExceeded" The request was rejected because it attempted to create resources beyond the current AWS account limits. The error message describes the limit exceeded.

  • ErrCodeEntityAlreadyExistsException "EntityAlreadyExists" The request was rejected because it attempted to create a resource that already exists.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateVirtualMFADevice

CreateVirtualMFADeviceRequest

func (c *IAM) CreateVirtualMFADeviceRequest(input *CreateVirtualMFADeviceInput) (req *request.Request, output *CreateVirtualMFADeviceOutput)

CreateVirtualMFADeviceRequest generates a "aws/request.Request" representing the client's request for the CreateVirtualMFADevice operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See CreateVirtualMFADevice for more information on using the CreateVirtualMFADevice API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the CreateVirtualMFADeviceRequest method. req, resp := client.CreateVirtualMFADeviceRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/CreateVirtualMFADevice

CreateVirtualMFADeviceWithContext

func (c *IAM) CreateVirtualMFADeviceWithContext(ctx aws.Context, input *CreateVirtualMFADeviceInput, opts ...request.Option) (*CreateVirtualMFADeviceOutput, error)

CreateVirtualMFADeviceWithContext is the same as CreateVirtualMFADevice with the addition of the ability to pass a context and additional request options.

See CreateVirtualMFADevice for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DeactivateMFADevice

func (c *IAM) DeactivateMFADevice(input *DeactivateMFADeviceInput) (*DeactivateMFADeviceOutput, error)

DeactivateMFADevice API operation for AWS Identity and Access Management.

Deactivates the specified MFA device and removes it from association with the user name for which it was originally enabled.

For more information about creating and working with virtual MFA devices, go to Enabling a Virtual Multi-factor Authentication (MFA) Device (https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_VirtualMFA.html) in the IAM User Guide.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation DeactivateMFADevice for usage and error information.

Returned Error Codes:

  • ErrCodeEntityTemporarilyUnmodifiableException "EntityTemporarilyUnmodifiable" The request was rejected because it referenced an entity that is temporarily unmodifiable, such as a user name that was deleted and then recreated. The error indicates that the request is likely to succeed if you try again after waiting several minutes. The error message describes the entity.

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeLimitExceededException "LimitExceeded" The request was rejected because it attempted to create resources beyond the current AWS account limits. The error message describes the limit exceeded.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeactivateMFADevice

DeactivateMFADeviceRequest

func (c *IAM) DeactivateMFADeviceRequest(input *DeactivateMFADeviceInput) (req *request.Request, output *DeactivateMFADeviceOutput)

DeactivateMFADeviceRequest generates a "aws/request.Request" representing the client's request for the DeactivateMFADevice operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DeactivateMFADevice for more information on using the DeactivateMFADevice API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DeactivateMFADeviceRequest method. req, resp := client.DeactivateMFADeviceRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeactivateMFADevice

DeactivateMFADeviceWithContext

func (c *IAM) DeactivateMFADeviceWithContext(ctx aws.Context, input *DeactivateMFADeviceInput, opts ...request.Option) (*DeactivateMFADeviceOutput, error)

DeactivateMFADeviceWithContext is the same as DeactivateMFADevice with the addition of the ability to pass a context and additional request options.

See DeactivateMFADevice for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DeleteAccessKey

func (c *IAM) DeleteAccessKey(input *DeleteAccessKeyInput) (*DeleteAccessKeyOutput, error)

DeleteAccessKey API operation for AWS Identity and Access Management.

Deletes the access key pair associated with the specified IAM user.

If you do not specify a user name, IAM determines the user name implicitly based on the AWS access key ID signing the request. This operation works for access keys under the AWS account. Consequently, you can use this operation to manage AWS account root user credentials even if the AWS account has no associated users.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation DeleteAccessKey for usage and error information.

Returned Error Codes:

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeLimitExceededException "LimitExceeded" The request was rejected because it attempted to create resources beyond the current AWS account limits. The error message describes the limit exceeded.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteAccessKey

Example

IAM DeleteAccessKey shared00

To delete an access key for an IAM user

The following command deletes one access key (access key ID and secret access key) assigned to the IAM user named Bob.

{ svc := iam.New(session.New()) input := &iam.DeleteAccessKeyInput{ AccessKeyId: aws.String("AKIDPMS9RO4H3FEXAMPLE"), UserName: aws.String("Bob"), } result, err := svc.DeleteAccessKey(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case iam.ErrCodeNoSuchEntityException: fmt.Println(iam.ErrCodeNoSuchEntityException, aerr.Error()) case iam.ErrCodeLimitExceededException: fmt.Println(iam.ErrCodeLimitExceededException, aerr.Error()) case iam.ErrCodeServiceFailureException: fmt.Println(iam.ErrCodeServiceFailureException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

DeleteAccessKeyRequest

func (c *IAM) DeleteAccessKeyRequest(input *DeleteAccessKeyInput) (req *request.Request, output *DeleteAccessKeyOutput)

DeleteAccessKeyRequest generates a "aws/request.Request" representing the client's request for the DeleteAccessKey operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DeleteAccessKey for more information on using the DeleteAccessKey API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DeleteAccessKeyRequest method. req, resp := client.DeleteAccessKeyRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteAccessKey

DeleteAccessKeyWithContext

func (c *IAM) DeleteAccessKeyWithContext(ctx aws.Context, input *DeleteAccessKeyInput, opts ...request.Option) (*DeleteAccessKeyOutput, error)

DeleteAccessKeyWithContext is the same as DeleteAccessKey with the addition of the ability to pass a context and additional request options.

See DeleteAccessKey for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DeleteAccountAlias

func (c *IAM) DeleteAccountAlias(input *DeleteAccountAliasInput) (*DeleteAccountAliasOutput, error)

DeleteAccountAlias API operation for AWS Identity and Access Management.

Deletes the specified AWS account alias. For information about using an AWS account alias, see Using an Alias for Your AWS Account ID (https://docs.aws.amazon.com/IAM/latest/UserGuide/AccountAlias.html) in the IAM User Guide.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation DeleteAccountAlias for usage and error information.

Returned Error Codes:

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeLimitExceededException "LimitExceeded" The request was rejected because it attempted to create resources beyond the current AWS account limits. The error message describes the limit exceeded.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteAccountAlias

Example

IAM DeleteAccountAlias shared00

To delete an account alias

The following command removes the alias mycompany from the current AWS account:

{ svc := iam.New(session.New()) input := &iam.DeleteAccountAliasInput{ AccountAlias: aws.String("mycompany"), } result, err := svc.DeleteAccountAlias(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case iam.ErrCodeNoSuchEntityException: fmt.Println(iam.ErrCodeNoSuchEntityException, aerr.Error()) case iam.ErrCodeLimitExceededException: fmt.Println(iam.ErrCodeLimitExceededException, aerr.Error()) case iam.ErrCodeServiceFailureException: fmt.Println(iam.ErrCodeServiceFailureException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

DeleteAccountAliasRequest

func (c *IAM) DeleteAccountAliasRequest(input *DeleteAccountAliasInput) (req *request.Request, output *DeleteAccountAliasOutput)

DeleteAccountAliasRequest generates a "aws/request.Request" representing the client's request for the DeleteAccountAlias operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DeleteAccountAlias for more information on using the DeleteAccountAlias API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DeleteAccountAliasRequest method. req, resp := client.DeleteAccountAliasRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteAccountAlias

DeleteAccountAliasWithContext

func (c *IAM) DeleteAccountAliasWithContext(ctx aws.Context, input *DeleteAccountAliasInput, opts ...request.Option) (*DeleteAccountAliasOutput, error)

DeleteAccountAliasWithContext is the same as DeleteAccountAlias with the addition of the ability to pass a context and additional request options.

See DeleteAccountAlias for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DeleteAccountPasswordPolicy

func (c *IAM) DeleteAccountPasswordPolicy(input *DeleteAccountPasswordPolicyInput) (*DeleteAccountPasswordPolicyOutput, error)

DeleteAccountPasswordPolicy API operation for AWS Identity and Access Management.

Deletes the password policy for the AWS account. There are no parameters.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation DeleteAccountPasswordPolicy for usage and error information.

Returned Error Codes:

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeLimitExceededException "LimitExceeded" The request was rejected because it attempted to create resources beyond the current AWS account limits. The error message describes the limit exceeded.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteAccountPasswordPolicy

Example

IAM DeleteAccountPasswordPolicy shared00

To delete the current account password policy

The following command removes the password policy from the current AWS account:

{ svc := iam.New(session.New()) input := &iam.DeleteAccountPasswordPolicyInput{} result, err := svc.DeleteAccountPasswordPolicy(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case iam.ErrCodeNoSuchEntityException: fmt.Println(iam.ErrCodeNoSuchEntityException, aerr.Error()) case iam.ErrCodeLimitExceededException: fmt.Println(iam.ErrCodeLimitExceededException, aerr.Error()) case iam.ErrCodeServiceFailureException: fmt.Println(iam.ErrCodeServiceFailureException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

DeleteAccountPasswordPolicyRequest

func (c *IAM) DeleteAccountPasswordPolicyRequest(input *DeleteAccountPasswordPolicyInput) (req *request.Request, output *DeleteAccountPasswordPolicyOutput)

DeleteAccountPasswordPolicyRequest generates a "aws/request.Request" representing the client's request for the DeleteAccountPasswordPolicy operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DeleteAccountPasswordPolicy for more information on using the DeleteAccountPasswordPolicy API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DeleteAccountPasswordPolicyRequest method. req, resp := client.DeleteAccountPasswordPolicyRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteAccountPasswordPolicy

DeleteAccountPasswordPolicyWithContext

func (c *IAM) DeleteAccountPasswordPolicyWithContext(ctx aws.Context, input *DeleteAccountPasswordPolicyInput, opts ...request.Option) (*DeleteAccountPasswordPolicyOutput, error)

DeleteAccountPasswordPolicyWithContext is the same as DeleteAccountPasswordPolicy with the addition of the ability to pass a context and additional request options.

See DeleteAccountPasswordPolicy for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DeleteGroup

func (c *IAM) DeleteGroup(input *DeleteGroupInput) (*DeleteGroupOutput, error)

DeleteGroup API operation for AWS Identity and Access Management.

Deletes the specified IAM group. The group must not contain any users or have any attached policies.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation DeleteGroup for usage and error information.

Returned Error Codes:

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeDeleteConflictException "DeleteConflict" The request was rejected because it attempted to delete a resource that has attached subordinate entities. The error message describes these entities.

  • ErrCodeLimitExceededException "LimitExceeded" The request was rejected because it attempted to create resources beyond the current AWS account limits. The error message describes the limit exceeded.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteGroup

DeleteGroupPolicy

func (c *IAM) DeleteGroupPolicy(input *DeleteGroupPolicyInput) (*DeleteGroupPolicyOutput, error)

DeleteGroupPolicy API operation for AWS Identity and Access Management.

Deletes the specified inline policy that is embedded in the specified IAM group.

A group can also have managed policies attached to it. To detach a managed policy from a group, use DetachGroupPolicy. For more information about policies, refer to Managed Policies and Inline Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) in the IAM User Guide.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation DeleteGroupPolicy for usage and error information.

Returned Error Codes:

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeLimitExceededException "LimitExceeded" The request was rejected because it attempted to create resources beyond the current AWS account limits. The error message describes the limit exceeded.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteGroupPolicy

Example

IAM DeleteGroupPolicy shared00

To delete a policy from an IAM group

The following command deletes the policy named ExamplePolicy from the group named Admins:

{ svc := iam.New(session.New()) input := &iam.DeleteGroupPolicyInput{ GroupName: aws.String("Admins"), PolicyName: aws.String("ExamplePolicy"), } result, err := svc.DeleteGroupPolicy(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case iam.ErrCodeNoSuchEntityException: fmt.Println(iam.ErrCodeNoSuchEntityException, aerr.Error()) case iam.ErrCodeLimitExceededException: fmt.Println(iam.ErrCodeLimitExceededException, aerr.Error()) case iam.ErrCodeServiceFailureException: fmt.Println(iam.ErrCodeServiceFailureException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

DeleteGroupPolicyRequest

func (c *IAM) DeleteGroupPolicyRequest(input *DeleteGroupPolicyInput) (req *request.Request, output *DeleteGroupPolicyOutput)

DeleteGroupPolicyRequest generates a "aws/request.Request" representing the client's request for the DeleteGroupPolicy operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DeleteGroupPolicy for more information on using the DeleteGroupPolicy API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DeleteGroupPolicyRequest method. req, resp := client.DeleteGroupPolicyRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteGroupPolicy

DeleteGroupPolicyWithContext

func (c *IAM) DeleteGroupPolicyWithContext(ctx aws.Context, input *DeleteGroupPolicyInput, opts ...request.Option) (*DeleteGroupPolicyOutput, error)

DeleteGroupPolicyWithContext is the same as DeleteGroupPolicy with the addition of the ability to pass a context and additional request options.

See DeleteGroupPolicy for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DeleteGroupRequest

func (c *IAM) DeleteGroupRequest(input *DeleteGroupInput) (req *request.Request, output *DeleteGroupOutput)

DeleteGroupRequest generates a "aws/request.Request" representing the client's request for the DeleteGroup operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DeleteGroup for more information on using the DeleteGroup API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DeleteGroupRequest method. req, resp := client.DeleteGroupRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteGroup

DeleteGroupWithContext

func (c *IAM) DeleteGroupWithContext(ctx aws.Context, input *DeleteGroupInput, opts ...request.Option) (*DeleteGroupOutput, error)

DeleteGroupWithContext is the same as DeleteGroup with the addition of the ability to pass a context and additional request options.

See DeleteGroup for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DeleteInstanceProfile

func (c *IAM) DeleteInstanceProfile(input *DeleteInstanceProfileInput) (*DeleteInstanceProfileOutput, error)

DeleteInstanceProfile API operation for AWS Identity and Access Management.

Deletes the specified instance profile. The instance profile must not have an associated role.

Make sure that you do not have any Amazon EC2 instances running with the instance profile you are about to delete. Deleting a role or instance profile that is associated with a running instance will break any applications running on the instance.

For more information about instance profiles, go to About Instance Profiles (https://docs.aws.amazon.com/IAM/latest/UserGuide/AboutInstanceProfiles.html).

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation DeleteInstanceProfile for usage and error information.

Returned Error Codes:

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeDeleteConflictException "DeleteConflict" The request was rejected because it attempted to delete a resource that has attached subordinate entities. The error message describes these entities.

  • ErrCodeLimitExceededException "LimitExceeded" The request was rejected because it attempted to create resources beyond the current AWS account limits. The error message describes the limit exceeded.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteInstanceProfile

Example

IAM DeleteInstanceProfile shared00

To delete an instance profile

The following command deletes the instance profile named ExampleInstanceProfile

{ svc := iam.New(session.New()) input := &iam.DeleteInstanceProfileInput{ InstanceProfileName: aws.String("ExampleInstanceProfile"), } result, err := svc.DeleteInstanceProfile(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case iam.ErrCodeNoSuchEntityException: fmt.Println(iam.ErrCodeNoSuchEntityException, aerr.Error()) case iam.ErrCodeDeleteConflictException: fmt.Println(iam.ErrCodeDeleteConflictException, aerr.Error()) case iam.ErrCodeLimitExceededException: fmt.Println(iam.ErrCodeLimitExceededException, aerr.Error()) case iam.ErrCodeServiceFailureException: fmt.Println(iam.ErrCodeServiceFailureException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

DeleteInstanceProfileRequest

func (c *IAM) DeleteInstanceProfileRequest(input *DeleteInstanceProfileInput) (req *request.Request, output *DeleteInstanceProfileOutput)

DeleteInstanceProfileRequest generates a "aws/request.Request" representing the client's request for the DeleteInstanceProfile operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DeleteInstanceProfile for more information on using the DeleteInstanceProfile API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DeleteInstanceProfileRequest method. req, resp := client.DeleteInstanceProfileRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteInstanceProfile

DeleteInstanceProfileWithContext

func (c *IAM) DeleteInstanceProfileWithContext(ctx aws.Context, input *DeleteInstanceProfileInput, opts ...request.Option) (*DeleteInstanceProfileOutput, error)

DeleteInstanceProfileWithContext is the same as DeleteInstanceProfile with the addition of the ability to pass a context and additional request options.

See DeleteInstanceProfile for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DeleteLoginProfile

func (c *IAM) DeleteLoginProfile(input *DeleteLoginProfileInput) (*DeleteLoginProfileOutput, error)

DeleteLoginProfile API operation for AWS Identity and Access Management.

Deletes the password for the specified IAM user, which terminates the user's ability to access AWS services through the AWS Management Console.

Deleting a user's password does not prevent a user from accessing AWS through the command line interface or the API. To prevent all user access, you must also either make any access keys inactive or delete them. For more information about making keys inactive or deleting them, see UpdateAccessKey and DeleteAccessKey.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation DeleteLoginProfile for usage and error information.

Returned Error Codes:

  • ErrCodeEntityTemporarilyUnmodifiableException "EntityTemporarilyUnmodifiable" The request was rejected because it referenced an entity that is temporarily unmodifiable, such as a user name that was deleted and then recreated. The error indicates that the request is likely to succeed if you try again after waiting several minutes. The error message describes the entity.

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeLimitExceededException "LimitExceeded" The request was rejected because it attempted to create resources beyond the current AWS account limits. The error message describes the limit exceeded.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteLoginProfile

Example

IAM DeleteLoginProfile shared00

To delete a password for an IAM user

The following command deletes the password for the IAM user named Bob.

{ svc := iam.New(session.New()) input := &iam.DeleteLoginProfileInput{ UserName: aws.String("Bob"), } result, err := svc.DeleteLoginProfile(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case iam.ErrCodeEntityTemporarilyUnmodifiableException: fmt.Println(iam.ErrCodeEntityTemporarilyUnmodifiableException, aerr.Error()) case iam.ErrCodeNoSuchEntityException: fmt.Println(iam.ErrCodeNoSuchEntityException, aerr.Error()) case iam.ErrCodeLimitExceededException: fmt.Println(iam.ErrCodeLimitExceededException, aerr.Error()) case iam.ErrCodeServiceFailureException: fmt.Println(iam.ErrCodeServiceFailureException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

DeleteLoginProfileRequest

func (c *IAM) DeleteLoginProfileRequest(input *DeleteLoginProfileInput) (req *request.Request, output *DeleteLoginProfileOutput)

DeleteLoginProfileRequest generates a "aws/request.Request" representing the client's request for the DeleteLoginProfile operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DeleteLoginProfile for more information on using the DeleteLoginProfile API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DeleteLoginProfileRequest method. req, resp := client.DeleteLoginProfileRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteLoginProfile

DeleteLoginProfileWithContext

func (c *IAM) DeleteLoginProfileWithContext(ctx aws.Context, input *DeleteLoginProfileInput, opts ...request.Option) (*DeleteLoginProfileOutput, error)

DeleteLoginProfileWithContext is the same as DeleteLoginProfile with the addition of the ability to pass a context and additional request options.

See DeleteLoginProfile for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DeleteOpenIDConnectProvider

func (c *IAM) DeleteOpenIDConnectProvider(input *DeleteOpenIDConnectProviderInput) (*DeleteOpenIDConnectProviderOutput, error)

DeleteOpenIDConnectProvider API operation for AWS Identity and Access Management.

Deletes an OpenID Connect identity provider (IdP) resource object in IAM.

Deleting an IAM OIDC provider resource does not update any roles that reference the provider as a principal in their trust policies. Any attempt to assume a role that references a deleted provider fails.

This operation is idempotent; it does not fail or return an error if you call the operation for a provider that does not exist.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation DeleteOpenIDConnectProvider for usage and error information.

Returned Error Codes:

  • ErrCodeInvalidInputException "InvalidInput" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteOpenIDConnectProvider

DeleteOpenIDConnectProviderRequest

func (c *IAM) DeleteOpenIDConnectProviderRequest(input *DeleteOpenIDConnectProviderInput) (req *request.Request, output *DeleteOpenIDConnectProviderOutput)

DeleteOpenIDConnectProviderRequest generates a "aws/request.Request" representing the client's request for the DeleteOpenIDConnectProvider operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DeleteOpenIDConnectProvider for more information on using the DeleteOpenIDConnectProvider API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DeleteOpenIDConnectProviderRequest method. req, resp := client.DeleteOpenIDConnectProviderRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteOpenIDConnectProvider

DeleteOpenIDConnectProviderWithContext

func (c *IAM) DeleteOpenIDConnectProviderWithContext(ctx aws.Context, input *DeleteOpenIDConnectProviderInput, opts ...request.Option) (*DeleteOpenIDConnectProviderOutput, error)

DeleteOpenIDConnectProviderWithContext is the same as DeleteOpenIDConnectProvider with the addition of the ability to pass a context and additional request options.

See DeleteOpenIDConnectProvider for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DeletePolicy

func (c *IAM) DeletePolicy(input *DeletePolicyInput) (*DeletePolicyOutput, error)

DeletePolicy API operation for AWS Identity and Access Management.

Deletes the specified managed policy.

Before you can delete a managed policy, you must first detach the policy from all users, groups, and roles that it is attached to. In addition, you must delete all the policy's versions. The following steps describe the process for deleting a managed policy:

  • Detach the policy from all users, groups, and roles that the policy is attached to, using the DetachUserPolicy, DetachGroupPolicy, or DetachRolePolicy API operations. To list all the users, groups, and roles that a policy is attached to, use ListEntitiesForPolicy.

  • Delete all versions of the policy using DeletePolicyVersion. To list the policy's versions, use ListPolicyVersions. You cannot use DeletePolicyVersion to delete the version that is marked as the default version. You delete the policy's default version in the next step of the process.

  • Delete the policy (this automatically deletes the policy's default version) using this API.

For information about managed policies, see Managed Policies and Inline Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) in the IAM User Guide.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation DeletePolicy for usage and error information.

Returned Error Codes:

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeLimitExceededException "LimitExceeded" The request was rejected because it attempted to create resources beyond the current AWS account limits. The error message describes the limit exceeded.

  • ErrCodeInvalidInputException "InvalidInput" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

  • ErrCodeDeleteConflictException "DeleteConflict" The request was rejected because it attempted to delete a resource that has attached subordinate entities. The error message describes these entities.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeletePolicy

DeletePolicyRequest

func (c *IAM) DeletePolicyRequest(input *DeletePolicyInput) (req *request.Request, output *DeletePolicyOutput)

DeletePolicyRequest generates a "aws/request.Request" representing the client's request for the DeletePolicy operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DeletePolicy for more information on using the DeletePolicy API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DeletePolicyRequest method. req, resp := client.DeletePolicyRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeletePolicy

DeletePolicyVersion

func (c *IAM) DeletePolicyVersion(input *DeletePolicyVersionInput) (*DeletePolicyVersionOutput, error)

DeletePolicyVersion API operation for AWS Identity and Access Management.

Deletes the specified version from the specified managed policy.

You cannot delete the default version from a policy using this API. To delete the default version from a policy, use DeletePolicy. To find out which version of a policy is marked as the default version, use ListPolicyVersions.

For information about versions for managed policies, see Versioning for Managed Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-versions.html) in the IAM User Guide.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation DeletePolicyVersion for usage and error information.

Returned Error Codes:

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeLimitExceededException "LimitExceeded" The request was rejected because it attempted to create resources beyond the current AWS account limits. The error message describes the limit exceeded.

  • ErrCodeInvalidInputException "InvalidInput" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

  • ErrCodeDeleteConflictException "DeleteConflict" The request was rejected because it attempted to delete a resource that has attached subordinate entities. The error message describes these entities.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeletePolicyVersion

DeletePolicyVersionRequest

func (c *IAM) DeletePolicyVersionRequest(input *DeletePolicyVersionInput) (req *request.Request, output *DeletePolicyVersionOutput)

DeletePolicyVersionRequest generates a "aws/request.Request" representing the client's request for the DeletePolicyVersion operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DeletePolicyVersion for more information on using the DeletePolicyVersion API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DeletePolicyVersionRequest method. req, resp := client.DeletePolicyVersionRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeletePolicyVersion

DeletePolicyVersionWithContext

func (c *IAM) DeletePolicyVersionWithContext(ctx aws.Context, input *DeletePolicyVersionInput, opts ...request.Option) (*DeletePolicyVersionOutput, error)

DeletePolicyVersionWithContext is the same as DeletePolicyVersion with the addition of the ability to pass a context and additional request options.

See DeletePolicyVersion for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DeletePolicyWithContext

func (c *IAM) DeletePolicyWithContext(ctx aws.Context, input *DeletePolicyInput, opts ...request.Option) (*DeletePolicyOutput, error)

DeletePolicyWithContext is the same as DeletePolicy with the addition of the ability to pass a context and additional request options.

See DeletePolicy for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DeleteRole

func (c *IAM) DeleteRole(input *DeleteRoleInput) (*DeleteRoleOutput, error)

DeleteRole API operation for AWS Identity and Access Management.

Deletes the specified role. The role must not have any policies attached. For more information about roles, go to Working with Roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/WorkingWithRoles.html).

Make sure that you do not have any Amazon EC2 instances running with the role you are about to delete. Deleting a role or instance profile that is associated with a running instance will break any applications running on the instance.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation DeleteRole for usage and error information.

Returned Error Codes:

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeDeleteConflictException "DeleteConflict" The request was rejected because it attempted to delete a resource that has attached subordinate entities. The error message describes these entities.

  • ErrCodeLimitExceededException "LimitExceeded" The request was rejected because it attempted to create resources beyond the current AWS account limits. The error message describes the limit exceeded.

  • ErrCodeUnmodifiableEntityException "UnmodifiableEntity" The request was rejected because only the service that depends on the service-linked role can modify or delete the role on your behalf. The error message includes the name of the service that depends on this service-linked role. You must request the change through that service.

  • ErrCodeConcurrentModificationException "ConcurrentModification" The request was rejected because multiple requests to change this object were submitted simultaneously. Wait a few minutes and submit your request again.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteRole

Example

IAM DeleteRole shared00

To delete an IAM role

The following command removes the role named Test-Role.

{ svc := iam.New(session.New()) input := &iam.DeleteRoleInput{ RoleName: aws.String("Test-Role"), } result, err := svc.DeleteRole(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case iam.ErrCodeNoSuchEntityException: fmt.Println(iam.ErrCodeNoSuchEntityException, aerr.Error()) case iam.ErrCodeDeleteConflictException: fmt.Println(iam.ErrCodeDeleteConflictException, aerr.Error()) case iam.ErrCodeLimitExceededException: fmt.Println(iam.ErrCodeLimitExceededException, aerr.Error()) case iam.ErrCodeUnmodifiableEntityException: fmt.Println(iam.ErrCodeUnmodifiableEntityException, aerr.Error()) case iam.ErrCodeConcurrentModificationException: fmt.Println(iam.ErrCodeConcurrentModificationException, aerr.Error()) case iam.ErrCodeServiceFailureException: fmt.Println(iam.ErrCodeServiceFailureException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

DeleteRolePermissionsBoundary

func (c *IAM) DeleteRolePermissionsBoundary(input *DeleteRolePermissionsBoundaryInput) (*DeleteRolePermissionsBoundaryOutput, error)

DeleteRolePermissionsBoundary API operation for AWS Identity and Access Management.

Deletes the permissions boundary for the specified IAM role.

Deleting the permissions boundary for a role might increase its permissions by allowing anyone who assumes the role to perform all the actions granted in its permissions policies.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation DeleteRolePermissionsBoundary for usage and error information.

Returned Error Codes:

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeUnmodifiableEntityException "UnmodifiableEntity" The request was rejected because only the service that depends on the service-linked role can modify or delete the role on your behalf. The error message includes the name of the service that depends on this service-linked role. You must request the change through that service.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteRolePermissionsBoundary

DeleteRolePermissionsBoundaryRequest

func (c *IAM) DeleteRolePermissionsBoundaryRequest(input *DeleteRolePermissionsBoundaryInput) (req *request.Request, output *DeleteRolePermissionsBoundaryOutput)

DeleteRolePermissionsBoundaryRequest generates a "aws/request.Request" representing the client's request for the DeleteRolePermissionsBoundary operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DeleteRolePermissionsBoundary for more information on using the DeleteRolePermissionsBoundary API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DeleteRolePermissionsBoundaryRequest method. req, resp := client.DeleteRolePermissionsBoundaryRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteRolePermissionsBoundary

DeleteRolePermissionsBoundaryWithContext

func (c *IAM) DeleteRolePermissionsBoundaryWithContext(ctx aws.Context, input *DeleteRolePermissionsBoundaryInput, opts ...request.Option) (*DeleteRolePermissionsBoundaryOutput, error)

DeleteRolePermissionsBoundaryWithContext is the same as DeleteRolePermissionsBoundary with the addition of the ability to pass a context and additional request options.

See DeleteRolePermissionsBoundary for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DeleteRolePolicy

func (c *IAM) DeleteRolePolicy(input *DeleteRolePolicyInput) (*DeleteRolePolicyOutput, error)

DeleteRolePolicy API operation for AWS Identity and Access Management.

Deletes the specified inline policy that is embedded in the specified IAM role.

A role can also have managed policies attached to it. To detach a managed policy from a role, use DetachRolePolicy. For more information about policies, refer to Managed Policies and Inline Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) in the IAM User Guide.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation DeleteRolePolicy for usage and error information.

Returned Error Codes:

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeLimitExceededException "LimitExceeded" The request was rejected because it attempted to create resources beyond the current AWS account limits. The error message describes the limit exceeded.

  • ErrCodeUnmodifiableEntityException "UnmodifiableEntity" The request was rejected because only the service that depends on the service-linked role can modify or delete the role on your behalf. The error message includes the name of the service that depends on this service-linked role. You must request the change through that service.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteRolePolicy

Example

IAM DeleteRolePolicy shared00

To remove a policy from an IAM role

The following command removes the policy named ExamplePolicy from the role named Test-Role.

{ svc := iam.New(session.New()) input := &iam.DeleteRolePolicyInput{ PolicyName: aws.String("ExamplePolicy"), RoleName: aws.String("Test-Role"), } result, err := svc.DeleteRolePolicy(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case iam.ErrCodeNoSuchEntityException: fmt.Println(iam.ErrCodeNoSuchEntityException, aerr.Error()) case iam.ErrCodeLimitExceededException: fmt.Println(iam.ErrCodeLimitExceededException, aerr.Error()) case iam.ErrCodeUnmodifiableEntityException: fmt.Println(iam.ErrCodeUnmodifiableEntityException, aerr.Error()) case iam.ErrCodeServiceFailureException: fmt.Println(iam.ErrCodeServiceFailureException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

DeleteRolePolicyRequest

func (c *IAM) DeleteRolePolicyRequest(input *DeleteRolePolicyInput) (req *request.Request, output *DeleteRolePolicyOutput)

DeleteRolePolicyRequest generates a "aws/request.Request" representing the client's request for the DeleteRolePolicy operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DeleteRolePolicy for more information on using the DeleteRolePolicy API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DeleteRolePolicyRequest method. req, resp := client.DeleteRolePolicyRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteRolePolicy

DeleteRolePolicyWithContext

func (c *IAM) DeleteRolePolicyWithContext(ctx aws.Context, input *DeleteRolePolicyInput, opts ...request.Option) (*DeleteRolePolicyOutput, error)

DeleteRolePolicyWithContext is the same as DeleteRolePolicy with the addition of the ability to pass a context and additional request options.

See DeleteRolePolicy for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DeleteRoleRequest

func (c *IAM) DeleteRoleRequest(input *DeleteRoleInput) (req *request.Request, output *DeleteRoleOutput)

DeleteRoleRequest generates a "aws/request.Request" representing the client's request for the DeleteRole operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DeleteRole for more information on using the DeleteRole API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DeleteRoleRequest method. req, resp := client.DeleteRoleRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteRole

DeleteRoleWithContext

func (c *IAM) DeleteRoleWithContext(ctx aws.Context, input *DeleteRoleInput, opts ...request.Option) (*DeleteRoleOutput, error)

DeleteRoleWithContext is the same as DeleteRole with the addition of the ability to pass a context and additional request options.

See DeleteRole for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DeleteSAMLProvider

func (c *IAM) DeleteSAMLProvider(input *DeleteSAMLProviderInput) (*DeleteSAMLProviderOutput, error)

DeleteSAMLProvider API operation for AWS Identity and Access Management.

Deletes a SAML provider resource in IAM.

Deleting the provider resource from IAM does not update any roles that reference the SAML provider resource's ARN as a principal in their trust policies. Any attempt to assume a role that references a non-existent provider resource ARN fails.

This operation requires Signature Version 4 (https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html).

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation DeleteSAMLProvider for usage and error information.

Returned Error Codes:

  • ErrCodeInvalidInputException "InvalidInput" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

  • ErrCodeLimitExceededException "LimitExceeded" The request was rejected because it attempted to create resources beyond the current AWS account limits. The error message describes the limit exceeded.

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteSAMLProvider

DeleteSAMLProviderRequest

func (c *IAM) DeleteSAMLProviderRequest(input *DeleteSAMLProviderInput) (req *request.Request, output *DeleteSAMLProviderOutput)

DeleteSAMLProviderRequest generates a "aws/request.Request" representing the client's request for the DeleteSAMLProvider operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DeleteSAMLProvider for more information on using the DeleteSAMLProvider API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DeleteSAMLProviderRequest method. req, resp := client.DeleteSAMLProviderRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteSAMLProvider

DeleteSAMLProviderWithContext

func (c *IAM) DeleteSAMLProviderWithContext(ctx aws.Context, input *DeleteSAMLProviderInput, opts ...request.Option) (*DeleteSAMLProviderOutput, error)

DeleteSAMLProviderWithContext is the same as DeleteSAMLProvider with the addition of the ability to pass a context and additional request options.

See DeleteSAMLProvider for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DeleteSSHPublicKey

func (c *IAM) DeleteSSHPublicKey(input *DeleteSSHPublicKeyInput) (*DeleteSSHPublicKeyOutput, error)

DeleteSSHPublicKey API operation for AWS Identity and Access Management.

Deletes the specified SSH public key.

The SSH public key deleted by this operation is used only for authenticating the associated IAM user to an AWS CodeCommit repository. For more information about using SSH keys to authenticate to an AWS CodeCommit repository, see Set up AWS CodeCommit for SSH Connections (https://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-credentials-ssh.html) in the AWS CodeCommit User Guide.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation DeleteSSHPublicKey for usage and error information.

Returned Error Codes:

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteSSHPublicKey

DeleteSSHPublicKeyRequest

func (c *IAM) DeleteSSHPublicKeyRequest(input *DeleteSSHPublicKeyInput) (req *request.Request, output *DeleteSSHPublicKeyOutput)

DeleteSSHPublicKeyRequest generates a "aws/request.Request" representing the client's request for the DeleteSSHPublicKey operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DeleteSSHPublicKey for more information on using the DeleteSSHPublicKey API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DeleteSSHPublicKeyRequest method. req, resp := client.DeleteSSHPublicKeyRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteSSHPublicKey

DeleteSSHPublicKeyWithContext

func (c *IAM) DeleteSSHPublicKeyWithContext(ctx aws.Context, input *DeleteSSHPublicKeyInput, opts ...request.Option) (*DeleteSSHPublicKeyOutput, error)

DeleteSSHPublicKeyWithContext is the same as DeleteSSHPublicKey with the addition of the ability to pass a context and additional request options.

See DeleteSSHPublicKey for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DeleteServerCertificate

func (c *IAM) DeleteServerCertificate(input *DeleteServerCertificateInput) (*DeleteServerCertificateOutput, error)

DeleteServerCertificate API operation for AWS Identity and Access Management.

Deletes the specified server certificate.

For more information about working with server certificates, see Working with Server Certificates (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_server-certs.html) in the IAM User Guide. This topic also includes a list of AWS services that can use the server certificates that you manage with IAM.

If you are using a server certificate with Elastic Load Balancing, deleting the certificate could have implications for your application. If Elastic Load Balancing doesn't detect the deletion of bound certificates, it may continue to use the certificates. This could cause Elastic Load Balancing to stop accepting traffic. We recommend that you remove the reference to the certificate from Elastic Load Balancing before using this command to delete the certificate. For more information, go to DeleteLoadBalancerListeners (https://docs.aws.amazon.com/ElasticLoadBalancing/latest/APIReference/API_DeleteLoadBalancerListeners.html) in the Elastic Load Balancing API Reference.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation DeleteServerCertificate for usage and error information.

Returned Error Codes:

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeDeleteConflictException "DeleteConflict" The request was rejected because it attempted to delete a resource that has attached subordinate entities. The error message describes these entities.

  • ErrCodeLimitExceededException "LimitExceeded" The request was rejected because it attempted to create resources beyond the current AWS account limits. The error message describes the limit exceeded.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteServerCertificate

DeleteServerCertificateRequest

func (c *IAM) DeleteServerCertificateRequest(input *DeleteServerCertificateInput) (req *request.Request, output *DeleteServerCertificateOutput)

DeleteServerCertificateRequest generates a "aws/request.Request" representing the client's request for the DeleteServerCertificate operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DeleteServerCertificate for more information on using the DeleteServerCertificate API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DeleteServerCertificateRequest method. req, resp := client.DeleteServerCertificateRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteServerCertificate

DeleteServerCertificateWithContext

func (c *IAM) DeleteServerCertificateWithContext(ctx aws.Context, input *DeleteServerCertificateInput, opts ...request.Option) (*DeleteServerCertificateOutput, error)

DeleteServerCertificateWithContext is the same as DeleteServerCertificate with the addition of the ability to pass a context and additional request options.

See DeleteServerCertificate for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DeleteServiceLinkedRole

func (c *IAM) DeleteServiceLinkedRole(input *DeleteServiceLinkedRoleInput) (*DeleteServiceLinkedRoleOutput, error)

DeleteServiceLinkedRole API operation for AWS Identity and Access Management.

Submits a service-linked role deletion request and returns a DeletionTaskId, which you can use to check the status of the deletion. Before you call this operation, confirm that the role has no active sessions and that any resources used by the role in the linked service are deleted. If you call this operation more than once for the same service-linked role and an earlier deletion task is not complete, then the DeletionTaskId of the earlier request is returned.

If you submit a deletion request for a service-linked role whose linked service is still accessing a resource, then the deletion task fails. If it fails, the GetServiceLinkedRoleDeletionStatus API operation returns the reason for the failure, usually including the resources that must be deleted. To delete the service-linked role, you must first remove those resources from the linked service and then submit the deletion request again. Resources are specific to the service that is linked to the role. For more information about removing resources from a service, see the AWS documentation (https://docs.aws.amazon.com/) for your service.

For more information about service-linked roles, see Roles Terms and Concepts: AWS Service-Linked Role (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html#iam-term-service-linked-role) in the IAM User Guide.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation DeleteServiceLinkedRole for usage and error information.

Returned Error Codes:

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeLimitExceededException "LimitExceeded" The request was rejected because it attempted to create resources beyond the current AWS account limits. The error message describes the limit exceeded.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteServiceLinkedRole

DeleteServiceLinkedRoleRequest

func (c *IAM) DeleteServiceLinkedRoleRequest(input *DeleteServiceLinkedRoleInput) (req *request.Request, output *DeleteServiceLinkedRoleOutput)

DeleteServiceLinkedRoleRequest generates a "aws/request.Request" representing the client's request for the DeleteServiceLinkedRole operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DeleteServiceLinkedRole for more information on using the DeleteServiceLinkedRole API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DeleteServiceLinkedRoleRequest method. req, resp := client.DeleteServiceLinkedRoleRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteServiceLinkedRole

DeleteServiceLinkedRoleWithContext

func (c *IAM) DeleteServiceLinkedRoleWithContext(ctx aws.Context, input *DeleteServiceLinkedRoleInput, opts ...request.Option) (*DeleteServiceLinkedRoleOutput, error)

DeleteServiceLinkedRoleWithContext is the same as DeleteServiceLinkedRole with the addition of the ability to pass a context and additional request options.

See DeleteServiceLinkedRole for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DeleteServiceSpecificCredential

func (c *IAM) DeleteServiceSpecificCredential(input *DeleteServiceSpecificCredentialInput) (*DeleteServiceSpecificCredentialOutput, error)

DeleteServiceSpecificCredential API operation for AWS Identity and Access Management.

Deletes the specified service-specific credential.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation DeleteServiceSpecificCredential for usage and error information.

Returned Error Codes:

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteServiceSpecificCredential

DeleteServiceSpecificCredentialRequest

func (c *IAM) DeleteServiceSpecificCredentialRequest(input *DeleteServiceSpecificCredentialInput) (req *request.Request, output *DeleteServiceSpecificCredentialOutput)

DeleteServiceSpecificCredentialRequest generates a "aws/request.Request" representing the client's request for the DeleteServiceSpecificCredential operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DeleteServiceSpecificCredential for more information on using the DeleteServiceSpecificCredential API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DeleteServiceSpecificCredentialRequest method. req, resp := client.DeleteServiceSpecificCredentialRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteServiceSpecificCredential

DeleteServiceSpecificCredentialWithContext

func (c *IAM) DeleteServiceSpecificCredentialWithContext(ctx aws.Context, input *DeleteServiceSpecificCredentialInput, opts ...request.Option) (*DeleteServiceSpecificCredentialOutput, error)

DeleteServiceSpecificCredentialWithContext is the same as DeleteServiceSpecificCredential with the addition of the ability to pass a context and additional request options.

See DeleteServiceSpecificCredential for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DeleteSigningCertificate

func (c *IAM) DeleteSigningCertificate(input *DeleteSigningCertificateInput) (*DeleteSigningCertificateOutput, error)

DeleteSigningCertificate API operation for AWS Identity and Access Management.

Deletes a signing certificate associated with the specified IAM user.

If you do not specify a user name, IAM determines the user name implicitly based on the AWS access key ID signing the request. This operation works for access keys under the AWS account. Consequently, you can use this operation to manage AWS account root user credentials even if the AWS account has no associated IAM users.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation DeleteSigningCertificate for usage and error information.

Returned Error Codes:

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeLimitExceededException "LimitExceeded" The request was rejected because it attempted to create resources beyond the current AWS account limits. The error message describes the limit exceeded.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteSigningCertificate

Example

IAM DeleteSigningCertificate shared00

To delete a signing certificate for an IAM user

The following command deletes the specified signing certificate for the IAM user named Anika.

{ svc := iam.New(session.New()) input := &iam.DeleteSigningCertificateInput{ CertificateId: aws.String("TA7SMP42TDN5Z26OBPJE7EXAMPLE"), UserName: aws.String("Anika"), } result, err := svc.DeleteSigningCertificate(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case iam.ErrCodeNoSuchEntityException: fmt.Println(iam.ErrCodeNoSuchEntityException, aerr.Error()) case iam.ErrCodeLimitExceededException: fmt.Println(iam.ErrCodeLimitExceededException, aerr.Error()) case iam.ErrCodeServiceFailureException: fmt.Println(iam.ErrCodeServiceFailureException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

DeleteSigningCertificateRequest

func (c *IAM) DeleteSigningCertificateRequest(input *DeleteSigningCertificateInput) (req *request.Request, output *DeleteSigningCertificateOutput)

DeleteSigningCertificateRequest generates a "aws/request.Request" representing the client's request for the DeleteSigningCertificate operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DeleteSigningCertificate for more information on using the DeleteSigningCertificate API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DeleteSigningCertificateRequest method. req, resp := client.DeleteSigningCertificateRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteSigningCertificate

DeleteSigningCertificateWithContext

func (c *IAM) DeleteSigningCertificateWithContext(ctx aws.Context, input *DeleteSigningCertificateInput, opts ...request.Option) (*DeleteSigningCertificateOutput, error)

DeleteSigningCertificateWithContext is the same as DeleteSigningCertificate with the addition of the ability to pass a context and additional request options.

See DeleteSigningCertificate for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DeleteUser

func (c *IAM) DeleteUser(input *DeleteUserInput) (*DeleteUserOutput, error)

DeleteUser API operation for AWS Identity and Access Management.

Deletes the specified IAM user. The user must not belong to any groups or have any access keys, signing certificates, MFA devices enabled for AWS, or attached policies.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation DeleteUser for usage and error information.

Returned Error Codes:

  • ErrCodeLimitExceededException "LimitExceeded" The request was rejected because it attempted to create resources beyond the current AWS account limits. The error message describes the limit exceeded.

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeDeleteConflictException "DeleteConflict" The request was rejected because it attempted to delete a resource that has attached subordinate entities. The error message describes these entities.

  • ErrCodeConcurrentModificationException "ConcurrentModification" The request was rejected because multiple requests to change this object were submitted simultaneously. Wait a few minutes and submit your request again.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteUser

Example

IAM DeleteUser shared00

To delete an IAM user

The following command removes the IAM user named Bob from the current account.

{ svc := iam.New(session.New()) input := &iam.DeleteUserInput{ UserName: aws.String("Bob"), } result, err := svc.DeleteUser(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case iam.ErrCodeLimitExceededException: fmt.Println(iam.ErrCodeLimitExceededException, aerr.Error()) case iam.ErrCodeNoSuchEntityException: fmt.Println(iam.ErrCodeNoSuchEntityException, aerr.Error()) case iam.ErrCodeDeleteConflictException: fmt.Println(iam.ErrCodeDeleteConflictException, aerr.Error()) case iam.ErrCodeConcurrentModificationException: fmt.Println(iam.ErrCodeConcurrentModificationException, aerr.Error()) case iam.ErrCodeServiceFailureException: fmt.Println(iam.ErrCodeServiceFailureException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

DeleteUserPermissionsBoundary

func (c *IAM) DeleteUserPermissionsBoundary(input *DeleteUserPermissionsBoundaryInput) (*DeleteUserPermissionsBoundaryOutput, error)

DeleteUserPermissionsBoundary API operation for AWS Identity and Access Management.

Deletes the permissions boundary for the specified IAM user.

Deleting the permissions boundary for a user might increase its permissions by allowing the user to perform all the actions granted in its permissions policies.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation DeleteUserPermissionsBoundary for usage and error information.

Returned Error Codes:

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteUserPermissionsBoundary

DeleteUserPermissionsBoundaryRequest

func (c *IAM) DeleteUserPermissionsBoundaryRequest(input *DeleteUserPermissionsBoundaryInput) (req *request.Request, output *DeleteUserPermissionsBoundaryOutput)

DeleteUserPermissionsBoundaryRequest generates a "aws/request.Request" representing the client's request for the DeleteUserPermissionsBoundary operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DeleteUserPermissionsBoundary for more information on using the DeleteUserPermissionsBoundary API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DeleteUserPermissionsBoundaryRequest method. req, resp := client.DeleteUserPermissionsBoundaryRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteUserPermissionsBoundary

DeleteUserPermissionsBoundaryWithContext

func (c *IAM) DeleteUserPermissionsBoundaryWithContext(ctx aws.Context, input *DeleteUserPermissionsBoundaryInput, opts ...request.Option) (*DeleteUserPermissionsBoundaryOutput, error)

DeleteUserPermissionsBoundaryWithContext is the same as DeleteUserPermissionsBoundary with the addition of the ability to pass a context and additional request options.

See DeleteUserPermissionsBoundary for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DeleteUserPolicy

func (c *IAM) DeleteUserPolicy(input *DeleteUserPolicyInput) (*DeleteUserPolicyOutput, error)

DeleteUserPolicy API operation for AWS Identity and Access Management.

Deletes the specified inline policy that is embedded in the specified IAM user.

A user can also have managed policies attached to it. To detach a managed policy from a user, use DetachUserPolicy. For more information about policies, refer to Managed Policies and Inline Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) in the IAM User Guide.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation DeleteUserPolicy for usage and error information.

Returned Error Codes:

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeLimitExceededException "LimitExceeded" The request was rejected because it attempted to create resources beyond the current AWS account limits. The error message describes the limit exceeded.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteUserPolicy

Example

IAM DeleteUserPolicy shared00

To remove a policy from an IAM user

The following delete-user-policy command removes the specified policy from the IAM user named Juan:

{ svc := iam.New(session.New()) input := &iam.DeleteUserPolicyInput{ PolicyName: aws.String("ExamplePolicy"), UserName: aws.String("Juan"), } result, err := svc.DeleteUserPolicy(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case iam.ErrCodeNoSuchEntityException: fmt.Println(iam.ErrCodeNoSuchEntityException, aerr.Error()) case iam.ErrCodeLimitExceededException: fmt.Println(iam.ErrCodeLimitExceededException, aerr.Error()) case iam.ErrCodeServiceFailureException: fmt.Println(iam.ErrCodeServiceFailureException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

DeleteUserPolicyRequest

func (c *IAM) DeleteUserPolicyRequest(input *DeleteUserPolicyInput) (req *request.Request, output *DeleteUserPolicyOutput)

DeleteUserPolicyRequest generates a "aws/request.Request" representing the client's request for the DeleteUserPolicy operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DeleteUserPolicy for more information on using the DeleteUserPolicy API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DeleteUserPolicyRequest method. req, resp := client.DeleteUserPolicyRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteUserPolicy

DeleteUserPolicyWithContext

func (c *IAM) DeleteUserPolicyWithContext(ctx aws.Context, input *DeleteUserPolicyInput, opts ...request.Option) (*DeleteUserPolicyOutput, error)

DeleteUserPolicyWithContext is the same as DeleteUserPolicy with the addition of the ability to pass a context and additional request options.

See DeleteUserPolicy for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DeleteUserRequest

func (c *IAM) DeleteUserRequest(input *DeleteUserInput) (req *request.Request, output *DeleteUserOutput)

DeleteUserRequest generates a "aws/request.Request" representing the client's request for the DeleteUser operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DeleteUser for more information on using the DeleteUser API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DeleteUserRequest method. req, resp := client.DeleteUserRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteUser

DeleteUserWithContext

func (c *IAM) DeleteUserWithContext(ctx aws.Context, input *DeleteUserInput, opts ...request.Option) (*DeleteUserOutput, error)

DeleteUserWithContext is the same as DeleteUser with the addition of the ability to pass a context and additional request options.

See DeleteUser for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DeleteVirtualMFADevice

func (c *IAM) DeleteVirtualMFADevice(input *DeleteVirtualMFADeviceInput) (*DeleteVirtualMFADeviceOutput, error)

DeleteVirtualMFADevice API operation for AWS Identity and Access Management.

Deletes a virtual MFA device.

You must deactivate a user's virtual MFA device before you can delete it. For information about deactivating MFA devices, see DeactivateMFADevice.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation DeleteVirtualMFADevice for usage and error information.

Returned Error Codes:

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeDeleteConflictException "DeleteConflict" The request was rejected because it attempted to delete a resource that has attached subordinate entities. The error message describes these entities.

  • ErrCodeLimitExceededException "LimitExceeded" The request was rejected because it attempted to create resources beyond the current AWS account limits. The error message describes the limit exceeded.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteVirtualMFADevice

Example

IAM DeleteVirtualMFADevice shared00

To remove a virtual MFA device

The following delete-virtual-mfa-device command removes the specified MFA device from the current AWS account.

{ svc := iam.New(session.New()) input := &iam.DeleteVirtualMFADeviceInput{ SerialNumber: aws.String("arn:aws:iam::123456789012:mfa/ExampleName"), } result, err := svc.DeleteVirtualMFADevice(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case iam.ErrCodeNoSuchEntityException: fmt.Println(iam.ErrCodeNoSuchEntityException, aerr.Error()) case iam.ErrCodeDeleteConflictException: fmt.Println(iam.ErrCodeDeleteConflictException, aerr.Error()) case iam.ErrCodeLimitExceededException: fmt.Println(iam.ErrCodeLimitExceededException, aerr.Error()) case iam.ErrCodeServiceFailureException: fmt.Println(iam.ErrCodeServiceFailureException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

DeleteVirtualMFADeviceRequest

func (c *IAM) DeleteVirtualMFADeviceRequest(input *DeleteVirtualMFADeviceInput) (req *request.Request, output *DeleteVirtualMFADeviceOutput)

DeleteVirtualMFADeviceRequest generates a "aws/request.Request" representing the client's request for the DeleteVirtualMFADevice operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DeleteVirtualMFADevice for more information on using the DeleteVirtualMFADevice API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DeleteVirtualMFADeviceRequest method. req, resp := client.DeleteVirtualMFADeviceRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DeleteVirtualMFADevice

DeleteVirtualMFADeviceWithContext

func (c *IAM) DeleteVirtualMFADeviceWithContext(ctx aws.Context, input *DeleteVirtualMFADeviceInput, opts ...request.Option) (*DeleteVirtualMFADeviceOutput, error)

DeleteVirtualMFADeviceWithContext is the same as DeleteVirtualMFADevice with the addition of the ability to pass a context and additional request options.

See DeleteVirtualMFADevice for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DetachGroupPolicy

func (c *IAM) DetachGroupPolicy(input *DetachGroupPolicyInput) (*DetachGroupPolicyOutput, error)

DetachGroupPolicy API operation for AWS Identity and Access Management.

Removes the specified managed policy from the specified IAM group.

A group can also have inline policies embedded with it. To delete an inline policy, use the DeleteGroupPolicy API. For information about policies, see Managed Policies and Inline Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) in the IAM User Guide.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation DetachGroupPolicy for usage and error information.

Returned Error Codes:

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeLimitExceededException "LimitExceeded" The request was rejected because it attempted to create resources beyond the current AWS account limits. The error message describes the limit exceeded.

  • ErrCodeInvalidInputException "InvalidInput" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DetachGroupPolicy

DetachGroupPolicyRequest

func (c *IAM) DetachGroupPolicyRequest(input *DetachGroupPolicyInput) (req *request.Request, output *DetachGroupPolicyOutput)

DetachGroupPolicyRequest generates a "aws/request.Request" representing the client's request for the DetachGroupPolicy operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DetachGroupPolicy for more information on using the DetachGroupPolicy API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DetachGroupPolicyRequest method. req, resp := client.DetachGroupPolicyRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DetachGroupPolicy

DetachGroupPolicyWithContext

func (c *IAM) DetachGroupPolicyWithContext(ctx aws.Context, input *DetachGroupPolicyInput, opts ...request.Option) (*DetachGroupPolicyOutput, error)

DetachGroupPolicyWithContext is the same as DetachGroupPolicy with the addition of the ability to pass a context and additional request options.

See DetachGroupPolicy for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DetachRolePolicy

func (c *IAM) DetachRolePolicy(input *DetachRolePolicyInput) (*DetachRolePolicyOutput, error)

DetachRolePolicy API operation for AWS Identity and Access Management.

Removes the specified managed policy from the specified role.

A role can also have inline policies embedded with it. To delete an inline policy, use the DeleteRolePolicy API. For information about policies, see Managed Policies and Inline Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) in the IAM User Guide.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation DetachRolePolicy for usage and error information.

Returned Error Codes:

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeLimitExceededException "LimitExceeded" The request was rejected because it attempted to create resources beyond the current AWS account limits. The error message describes the limit exceeded.

  • ErrCodeInvalidInputException "InvalidInput" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

  • ErrCodeUnmodifiableEntityException "UnmodifiableEntity" The request was rejected because only the service that depends on the service-linked role can modify or delete the role on your behalf. The error message includes the name of the service that depends on this service-linked role. You must request the change through that service.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DetachRolePolicy

DetachRolePolicyRequest

func (c *IAM) DetachRolePolicyRequest(input *DetachRolePolicyInput) (req *request.Request, output *DetachRolePolicyOutput)

DetachRolePolicyRequest generates a "aws/request.Request" representing the client's request for the DetachRolePolicy operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DetachRolePolicy for more information on using the DetachRolePolicy API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DetachRolePolicyRequest method. req, resp := client.DetachRolePolicyRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DetachRolePolicy

DetachRolePolicyWithContext

func (c *IAM) DetachRolePolicyWithContext(ctx aws.Context, input *DetachRolePolicyInput, opts ...request.Option) (*DetachRolePolicyOutput, error)

DetachRolePolicyWithContext is the same as DetachRolePolicy with the addition of the ability to pass a context and additional request options.

See DetachRolePolicy for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DetachUserPolicy

func (c *IAM) DetachUserPolicy(input *DetachUserPolicyInput) (*DetachUserPolicyOutput, error)

DetachUserPolicy API operation for AWS Identity and Access Management.

Removes the specified managed policy from the specified user.

A user can also have inline policies embedded with it. To delete an inline policy, use the DeleteUserPolicy API. For information about policies, see Managed Policies and Inline Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) in the IAM User Guide.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation DetachUserPolicy for usage and error information.

Returned Error Codes:

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeLimitExceededException "LimitExceeded" The request was rejected because it attempted to create resources beyond the current AWS account limits. The error message describes the limit exceeded.

  • ErrCodeInvalidInputException "InvalidInput" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DetachUserPolicy

DetachUserPolicyRequest

func (c *IAM) DetachUserPolicyRequest(input *DetachUserPolicyInput) (req *request.Request, output *DetachUserPolicyOutput)

DetachUserPolicyRequest generates a "aws/request.Request" representing the client's request for the DetachUserPolicy operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DetachUserPolicy for more information on using the DetachUserPolicy API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DetachUserPolicyRequest method. req, resp := client.DetachUserPolicyRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/DetachUserPolicy

DetachUserPolicyWithContext

func (c *IAM) DetachUserPolicyWithContext(ctx aws.Context, input *DetachUserPolicyInput, opts ...request.Option) (*DetachUserPolicyOutput, error)

DetachUserPolicyWithContext is the same as DetachUserPolicy with the addition of the ability to pass a context and additional request options.

See DetachUserPolicy for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

EnableMFADevice

func (c *IAM) EnableMFADevice(input *EnableMFADeviceInput) (*EnableMFADeviceOutput, error)

EnableMFADevice API operation for AWS Identity and Access Management.

Enables the specified MFA device and associates it with the specified IAM user. When enabled, the MFA device is required for every subsequent login by the IAM user associated with the device.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation EnableMFADevice for usage and error information.

Returned Error Codes:

  • ErrCodeEntityAlreadyExistsException "EntityAlreadyExists" The request was rejected because it attempted to create a resource that already exists.

  • ErrCodeEntityTemporarilyUnmodifiableException "EntityTemporarilyUnmodifiable" The request was rejected because it referenced an entity that is temporarily unmodifiable, such as a user name that was deleted and then recreated. The error indicates that the request is likely to succeed if you try again after waiting several minutes. The error message describes the entity.

  • ErrCodeInvalidAuthenticationCodeException "InvalidAuthenticationCode" The request was rejected because the authentication code was not recognized. The error message describes the specific error.

  • ErrCodeLimitExceededException "LimitExceeded" The request was rejected because it attempted to create resources beyond the current AWS account limits. The error message describes the limit exceeded.

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/EnableMFADevice

EnableMFADeviceRequest

func (c *IAM) EnableMFADeviceRequest(input *EnableMFADeviceInput) (req *request.Request, output *EnableMFADeviceOutput)

EnableMFADeviceRequest generates a "aws/request.Request" representing the client's request for the EnableMFADevice operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See EnableMFADevice for more information on using the EnableMFADevice API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the EnableMFADeviceRequest method. req, resp := client.EnableMFADeviceRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/EnableMFADevice

EnableMFADeviceWithContext

func (c *IAM) EnableMFADeviceWithContext(ctx aws.Context, input *EnableMFADeviceInput, opts ...request.Option) (*EnableMFADeviceOutput, error)

EnableMFADeviceWithContext is the same as EnableMFADevice with the addition of the ability to pass a context and additional request options.

See EnableMFADevice for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

GenerateCredentialReport

func (c *IAM) GenerateCredentialReport(input *GenerateCredentialReportInput) (*GenerateCredentialReportOutput, error)

GenerateCredentialReport API operation for AWS Identity and Access Management.

Generates a credential report for the AWS account. For more information about the credential report, see Getting Credential Reports (https://docs.aws.amazon.com/IAM/latest/UserGuide/credential-reports.html) in the IAM User Guide.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation GenerateCredentialReport for usage and error information.

Returned Error Codes:

  • ErrCodeLimitExceededException "LimitExceeded" The request was rejected because it attempted to create resources beyond the current AWS account limits. The error message describes the limit exceeded.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GenerateCredentialReport

GenerateCredentialReportRequest

func (c *IAM) GenerateCredentialReportRequest(input *GenerateCredentialReportInput) (req *request.Request, output *GenerateCredentialReportOutput)

GenerateCredentialReportRequest generates a "aws/request.Request" representing the client's request for the GenerateCredentialReport operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See GenerateCredentialReport for more information on using the GenerateCredentialReport API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the GenerateCredentialReportRequest method. req, resp := client.GenerateCredentialReportRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GenerateCredentialReport

GenerateCredentialReportWithContext

func (c *IAM) GenerateCredentialReportWithContext(ctx aws.Context, input *GenerateCredentialReportInput, opts ...request.Option) (*GenerateCredentialReportOutput, error)

GenerateCredentialReportWithContext is the same as GenerateCredentialReport with the addition of the ability to pass a context and additional request options.

See GenerateCredentialReport for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

GenerateServiceLastAccessedDetails

func (c *IAM) GenerateServiceLastAccessedDetails(input *GenerateServiceLastAccessedDetailsInput) (*GenerateServiceLastAccessedDetailsOutput, error)

GenerateServiceLastAccessedDetails API operation for AWS Identity and Access Management.

Generates a request for a report that includes details about when an IAM resource (user, group, role, or policy) was last used in an attempt to access AWS services. Recent activity usually appears within four hours. IAM reports activity for the last 365 days, or less if your region began supporting this feature within the last year. For more information, see Regions Where Data Is Tracked (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_access-advisor.html#access-advisor_tracking-period).

The service last accessed data includes all attempts to access an AWS API, not just the successful ones. This includes all attempts that were made using the AWS Management Console, the AWS API through any of the SDKs, or any of the command line tools. An unexpected entry in the service last accessed data does not mean that your account has been compromised, because the request might have been denied. Refer to your CloudTrail logs as the authoritative source for information about all API calls and whether they were successful or denied access. For more information, see Logging IAM Events with CloudTrail (https://docs.aws.amazon.com/IAM/latest/UserGuide/cloudtrail-integration.html) in the IAM User Guide.

The GenerateServiceLastAccessedDetails operation returns a JobId. Use this parameter in the following operations to retrieve the following details from your report:

  • GetServiceLastAccessedDetails – Use this operation for users, groups, roles, or policies to list every AWS service that the resource could access using permissions policies. For each service, the response includes information about the most recent access attempt.

  • GetServiceLastAccessedDetailsWithEntities – Use this operation for groups and policies to list information about the associated entities (users or roles) that attempted to access a specific AWS service.

To check the status of the GenerateServiceLastAccessedDetails request, use the JobId parameter in the same operations and test the JobStatus response parameter.

For additional information about the permissions policies that allow an identity (user, group, or role) to access specific services, use the ListPoliciesGrantingServiceAccess operation.

Service last accessed data does not use other policy types when determining whether a resource could access a service. These other policy types include resource-based policies, access control lists, AWS Organizations policies, IAM permissions boundaries, and AWS STS assume role policies. It only applies permissions policy logic. For more about the evaluation of policy types, see Evaluating Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_evaluation-logic.html#policy-eval-basics) in the IAM User Guide.

For more information about service last accessed data, see Reducing Policy Scope by Viewing User Activity (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_access-advisor.html) in the IAM User Guide.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation GenerateServiceLastAccessedDetails for usage and error information.

Returned Error Codes:

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeInvalidInputException "InvalidInput" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GenerateServiceLastAccessedDetails

Example

IAM GenerateServiceLastAccessedDetails shared00

To generate a service last accessed data report for a policy

The following operation generates a report for the policy: ExamplePolicy1

{ svc := iam.New(session.New()) input := &iam.GenerateServiceLastAccessedDetailsInput{ Arn: aws.String("arn:aws:iam::123456789012:policy/ExamplePolicy1"), } result, err := svc.GenerateServiceLastAccessedDetails(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case iam.ErrCodeNoSuchEntityException: fmt.Println(iam.ErrCodeNoSuchEntityException, aerr.Error()) case iam.ErrCodeInvalidInputException: fmt.Println(iam.ErrCodeInvalidInputException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

GenerateServiceLastAccessedDetailsRequest

func (c *IAM) GenerateServiceLastAccessedDetailsRequest(input *GenerateServiceLastAccessedDetailsInput) (req *request.Request, output *GenerateServiceLastAccessedDetailsOutput)

GenerateServiceLastAccessedDetailsRequest generates a "aws/request.Request" representing the client's request for the GenerateServiceLastAccessedDetails operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See GenerateServiceLastAccessedDetails for more information on using the GenerateServiceLastAccessedDetails API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the GenerateServiceLastAccessedDetailsRequest method. req, resp := client.GenerateServiceLastAccessedDetailsRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GenerateServiceLastAccessedDetails

GenerateServiceLastAccessedDetailsWithContext

func (c *IAM) GenerateServiceLastAccessedDetailsWithContext(ctx aws.Context, input *GenerateServiceLastAccessedDetailsInput, opts ...request.Option) (*GenerateServiceLastAccessedDetailsOutput, error)

GenerateServiceLastAccessedDetailsWithContext is the same as GenerateServiceLastAccessedDetails with the addition of the ability to pass a context and additional request options.

See GenerateServiceLastAccessedDetails for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

GetAccessKeyLastUsed

func (c *IAM) GetAccessKeyLastUsed(input *GetAccessKeyLastUsedInput) (*GetAccessKeyLastUsedOutput, error)

GetAccessKeyLastUsed API operation for AWS Identity and Access Management.

Retrieves information about when the specified access key was last used. The information includes the date and time of last use, along with the AWS service and region that were specified in the last request made with that key.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation GetAccessKeyLastUsed for usage and error information.

Returned Error Codes:

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetAccessKeyLastUsed

GetAccessKeyLastUsedRequest

func (c *IAM) GetAccessKeyLastUsedRequest(input *GetAccessKeyLastUsedInput) (req *request.Request, output *GetAccessKeyLastUsedOutput)

GetAccessKeyLastUsedRequest generates a "aws/request.Request" representing the client's request for the GetAccessKeyLastUsed operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See GetAccessKeyLastUsed for more information on using the GetAccessKeyLastUsed API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the GetAccessKeyLastUsedRequest method. req, resp := client.GetAccessKeyLastUsedRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetAccessKeyLastUsed

GetAccessKeyLastUsedWithContext

func (c *IAM) GetAccessKeyLastUsedWithContext(ctx aws.Context, input *GetAccessKeyLastUsedInput, opts ...request.Option) (*GetAccessKeyLastUsedOutput, error)

GetAccessKeyLastUsedWithContext is the same as GetAccessKeyLastUsed with the addition of the ability to pass a context and additional request options.

See GetAccessKeyLastUsed for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

GetAccountAuthorizationDetails

func (c *IAM) GetAccountAuthorizationDetails(input *GetAccountAuthorizationDetailsInput) (*GetAccountAuthorizationDetailsOutput, error)

GetAccountAuthorizationDetails API operation for AWS Identity and Access Management.

Retrieves information about all IAM users, groups, roles, and policies in your AWS account, including their relationships to one another. Use this API to obtain a snapshot of the configuration of IAM permissions (users, groups, roles, and policies) in your account.

Policies returned by this API are URL-encoded compliant with RFC 3986 (https://tools.ietf.org/html/rfc3986). You can use a URL decoding method to convert the policy back to plain JSON text. For example, if you use Java, you can use the decode method of the java.net.URLDecoder utility class in the Java SDK. Other languages and SDKs provide similar functionality.

You can optionally filter the results using the Filter parameter. You can paginate the results using the MaxItems and Marker parameters.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation GetAccountAuthorizationDetails for usage and error information.

Returned Error Codes:

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetAccountAuthorizationDetails

GetAccountAuthorizationDetailsPages

func (c *IAM) GetAccountAuthorizationDetailsPages(input *GetAccountAuthorizationDetailsInput, fn func(*GetAccountAuthorizationDetailsOutput, bool) bool) error

GetAccountAuthorizationDetailsPages iterates over the pages of a GetAccountAuthorizationDetails operation, calling the "fn" function with the response data for each page. To stop iterating, return false from the fn function.

See GetAccountAuthorizationDetails method for more information on how to use this operation.

Note: This operation can generate multiple requests to a service.

// Example iterating over at most 3 pages of a GetAccountAuthorizationDetails operation. pageNum := 0 err := client.GetAccountAuthorizationDetailsPages(params, func(page *GetAccountAuthorizationDetailsOutput, lastPage bool) bool { pageNum++ fmt.Println(page) return pageNum <= 3 })

See Also

For more information about using this API, see AWS API Documentation.

GetAccountAuthorizationDetailsPagesWithContext

func (c *IAM) GetAccountAuthorizationDetailsPagesWithContext(ctx aws.Context, input *GetAccountAuthorizationDetailsInput, fn func(*GetAccountAuthorizationDetailsOutput, bool) bool, opts ...request.Option) error

GetAccountAuthorizationDetailsPagesWithContext same as GetAccountAuthorizationDetailsPages except it takes a Context and allows setting request options on the pages.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

GetAccountAuthorizationDetailsRequest

func (c *IAM) GetAccountAuthorizationDetailsRequest(input *GetAccountAuthorizationDetailsInput) (req *request.Request, output *GetAccountAuthorizationDetailsOutput)

GetAccountAuthorizationDetailsRequest generates a "aws/request.Request" representing the client's request for the GetAccountAuthorizationDetails operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See GetAccountAuthorizationDetails for more information on using the GetAccountAuthorizationDetails API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the GetAccountAuthorizationDetailsRequest method. req, resp := client.GetAccountAuthorizationDetailsRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetAccountAuthorizationDetails

GetAccountAuthorizationDetailsWithContext

func (c *IAM) GetAccountAuthorizationDetailsWithContext(ctx aws.Context, input *GetAccountAuthorizationDetailsInput, opts ...request.Option) (*GetAccountAuthorizationDetailsOutput, error)

GetAccountAuthorizationDetailsWithContext is the same as GetAccountAuthorizationDetails with the addition of the ability to pass a context and additional request options.

See GetAccountAuthorizationDetails for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

GetAccountPasswordPolicy

func (c *IAM) GetAccountPasswordPolicy(input *GetAccountPasswordPolicyInput) (*GetAccountPasswordPolicyOutput, error)

GetAccountPasswordPolicy API operation for AWS Identity and Access Management.

Retrieves the password policy for the AWS account. For more information about using a password policy, go to Managing an IAM Password Policy (https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_ManagingPasswordPolicies.html).

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation GetAccountPasswordPolicy for usage and error information.

Returned Error Codes:

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetAccountPasswordPolicy

Example

IAM GetAccountPasswordPolicy shared00

To see the current account password policy

The following command displays details about the password policy for the current AWS account.

{ svc := iam.New(session.New()) input := &iam.GetAccountPasswordPolicyInput{} result, err := svc.GetAccountPasswordPolicy(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case iam.ErrCodeNoSuchEntityException: fmt.Println(iam.ErrCodeNoSuchEntityException, aerr.Error()) case iam.ErrCodeServiceFailureException: fmt.Println(iam.ErrCodeServiceFailureException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

GetAccountPasswordPolicyRequest

func (c *IAM) GetAccountPasswordPolicyRequest(input *GetAccountPasswordPolicyInput) (req *request.Request, output *GetAccountPasswordPolicyOutput)

GetAccountPasswordPolicyRequest generates a "aws/request.Request" representing the client's request for the GetAccountPasswordPolicy operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See GetAccountPasswordPolicy for more information on using the GetAccountPasswordPolicy API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the GetAccountPasswordPolicyRequest method. req, resp := client.GetAccountPasswordPolicyRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetAccountPasswordPolicy

GetAccountPasswordPolicyWithContext

func (c *IAM) GetAccountPasswordPolicyWithContext(ctx aws.Context, input *GetAccountPasswordPolicyInput, opts ...request.Option) (*GetAccountPasswordPolicyOutput, error)

GetAccountPasswordPolicyWithContext is the same as GetAccountPasswordPolicy with the addition of the ability to pass a context and additional request options.

See GetAccountPasswordPolicy for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

GetAccountSummary

func (c *IAM) GetAccountSummary(input *GetAccountSummaryInput) (*GetAccountSummaryOutput, error)

GetAccountSummary API operation for AWS Identity and Access Management.

Retrieves information about IAM entity usage and IAM quotas in the AWS account.

For information about limitations on IAM entities, see Limitations on IAM Entities (https://docs.aws.amazon.com/IAM/latest/UserGuide/LimitationsOnEntities.html) in the IAM User Guide.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation GetAccountSummary for usage and error information.

Returned Error Codes:

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetAccountSummary

Example

IAM GetAccountSummary shared00

To get information about IAM entity quotas and usage in the current account

The following command returns information about the IAM entity quotas and usage in the current AWS account.

{ svc := iam.New(session.New()) input := &iam.GetAccountSummaryInput{} result, err := svc.GetAccountSummary(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case iam.ErrCodeServiceFailureException: fmt.Println(iam.ErrCodeServiceFailureException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

GetAccountSummaryRequest

func (c *IAM) GetAccountSummaryRequest(input *GetAccountSummaryInput) (req *request.Request, output *GetAccountSummaryOutput)

GetAccountSummaryRequest generates a "aws/request.Request" representing the client's request for the GetAccountSummary operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See GetAccountSummary for more information on using the GetAccountSummary API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the GetAccountSummaryRequest method. req, resp := client.GetAccountSummaryRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetAccountSummary

GetAccountSummaryWithContext

func (c *IAM) GetAccountSummaryWithContext(ctx aws.Context, input *GetAccountSummaryInput, opts ...request.Option) (*GetAccountSummaryOutput, error)

GetAccountSummaryWithContext is the same as GetAccountSummary with the addition of the ability to pass a context and additional request options.

See GetAccountSummary for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

GetContextKeysForCustomPolicy

func (c *IAM) GetContextKeysForCustomPolicy(input *GetContextKeysForCustomPolicyInput) (*GetContextKeysForPolicyResponse, error)

GetContextKeysForCustomPolicy API operation for AWS Identity and Access Management.

Gets a list of all of the context keys referenced in the input policies. The policies are supplied as a list of one or more strings. To get the context keys from policies associated with an IAM user, group, or role, use GetContextKeysForPrincipalPolicy.

Context keys are variables maintained by AWS and its services that provide details about the context of an API query request. Context keys can be evaluated by testing against a value specified in an IAM policy. Use GetContextKeysForCustomPolicy to understand what key names and values you must supply when you call SimulateCustomPolicy. Note that all parameters are shown in unencoded form here for clarity but must be URL encoded to be included as a part of a real HTML request.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation GetContextKeysForCustomPolicy for usage and error information.

Returned Error Codes:

  • ErrCodeInvalidInputException "InvalidInput" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetContextKeysForCustomPolicy

GetContextKeysForCustomPolicyRequest

func (c *IAM) GetContextKeysForCustomPolicyRequest(input *GetContextKeysForCustomPolicyInput) (req *request.Request, output *GetContextKeysForPolicyResponse)

GetContextKeysForCustomPolicyRequest generates a "aws/request.Request" representing the client's request for the GetContextKeysForCustomPolicy operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See GetContextKeysForCustomPolicy for more information on using the GetContextKeysForCustomPolicy API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the GetContextKeysForCustomPolicyRequest method. req, resp := client.GetContextKeysForCustomPolicyRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetContextKeysForCustomPolicy

GetContextKeysForCustomPolicyWithContext

func (c *IAM) GetContextKeysForCustomPolicyWithContext(ctx aws.Context, input *GetContextKeysForCustomPolicyInput, opts ...request.Option) (*GetContextKeysForPolicyResponse, error)

GetContextKeysForCustomPolicyWithContext is the same as GetContextKeysForCustomPolicy with the addition of the ability to pass a context and additional request options.

See GetContextKeysForCustomPolicy for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

GetContextKeysForPrincipalPolicy

func (c *IAM) GetContextKeysForPrincipalPolicy(input *GetContextKeysForPrincipalPolicyInput) (*GetContextKeysForPolicyResponse, error)

GetContextKeysForPrincipalPolicy API operation for AWS Identity and Access Management.

Gets a list of all of the context keys referenced in all the IAM policies that are attached to the specified IAM entity. The entity can be an IAM user, group, or role. If you specify a user, then the request also includes all of the policies attached to groups that the user is a member of.

You can optionally include a list of one or more additional policies, specified as strings. If you want to include only a list of policies by string, use GetContextKeysForCustomPolicy instead.

Note: This API discloses information about the permissions granted to other users. If you do not want users to see other user's permissions, then consider allowing them to use GetContextKeysForCustomPolicy instead.

Context keys are variables maintained by AWS and its services that provide details about the context of an API query request. Context keys can be evaluated by testing against a value in an IAM policy. Use GetContextKeysForPrincipalPolicy to understand what key names and values you must supply when you call SimulatePrincipalPolicy.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation GetContextKeysForPrincipalPolicy for usage and error information.

Returned Error Codes:

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeInvalidInputException "InvalidInput" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetContextKeysForPrincipalPolicy

GetContextKeysForPrincipalPolicyRequest

func (c *IAM) GetContextKeysForPrincipalPolicyRequest(input *GetContextKeysForPrincipalPolicyInput) (req *request.Request, output *GetContextKeysForPolicyResponse)

GetContextKeysForPrincipalPolicyRequest generates a "aws/request.Request" representing the client's request for the GetContextKeysForPrincipalPolicy operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See GetContextKeysForPrincipalPolicy for more information on using the GetContextKeysForPrincipalPolicy API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the GetContextKeysForPrincipalPolicyRequest method. req, resp := client.GetContextKeysForPrincipalPolicyRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetContextKeysForPrincipalPolicy

GetContextKeysForPrincipalPolicyWithContext

func (c *IAM) GetContextKeysForPrincipalPolicyWithContext(ctx aws.Context, input *GetContextKeysForPrincipalPolicyInput, opts ...request.Option) (*GetContextKeysForPolicyResponse, error)

GetContextKeysForPrincipalPolicyWithContext is the same as GetContextKeysForPrincipalPolicy with the addition of the ability to pass a context and additional request options.

See GetContextKeysForPrincipalPolicy for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

GetCredentialReport

func (c *IAM) GetCredentialReport(input *GetCredentialReportInput) (*GetCredentialReportOutput, error)

GetCredentialReport API operation for AWS Identity and Access Management.

Retrieves a credential report for the AWS account. For more information about the credential report, see Getting Credential Reports (https://docs.aws.amazon.com/IAM/latest/UserGuide/credential-reports.html) in the IAM User Guide.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation GetCredentialReport for usage and error information.

Returned Error Codes:

  • ErrCodeCredentialReportNotPresentException "ReportNotPresent" The request was rejected because the credential report does not exist. To generate a credential report, use GenerateCredentialReport.

  • ErrCodeCredentialReportExpiredException "ReportExpired" The request was rejected because the most recent credential report has expired. To generate a new credential report, use GenerateCredentialReport. For more information about credential report expiration, see Getting Credential Reports

(http://docs.aws.amazon.com/IAM/latest/UserGuide/credential-reports.html) in the IAM User Guide.
  • ErrCodeCredentialReportNotReadyException "ReportInProgress" The request was rejected because the credential report is still being generated.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetCredentialReport

GetCredentialReportRequest

func (c *IAM) GetCredentialReportRequest(input *GetCredentialReportInput) (req *request.Request, output *GetCredentialReportOutput)

GetCredentialReportRequest generates a "aws/request.Request" representing the client's request for the GetCredentialReport operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See GetCredentialReport for more information on using the GetCredentialReport API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the GetCredentialReportRequest method. req, resp := client.GetCredentialReportRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetCredentialReport

GetCredentialReportWithContext

func (c *IAM) GetCredentialReportWithContext(ctx aws.Context, input *GetCredentialReportInput, opts ...request.Option) (*GetCredentialReportOutput, error)

GetCredentialReportWithContext is the same as GetCredentialReport with the addition of the ability to pass a context and additional request options.

See GetCredentialReport for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

GetGroup

func (c *IAM) GetGroup(input *GetGroupInput) (*GetGroupOutput, error)

GetGroup API operation for AWS Identity and Access Management.

Returns a list of IAM users that are in the specified IAM group. You can paginate the results using the MaxItems and Marker parameters.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation GetGroup for usage and error information.

Returned Error Codes:

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetGroup

GetGroupPages

func (c *IAM) GetGroupPages(input *GetGroupInput, fn func(*GetGroupOutput, bool) bool) error

GetGroupPages iterates over the pages of a GetGroup operation, calling the "fn" function with the response data for each page. To stop iterating, return false from the fn function.

See GetGroup method for more information on how to use this operation.

Note: This operation can generate multiple requests to a service.

// Example iterating over at most 3 pages of a GetGroup operation. pageNum := 0 err := client.GetGroupPages(params, func(page *GetGroupOutput, lastPage bool) bool { pageNum++ fmt.Println(page) return pageNum <= 3 })

See Also

For more information about using this API, see AWS API Documentation.

GetGroupPagesWithContext

func (c *IAM) GetGroupPagesWithContext(ctx aws.Context, input *GetGroupInput, fn func(*GetGroupOutput, bool) bool, opts ...request.Option) error

GetGroupPagesWithContext same as GetGroupPages except it takes a Context and allows setting request options on the pages.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

GetGroupPolicy

func (c *IAM) GetGroupPolicy(input *GetGroupPolicyInput) (*GetGroupPolicyOutput, error)

GetGroupPolicy API operation for AWS Identity and Access Management.

Retrieves the specified inline policy document that is embedded in the specified IAM group.

Policies returned by this API are URL-encoded compliant with RFC 3986 (https://tools.ietf.org/html/rfc3986). You can use a URL decoding method to convert the policy back to plain JSON text. For example, if you use Java, you can use the decode method of the java.net.URLDecoder utility class in the Java SDK. Other languages and SDKs provide similar functionality.

An IAM group can also have managed policies attached to it. To retrieve a managed policy document that is attached to a group, use GetPolicy to determine the policy's default version, then use GetPolicyVersion to retrieve the policy document.

For more information about policies, see Managed Policies and Inline Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) in the IAM User Guide.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation GetGroupPolicy for usage and error information.

Returned Error Codes:

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetGroupPolicy

GetGroupPolicyRequest

func (c *IAM) GetGroupPolicyRequest(input *GetGroupPolicyInput) (req *request.Request, output *GetGroupPolicyOutput)

GetGroupPolicyRequest generates a "aws/request.Request" representing the client's request for the GetGroupPolicy operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See GetGroupPolicy for more information on using the GetGroupPolicy API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the GetGroupPolicyRequest method. req, resp := client.GetGroupPolicyRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetGroupPolicy

GetGroupPolicyWithContext

func (c *IAM) GetGroupPolicyWithContext(ctx aws.Context, input *GetGroupPolicyInput, opts ...request.Option) (*GetGroupPolicyOutput, error)

GetGroupPolicyWithContext is the same as GetGroupPolicy with the addition of the ability to pass a context and additional request options.

See GetGroupPolicy for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

GetGroupRequest

func (c *IAM) GetGroupRequest(input *GetGroupInput) (req *request.Request, output *GetGroupOutput)

GetGroupRequest generates a "aws/request.Request" representing the client's request for the GetGroup operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See GetGroup for more information on using the GetGroup API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the GetGroupRequest method. req, resp := client.GetGroupRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetGroup

GetGroupWithContext

func (c *IAM) GetGroupWithContext(ctx aws.Context, input *GetGroupInput, opts ...request.Option) (*GetGroupOutput, error)

GetGroupWithContext is the same as GetGroup with the addition of the ability to pass a context and additional request options.

See GetGroup for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

GetInstanceProfile

func (c *IAM) GetInstanceProfile(input *GetInstanceProfileInput) (*GetInstanceProfileOutput, error)

GetInstanceProfile API operation for AWS Identity and Access Management.

Retrieves information about the specified instance profile, including the instance profile's path, GUID, ARN, and role. For more information about instance profiles, see About Instance Profiles (https://docs.aws.amazon.com/IAM/latest/UserGuide/AboutInstanceProfiles.html) in the IAM User Guide.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation GetInstanceProfile for usage and error information.

Returned Error Codes:

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetInstanceProfile

Example

IAM GetInstanceProfile shared00

To get information about an instance profile

The following command gets information about the instance profile named ExampleInstanceProfile.

{ svc := iam.New(session.New()) input := &iam.GetInstanceProfileInput{ InstanceProfileName: aws.String("ExampleInstanceProfile"), } result, err := svc.GetInstanceProfile(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case iam.ErrCodeNoSuchEntityException: fmt.Println(iam.ErrCodeNoSuchEntityException, aerr.Error()) case iam.ErrCodeServiceFailureException: fmt.Println(iam.ErrCodeServiceFailureException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

GetInstanceProfileRequest

func (c *IAM) GetInstanceProfileRequest(input *GetInstanceProfileInput) (req *request.Request, output *GetInstanceProfileOutput)

GetInstanceProfileRequest generates a "aws/request.Request" representing the client's request for the GetInstanceProfile operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See GetInstanceProfile for more information on using the GetInstanceProfile API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the GetInstanceProfileRequest method. req, resp := client.GetInstanceProfileRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetInstanceProfile

GetInstanceProfileWithContext

func (c *IAM) GetInstanceProfileWithContext(ctx aws.Context, input *GetInstanceProfileInput, opts ...request.Option) (*GetInstanceProfileOutput, error)

GetInstanceProfileWithContext is the same as GetInstanceProfile with the addition of the ability to pass a context and additional request options.

See GetInstanceProfile for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

GetLoginProfile

func (c *IAM) GetLoginProfile(input *GetLoginProfileInput) (*GetLoginProfileOutput, error)

GetLoginProfile API operation for AWS Identity and Access Management.

Retrieves the user name and password-creation date for the specified IAM user. If the user has not been assigned a password, the operation returns a 404 (NoSuchEntity) error.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation GetLoginProfile for usage and error information.

Returned Error Codes:

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetLoginProfile

Example

IAM GetLoginProfile shared00

To get password information for an IAM user

The following command gets information about the password for the IAM user named Anika.

{ svc := iam.New(session.New()) input := &iam.GetLoginProfileInput{ UserName: aws.String("Anika"), } result, err := svc.GetLoginProfile(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case iam.ErrCodeNoSuchEntityException: fmt.Println(iam.ErrCodeNoSuchEntityException, aerr.Error()) case iam.ErrCodeServiceFailureException: fmt.Println(iam.ErrCodeServiceFailureException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

GetLoginProfileRequest

func (c *IAM) GetLoginProfileRequest(input *GetLoginProfileInput) (req *request.Request, output *GetLoginProfileOutput)

GetLoginProfileRequest generates a "aws/request.Request" representing the client's request for the GetLoginProfile operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See GetLoginProfile for more information on using the GetLoginProfile API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the GetLoginProfileRequest method. req, resp := client.GetLoginProfileRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetLoginProfile

GetLoginProfileWithContext

func (c *IAM) GetLoginProfileWithContext(ctx aws.Context, input *GetLoginProfileInput, opts ...request.Option) (*GetLoginProfileOutput, error)

GetLoginProfileWithContext is the same as GetLoginProfile with the addition of the ability to pass a context and additional request options.

See GetLoginProfile for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

GetOpenIDConnectProvider

func (c *IAM) GetOpenIDConnectProvider(input *GetOpenIDConnectProviderInput) (*GetOpenIDConnectProviderOutput, error)

GetOpenIDConnectProvider API operation for AWS Identity and Access Management.

Returns information about the specified OpenID Connect (OIDC) provider resource object in IAM.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation GetOpenIDConnectProvider for usage and error information.

Returned Error Codes:

  • ErrCodeInvalidInputException "InvalidInput" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetOpenIDConnectProvider

GetOpenIDConnectProviderRequest

func (c *IAM) GetOpenIDConnectProviderRequest(input *GetOpenIDConnectProviderInput) (req *request.Request, output *GetOpenIDConnectProviderOutput)

GetOpenIDConnectProviderRequest generates a "aws/request.Request" representing the client's request for the GetOpenIDConnectProvider operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See GetOpenIDConnectProvider for more information on using the GetOpenIDConnectProvider API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the GetOpenIDConnectProviderRequest method. req, resp := client.GetOpenIDConnectProviderRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetOpenIDConnectProvider

GetOpenIDConnectProviderWithContext

func (c *IAM) GetOpenIDConnectProviderWithContext(ctx aws.Context, input *GetOpenIDConnectProviderInput, opts ...request.Option) (*GetOpenIDConnectProviderOutput, error)

GetOpenIDConnectProviderWithContext is the same as GetOpenIDConnectProvider with the addition of the ability to pass a context and additional request options.

See GetOpenIDConnectProvider for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

GetPolicy

func (c *IAM) GetPolicy(input *GetPolicyInput) (*GetPolicyOutput, error)

GetPolicy API operation for AWS Identity and Access Management.

Retrieves information about the specified managed policy, including the policy's default version and the total number of IAM users, groups, and roles to which the policy is attached. To retrieve the list of the specific users, groups, and roles that the policy is attached to, use the ListEntitiesForPolicy API. This API returns metadata about the policy. To retrieve the actual policy document for a specific version of the policy, use GetPolicyVersion.

This API retrieves information about managed policies. To retrieve information about an inline policy that is embedded with an IAM user, group, or role, use the GetUserPolicy, GetGroupPolicy, or GetRolePolicy API.

For more information about policies, see Managed Policies and Inline Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) in the IAM User Guide.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation GetPolicy for usage and error information.

Returned Error Codes:

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeInvalidInputException "InvalidInput" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetPolicy

GetPolicyRequest

func (c *IAM) GetPolicyRequest(input *GetPolicyInput) (req *request.Request, output *GetPolicyOutput)

GetPolicyRequest generates a "aws/request.Request" representing the client's request for the GetPolicy operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See GetPolicy for more information on using the GetPolicy API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the GetPolicyRequest method. req, resp := client.GetPolicyRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetPolicy

GetPolicyVersion

func (c *IAM) GetPolicyVersion(input *GetPolicyVersionInput) (*GetPolicyVersionOutput, error)

GetPolicyVersion API operation for AWS Identity and Access Management.

Retrieves information about the specified version of the specified managed policy, including the policy document.

Policies returned by this API are URL-encoded compliant with RFC 3986 (https://tools.ietf.org/html/rfc3986). You can use a URL decoding method to convert the policy back to plain JSON text. For example, if you use Java, you can use the decode method of the java.net.URLDecoder utility class in the Java SDK. Other languages and SDKs provide similar functionality.

To list the available versions for a policy, use ListPolicyVersions.

This API retrieves information about managed policies. To retrieve information about an inline policy that is embedded in a user, group, or role, use the GetUserPolicy, GetGroupPolicy, or GetRolePolicy API.

For more information about the types of policies, see Managed Policies and Inline Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) in the IAM User Guide.

For more information about managed policy versions, see Versioning for Managed Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-versions.html) in the IAM User Guide.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation GetPolicyVersion for usage and error information.

Returned Error Codes:

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeInvalidInputException "InvalidInput" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetPolicyVersion

GetPolicyVersionRequest

func (c *IAM) GetPolicyVersionRequest(input *GetPolicyVersionInput) (req *request.Request, output *GetPolicyVersionOutput)

GetPolicyVersionRequest generates a "aws/request.Request" representing the client's request for the GetPolicyVersion operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See GetPolicyVersion for more information on using the GetPolicyVersion API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the GetPolicyVersionRequest method. req, resp := client.GetPolicyVersionRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetPolicyVersion

GetPolicyVersionWithContext

func (c *IAM) GetPolicyVersionWithContext(ctx aws.Context, input *GetPolicyVersionInput, opts ...request.Option) (*GetPolicyVersionOutput, error)

GetPolicyVersionWithContext is the same as GetPolicyVersion with the addition of the ability to pass a context and additional request options.

See GetPolicyVersion for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

GetPolicyWithContext

func (c *IAM) GetPolicyWithContext(ctx aws.Context, input *GetPolicyInput, opts ...request.Option) (*GetPolicyOutput, error)

GetPolicyWithContext is the same as GetPolicy with the addition of the ability to pass a context and additional request options.

See GetPolicy for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

GetRole

func (c *IAM) GetRole(input *GetRoleInput) (*GetRoleOutput, error)

GetRole API operation for AWS Identity and Access Management.

Retrieves information about the specified role, including the role's path, GUID, ARN, and the role's trust policy that grants permission to assume the role. For more information about roles, see Working with Roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/WorkingWithRoles.html).

Policies returned by this API are URL-encoded compliant with RFC 3986 (https://tools.ietf.org/html/rfc3986). You can use a URL decoding method to convert the policy back to plain JSON text. For example, if you use Java, you can use the decode method of the java.net.URLDecoder utility class in the Java SDK. Other languages and SDKs provide similar functionality.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation GetRole for usage and error information.

Returned Error Codes:

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetRole

Example

IAM GetRole shared00

To get information about an IAM role

The following command gets information about the role named Test-Role.

{ svc := iam.New(session.New()) input := &iam.GetRoleInput{ RoleName: aws.String("Test-Role"), } result, err := svc.GetRole(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case iam.ErrCodeNoSuchEntityException: fmt.Println(iam.ErrCodeNoSuchEntityException, aerr.Error()) case iam.ErrCodeServiceFailureException: fmt.Println(iam.ErrCodeServiceFailureException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

GetRolePolicy

func (c *IAM) GetRolePolicy(input *GetRolePolicyInput) (*GetRolePolicyOutput, error)

GetRolePolicy API operation for AWS Identity and Access Management.

Retrieves the specified inline policy document that is embedded with the specified IAM role.

Policies returned by this API are URL-encoded compliant with RFC 3986 (https://tools.ietf.org/html/rfc3986). You can use a URL decoding method to convert the policy back to plain JSON text. For example, if you use Java, you can use the decode method of the java.net.URLDecoder utility class in the Java SDK. Other languages and SDKs provide similar functionality.

An IAM role can also have managed policies attached to it. To retrieve a managed policy document that is attached to a role, use GetPolicy to determine the policy's default version, then use GetPolicyVersion to retrieve the policy document.

For more information about policies, see Managed Policies and Inline Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) in the IAM User Guide.

For more information about roles, see Using Roles to Delegate Permissions and Federate Identities (https://docs.aws.amazon.com/IAM/latest/UserGuide/roles-toplevel.html).

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation GetRolePolicy for usage and error information.

Returned Error Codes:

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetRolePolicy

GetRolePolicyRequest

func (c *IAM) GetRolePolicyRequest(input *GetRolePolicyInput) (req *request.Request, output *GetRolePolicyOutput)

GetRolePolicyRequest generates a "aws/request.Request" representing the client's request for the GetRolePolicy operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See GetRolePolicy for more information on using the GetRolePolicy API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the GetRolePolicyRequest method. req, resp := client.GetRolePolicyRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetRolePolicy

GetRolePolicyWithContext

func (c *IAM) GetRolePolicyWithContext(ctx aws.Context, input *GetRolePolicyInput, opts ...request.Option) (*GetRolePolicyOutput, error)

GetRolePolicyWithContext is the same as GetRolePolicy with the addition of the ability to pass a context and additional request options.

See GetRolePolicy for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

GetRoleRequest

func (c *IAM) GetRoleRequest(input *GetRoleInput) (req *request.Request, output *GetRoleOutput)

GetRoleRequest generates a "aws/request.Request" representing the client's request for the GetRole operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See GetRole for more information on using the GetRole API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the GetRoleRequest method. req, resp := client.GetRoleRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetRole

GetRoleWithContext

func (c *IAM) GetRoleWithContext(ctx aws.Context, input *GetRoleInput, opts ...request.Option) (*GetRoleOutput, error)

GetRoleWithContext is the same as GetRole with the addition of the ability to pass a context and additional request options.

See GetRole for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

GetSAMLProvider

func (c *IAM) GetSAMLProvider(input *GetSAMLProviderInput) (*GetSAMLProviderOutput, error)

GetSAMLProvider API operation for AWS Identity and Access Management.

Returns the SAML provider metadocument that was uploaded when the IAM SAML provider resource object was created or updated.

This operation requires Signature Version 4 (https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html).

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation GetSAMLProvider for usage and error information.

Returned Error Codes:

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeInvalidInputException "InvalidInput" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetSAMLProvider

GetSAMLProviderRequest

func (c *IAM) GetSAMLProviderRequest(input *GetSAMLProviderInput) (req *request.Request, output *GetSAMLProviderOutput)

GetSAMLProviderRequest generates a "aws/request.Request" representing the client's request for the GetSAMLProvider operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See GetSAMLProvider for more information on using the GetSAMLProvider API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the GetSAMLProviderRequest method. req, resp := client.GetSAMLProviderRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetSAMLProvider

GetSAMLProviderWithContext

func (c *IAM) GetSAMLProviderWithContext(ctx aws.Context, input *GetSAMLProviderInput, opts ...request.Option) (*GetSAMLProviderOutput, error)

GetSAMLProviderWithContext is the same as GetSAMLProvider with the addition of the ability to pass a context and additional request options.

See GetSAMLProvider for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

GetSSHPublicKey

func (c *IAM) GetSSHPublicKey(input *GetSSHPublicKeyInput) (*GetSSHPublicKeyOutput, error)

GetSSHPublicKey API operation for AWS Identity and Access Management.

Retrieves the specified SSH public key, including metadata about the key.

The SSH public key retrieved by this operation is used only for authenticating the associated IAM user to an AWS CodeCommit repository. For more information about using SSH keys to authenticate to an AWS CodeCommit repository, see Set up AWS CodeCommit for SSH Connections (https://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-credentials-ssh.html) in the AWS CodeCommit User Guide.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation GetSSHPublicKey for usage and error information.

Returned Error Codes:

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeUnrecognizedPublicKeyEncodingException "UnrecognizedPublicKeyEncoding" The request was rejected because the public key encoding format is unsupported or unrecognized.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetSSHPublicKey

GetSSHPublicKeyRequest

func (c *IAM) GetSSHPublicKeyRequest(input *GetSSHPublicKeyInput) (req *request.Request, output *GetSSHPublicKeyOutput)

GetSSHPublicKeyRequest generates a "aws/request.Request" representing the client's request for the GetSSHPublicKey operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See GetSSHPublicKey for more information on using the GetSSHPublicKey API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the GetSSHPublicKeyRequest method. req, resp := client.GetSSHPublicKeyRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetSSHPublicKey

GetSSHPublicKeyWithContext

func (c *IAM) GetSSHPublicKeyWithContext(ctx aws.Context, input *GetSSHPublicKeyInput, opts ...request.Option) (*GetSSHPublicKeyOutput, error)

GetSSHPublicKeyWithContext is the same as GetSSHPublicKey with the addition of the ability to pass a context and additional request options.

See GetSSHPublicKey for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

GetServerCertificate

func (c *IAM) GetServerCertificate(input *GetServerCertificateInput) (*GetServerCertificateOutput, error)

GetServerCertificate API operation for AWS Identity and Access Management.

Retrieves information about the specified server certificate stored in IAM.

For more information about working with server certificates, see Working with Server Certificates (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_server-certs.html) in the IAM User Guide. This topic includes a list of AWS services that can use the server certificates that you manage with IAM.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation GetServerCertificate for usage and error information.

Returned Error Codes:

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetServerCertificate

GetServerCertificateRequest

func (c *IAM) GetServerCertificateRequest(input *GetServerCertificateInput) (req *request.Request, output *GetServerCertificateOutput)

GetServerCertificateRequest generates a "aws/request.Request" representing the client's request for the GetServerCertificate operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See GetServerCertificate for more information on using the GetServerCertificate API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the GetServerCertificateRequest method. req, resp := client.GetServerCertificateRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetServerCertificate

GetServerCertificateWithContext

func (c *IAM) GetServerCertificateWithContext(ctx aws.Context, input *GetServerCertificateInput, opts ...request.Option) (*GetServerCertificateOutput, error)

GetServerCertificateWithContext is the same as GetServerCertificate with the addition of the ability to pass a context and additional request options.

See GetServerCertificate for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

GetServiceLastAccessedDetails

func (c *IAM) GetServiceLastAccessedDetails(input *GetServiceLastAccessedDetailsInput) (*GetServiceLastAccessedDetailsOutput, error)

GetServiceLastAccessedDetails API operation for AWS Identity and Access Management.

After you generate a user, group, role, or policy report using the GenerateServiceLastAccessedDetails operation, you can use the JobId parameter in GetServiceLastAccessedDetails. This operation retrieves the status of your report job and a list of AWS services that the resource (user, group, role, or managed policy) can access.

Service last accessed data does not use other policy types when determining whether a resource could access a service. These other policy types include resource-based policies, access control lists, AWS Organizations policies, IAM permissions boundaries, and AWS STS assume role policies. It only applies permissions policy logic. For more about the evaluation of policy types, see Evaluating Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_evaluation-logic.html#policy-eval-basics) in the IAM User Guide.

For each service that the resource could access using permissions policies, the operation returns details about the most recent access attempt. If there was no attempt, the service is listed without details about the most recent attempt to access the service. If the operation fails, the GetServiceLastAccessedDetails operation returns the reason that it failed.

The GetServiceLastAccessedDetails operation returns a list of services that includes the number of entities that have attempted to access the service and the date and time of the last attempt. It also returns the ARN of the following entity, depending on the resource ARN that you used to generate the report:

  • User – Returns the user ARN that you used to generate the report

  • Group – Returns the ARN of the group member (user) that last attempted to access the service

  • Role – Returns the role ARN that you used to generate the report

  • Policy – Returns the ARN of the user or role that last used the policy to attempt to access the service

By default, the list is sorted by service namespace.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation GetServiceLastAccessedDetails for usage and error information.

Returned Error Codes:

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeInvalidInputException "InvalidInput" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetServiceLastAccessedDetails

Example

IAM GetServiceLastAccessedDetails shared00

To get details from a previously-generated report

The following operation gets details about the report with the job ID: examplef-1305-c245-eba4-71fe298bcda7

{ svc := iam.New(session.New()) input := &iam.GetServiceLastAccessedDetailsInput{ JobId: aws.String("examplef-1305-c245-eba4-71fe298bcda7"), } result, err := svc.GetServiceLastAccessedDetails(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case iam.ErrCodeNoSuchEntityException: fmt.Println(iam.ErrCodeNoSuchEntityException, aerr.Error()) case iam.ErrCodeInvalidInputException: fmt.Println(iam.ErrCodeInvalidInputException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

GetServiceLastAccessedDetailsRequest

func (c *IAM) GetServiceLastAccessedDetailsRequest(input *GetServiceLastAccessedDetailsInput) (req *request.Request, output *GetServiceLastAccessedDetailsOutput)

GetServiceLastAccessedDetailsRequest generates a "aws/request.Request" representing the client's request for the GetServiceLastAccessedDetails operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See GetServiceLastAccessedDetails for more information on using the GetServiceLastAccessedDetails API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the GetServiceLastAccessedDetailsRequest method. req, resp := client.GetServiceLastAccessedDetailsRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetServiceLastAccessedDetails

GetServiceLastAccessedDetailsWithContext

func (c *IAM) GetServiceLastAccessedDetailsWithContext(ctx aws.Context, input *GetServiceLastAccessedDetailsInput, opts ...request.Option) (*GetServiceLastAccessedDetailsOutput, error)

GetServiceLastAccessedDetailsWithContext is the same as GetServiceLastAccessedDetails with the addition of the ability to pass a context and additional request options.

See GetServiceLastAccessedDetails for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

GetServiceLastAccessedDetailsWithEntities

func (c *IAM) GetServiceLastAccessedDetailsWithEntities(input *GetServiceLastAccessedDetailsWithEntitiesInput) (*GetServiceLastAccessedDetailsWithEntitiesOutput, error)

GetServiceLastAccessedDetailsWithEntities API operation for AWS Identity and Access Management.

After you generate a group or policy report using the GenerateServiceLastAccessedDetails operation, you can use the JobId parameter in GetServiceLastAccessedDetailsWithEntities. This operation retrieves the status of your report job and a list of entities that could have used group or policy permissions to access the specified service.

  • Group – For a group report, this operation returns a list of users in the group that could have used the group’s policies in an attempt to access the service.

  • Policy – For a policy report, this operation returns a list of entities

(users or roles) that could have used the policy in an attempt to access the service.

You can also use this operation for user or role reports to retrieve details about those entities.

If the operation fails, the GetServiceLastAccessedDetailsWithEntities operation returns the reason that it failed.

By default, the list of associated entities is sorted by date, with the most recent access listed first.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation GetServiceLastAccessedDetailsWithEntities for usage and error information.

Returned Error Codes:

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeInvalidInputException "InvalidInput" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetServiceLastAccessedDetailsWithEntities

Example

IAM GetServiceLastAccessedDetailsWithEntities shared00

To get sntity details from a previously-generated report

The following operation returns details about the entities that attempted to access the IAM service.

{ svc := iam.New(session.New()) input := &iam.GetServiceLastAccessedDetailsWithEntitiesInput{ JobId: aws.String("examplef-1305-c245-eba4-71fe298bcda7"), ServiceNamespace: aws.String("iam"), } result, err := svc.GetServiceLastAccessedDetailsWithEntities(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case iam.ErrCodeNoSuchEntityException: fmt.Println(iam.ErrCodeNoSuchEntityException, aerr.Error()) case iam.ErrCodeInvalidInputException: fmt.Println(iam.ErrCodeInvalidInputException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

GetServiceLastAccessedDetailsWithEntitiesRequest

func (c *IAM) GetServiceLastAccessedDetailsWithEntitiesRequest(input *GetServiceLastAccessedDetailsWithEntitiesInput) (req *request.Request, output *GetServiceLastAccessedDetailsWithEntitiesOutput)

GetServiceLastAccessedDetailsWithEntitiesRequest generates a "aws/request.Request" representing the client's request for the GetServiceLastAccessedDetailsWithEntities operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See GetServiceLastAccessedDetailsWithEntities for more information on using the GetServiceLastAccessedDetailsWithEntities API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the GetServiceLastAccessedDetailsWithEntitiesRequest method. req, resp := client.GetServiceLastAccessedDetailsWithEntitiesRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetServiceLastAccessedDetailsWithEntities

GetServiceLastAccessedDetailsWithEntitiesWithContext

func (c *IAM) GetServiceLastAccessedDetailsWithEntitiesWithContext(ctx aws.Context, input *GetServiceLastAccessedDetailsWithEntitiesInput, opts ...request.Option) (*GetServiceLastAccessedDetailsWithEntitiesOutput, error)

GetServiceLastAccessedDetailsWithEntitiesWithContext is the same as GetServiceLastAccessedDetailsWithEntities with the addition of the ability to pass a context and additional request options.

See GetServiceLastAccessedDetailsWithEntities for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

GetServiceLinkedRoleDeletionStatus

func (c *IAM) GetServiceLinkedRoleDeletionStatus(input *GetServiceLinkedRoleDeletionStatusInput) (*GetServiceLinkedRoleDeletionStatusOutput, error)

GetServiceLinkedRoleDeletionStatus API operation for AWS Identity and Access Management.

Retrieves the status of your service-linked role deletion. After you use the DeleteServiceLinkedRole API operation to submit a service-linked role for deletion, you can use the DeletionTaskId parameter in GetServiceLinkedRoleDeletionStatus to check the status of the deletion. If the deletion fails, this operation returns the reason that it failed, if that information is returned by the service.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation GetServiceLinkedRoleDeletionStatus for usage and error information.

Returned Error Codes:

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeInvalidInputException "InvalidInput" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetServiceLinkedRoleDeletionStatus

GetServiceLinkedRoleDeletionStatusRequest

func (c *IAM) GetServiceLinkedRoleDeletionStatusRequest(input *GetServiceLinkedRoleDeletionStatusInput) (req *request.Request, output *GetServiceLinkedRoleDeletionStatusOutput)

GetServiceLinkedRoleDeletionStatusRequest generates a "aws/request.Request" representing the client's request for the GetServiceLinkedRoleDeletionStatus operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See GetServiceLinkedRoleDeletionStatus for more information on using the GetServiceLinkedRoleDeletionStatus API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the GetServiceLinkedRoleDeletionStatusRequest method. req, resp := client.GetServiceLinkedRoleDeletionStatusRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetServiceLinkedRoleDeletionStatus

GetServiceLinkedRoleDeletionStatusWithContext

func (c *IAM) GetServiceLinkedRoleDeletionStatusWithContext(ctx aws.Context, input *GetServiceLinkedRoleDeletionStatusInput, opts ...request.Option) (*GetServiceLinkedRoleDeletionStatusOutput, error)

GetServiceLinkedRoleDeletionStatusWithContext is the same as GetServiceLinkedRoleDeletionStatus with the addition of the ability to pass a context and additional request options.

See GetServiceLinkedRoleDeletionStatus for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

GetUser

func (c *IAM) GetUser(input *GetUserInput) (*GetUserOutput, error)

GetUser API operation for AWS Identity and Access Management.

Retrieves information about the specified IAM user, including the user's creation date, path, unique ID, and ARN.

If you do not specify a user name, IAM determines the user name implicitly based on the AWS access key ID used to sign the request to this API.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation GetUser for usage and error information.

Returned Error Codes:

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetUser

Example

IAM GetUser shared00

To get information about an IAM user

The following command gets information about the IAM user named Bob.

{ svc := iam.New(session.New()) input := &iam.GetUserInput{ UserName: aws.String("Bob"), } result, err := svc.GetUser(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case iam.ErrCodeNoSuchEntityException: fmt.Println(iam.ErrCodeNoSuchEntityException, aerr.Error()) case iam.ErrCodeServiceFailureException: fmt.Println(iam.ErrCodeServiceFailureException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

GetUserPolicy

func (c *IAM) GetUserPolicy(input *GetUserPolicyInput) (*GetUserPolicyOutput, error)

GetUserPolicy API operation for AWS Identity and Access Management.

Retrieves the specified inline policy document that is embedded in the specified IAM user.

Policies returned by this API are URL-encoded compliant with RFC 3986 (https://tools.ietf.org/html/rfc3986). You can use a URL decoding method to convert the policy back to plain JSON text. For example, if you use Java, you can use the decode method of the java.net.URLDecoder utility class in the Java SDK. Other languages and SDKs provide similar functionality.

An IAM user can also have managed policies attached to it. To retrieve a managed policy document that is attached to a user, use GetPolicy to determine the policy's default version, then use GetPolicyVersion to retrieve the policy document.

For more information about policies, see Managed Policies and Inline Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) in the IAM User Guide.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation GetUserPolicy for usage and error information.

Returned Error Codes:

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetUserPolicy

GetUserPolicyRequest

func (c *IAM) GetUserPolicyRequest(input *GetUserPolicyInput) (req *request.Request, output *GetUserPolicyOutput)

GetUserPolicyRequest generates a "aws/request.Request" representing the client's request for the GetUserPolicy operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See GetUserPolicy for more information on using the GetUserPolicy API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the GetUserPolicyRequest method. req, resp := client.GetUserPolicyRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetUserPolicy

GetUserPolicyWithContext

func (c *IAM) GetUserPolicyWithContext(ctx aws.Context, input *GetUserPolicyInput, opts ...request.Option) (*GetUserPolicyOutput, error)

GetUserPolicyWithContext is the same as GetUserPolicy with the addition of the ability to pass a context and additional request options.

See GetUserPolicy for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

GetUserRequest

func (c *IAM) GetUserRequest(input *GetUserInput) (req *request.Request, output *GetUserOutput)

GetUserRequest generates a "aws/request.Request" representing the client's request for the GetUser operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See GetUser for more information on using the GetUser API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the GetUserRequest method. req, resp := client.GetUserRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/GetUser

GetUserWithContext

func (c *IAM) GetUserWithContext(ctx aws.Context, input *GetUserInput, opts ...request.Option) (*GetUserOutput, error)

GetUserWithContext is the same as GetUser with the addition of the ability to pass a context and additional request options.

See GetUser for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

ListAccessKeys

func (c *IAM) ListAccessKeys(input *ListAccessKeysInput) (*ListAccessKeysOutput, error)

ListAccessKeys API operation for AWS Identity and Access Management.

Returns information about the access key IDs associated with the specified IAM user. If there is none, the operation returns an empty list.

Although each user is limited to a small number of keys, you can still paginate the results using the MaxItems and Marker parameters.

If the UserName field is not specified, the user name is determined implicitly based on the AWS access key ID used to sign the request. This operation works for access keys under the AWS account. Consequently, you can use this operation to manage AWS account root user credentials even if the AWS account has no associated users.

To ensure the security of your AWS account, the secret access key is accessible only during key and user creation.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation ListAccessKeys for usage and error information.

Returned Error Codes:

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListAccessKeys

Example

IAM ListAccessKeys shared00

To list the access key IDs for an IAM user

The following command lists the access keys IDs for the IAM user named Alice.

{ svc := iam.New(session.New()) input := &iam.ListAccessKeysInput{ UserName: aws.String("Alice"), } result, err := svc.ListAccessKeys(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case iam.ErrCodeNoSuchEntityException: fmt.Println(iam.ErrCodeNoSuchEntityException, aerr.Error()) case iam.ErrCodeServiceFailureException: fmt.Println(iam.ErrCodeServiceFailureException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

ListAccessKeysPages

func (c *IAM) ListAccessKeysPages(input *ListAccessKeysInput, fn func(*ListAccessKeysOutput, bool) bool) error

ListAccessKeysPages iterates over the pages of a ListAccessKeys operation, calling the "fn" function with the response data for each page. To stop iterating, return false from the fn function.

See ListAccessKeys method for more information on how to use this operation.

Note: This operation can generate multiple requests to a service.

// Example iterating over at most 3 pages of a ListAccessKeys operation. pageNum := 0 err := client.ListAccessKeysPages(params, func(page *ListAccessKeysOutput, lastPage bool) bool { pageNum++ fmt.Println(page) return pageNum <= 3 })

See Also

For more information about using this API, see AWS API Documentation.

ListAccessKeysPagesWithContext

func (c *IAM) ListAccessKeysPagesWithContext(ctx aws.Context, input *ListAccessKeysInput, fn func(*ListAccessKeysOutput, bool) bool, opts ...request.Option) error

ListAccessKeysPagesWithContext same as ListAccessKeysPages except it takes a Context and allows setting request options on the pages.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

ListAccessKeysRequest

func (c *IAM) ListAccessKeysRequest(input *ListAccessKeysInput) (req *request.Request, output *ListAccessKeysOutput)

ListAccessKeysRequest generates a "aws/request.Request" representing the client's request for the ListAccessKeys operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See ListAccessKeys for more information on using the ListAccessKeys API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the ListAccessKeysRequest method. req, resp := client.ListAccessKeysRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListAccessKeys

ListAccessKeysWithContext

func (c *IAM) ListAccessKeysWithContext(ctx aws.Context, input *ListAccessKeysInput, opts ...request.Option) (*ListAccessKeysOutput, error)

ListAccessKeysWithContext is the same as ListAccessKeys with the addition of the ability to pass a context and additional request options.

See ListAccessKeys for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

ListAccountAliases

func (c *IAM) ListAccountAliases(input *ListAccountAliasesInput) (*ListAccountAliasesOutput, error)

ListAccountAliases API operation for AWS Identity and Access Management.

Lists the account alias associated with the AWS account (Note: you can have only one). For information about using an AWS account alias, see Using an Alias for Your AWS Account ID (https://docs.aws.amazon.com/IAM/latest/UserGuide/AccountAlias.html) in the IAM User Guide.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation ListAccountAliases for usage and error information.

Returned Error Codes:

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListAccountAliases

Example

IAM ListAccountAliases shared00

To list account aliases

The following command lists the aliases for the current account.

{ svc := iam.New(session.New()) input := &iam.ListAccountAliasesInput{} result, err := svc.ListAccountAliases(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case iam.ErrCodeServiceFailureException: fmt.Println(iam.ErrCodeServiceFailureException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

ListAccountAliasesPages

func (c *IAM) ListAccountAliasesPages(input *ListAccountAliasesInput, fn func(*ListAccountAliasesOutput, bool) bool) error

ListAccountAliasesPages iterates over the pages of a ListAccountAliases operation, calling the "fn" function with the response data for each page. To stop iterating, return false from the fn function.

See ListAccountAliases method for more information on how to use this operation.

Note: This operation can generate multiple requests to a service.

// Example iterating over at most 3 pages of a ListAccountAliases operation. pageNum := 0 err := client.ListAccountAliasesPages(params, func(page *ListAccountAliasesOutput, lastPage bool) bool { pageNum++ fmt.Println(page) return pageNum <= 3 })

See Also

For more information about using this API, see AWS API Documentation.

ListAccountAliasesPagesWithContext

func (c *IAM) ListAccountAliasesPagesWithContext(ctx aws.Context, input *ListAccountAliasesInput, fn func(*ListAccountAliasesOutput, bool) bool, opts ...request.Option) error

ListAccountAliasesPagesWithContext same as ListAccountAliasesPages except it takes a Context and allows setting request options on the pages.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

ListAccountAliasesRequest

func (c *IAM) ListAccountAliasesRequest(input *ListAccountAliasesInput) (req *request.Request, output *ListAccountAliasesOutput)

ListAccountAliasesRequest generates a "aws/request.Request" representing the client's request for the ListAccountAliases operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See ListAccountAliases for more information on using the ListAccountAliases API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the ListAccountAliasesRequest method. req, resp := client.ListAccountAliasesRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListAccountAliases

ListAccountAliasesWithContext

func (c *IAM) ListAccountAliasesWithContext(ctx aws.Context, input *ListAccountAliasesInput, opts ...request.Option) (*ListAccountAliasesOutput, error)

ListAccountAliasesWithContext is the same as ListAccountAliases with the addition of the ability to pass a context and additional request options.

See ListAccountAliases for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

ListAttachedGroupPolicies

func (c *IAM) ListAttachedGroupPolicies(input *ListAttachedGroupPoliciesInput) (*ListAttachedGroupPoliciesOutput, error)

ListAttachedGroupPolicies API operation for AWS Identity and Access Management.

Lists all managed policies that are attached to the specified IAM group.

An IAM group can also have inline policies embedded with it. To list the inline policies for a group, use the ListGroupPolicies API. For information about policies, see Managed Policies and Inline Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) in the IAM User Guide.

You can paginate the results using the MaxItems and Marker parameters. You can use the PathPrefix parameter to limit the list of policies to only those matching the specified path prefix. If there are no policies attached to the specified group (or none that match the specified path prefix), the operation returns an empty list.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation ListAttachedGroupPolicies for usage and error information.

Returned Error Codes:

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeInvalidInputException "InvalidInput" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListAttachedGroupPolicies

ListAttachedGroupPoliciesPages

func (c *IAM) ListAttachedGroupPoliciesPages(input *ListAttachedGroupPoliciesInput, fn func(*ListAttachedGroupPoliciesOutput, bool) bool) error

ListAttachedGroupPoliciesPages iterates over the pages of a ListAttachedGroupPolicies operation, calling the "fn" function with the response data for each page. To stop iterating, return false from the fn function.

See ListAttachedGroupPolicies method for more information on how to use this operation.

Note: This operation can generate multiple requests to a service.

// Example iterating over at most 3 pages of a ListAttachedGroupPolicies operation. pageNum := 0 err := client.ListAttachedGroupPoliciesPages(params, func(page *ListAttachedGroupPoliciesOutput, lastPage bool) bool { pageNum++ fmt.Println(page) return pageNum <= 3 })

See Also

For more information about using this API, see AWS API Documentation.

ListAttachedGroupPoliciesPagesWithContext

func (c *IAM) ListAttachedGroupPoliciesPagesWithContext(ctx aws.Context, input *ListAttachedGroupPoliciesInput, fn func(*ListAttachedGroupPoliciesOutput, bool) bool, opts ...request.Option) error

ListAttachedGroupPoliciesPagesWithContext same as ListAttachedGroupPoliciesPages except it takes a Context and allows setting request options on the pages.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

ListAttachedGroupPoliciesRequest

func (c *IAM) ListAttachedGroupPoliciesRequest(input *ListAttachedGroupPoliciesInput) (req *request.Request, output *ListAttachedGroupPoliciesOutput)

ListAttachedGroupPoliciesRequest generates a "aws/request.Request" representing the client's request for the ListAttachedGroupPolicies operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See ListAttachedGroupPolicies for more information on using the ListAttachedGroupPolicies API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the ListAttachedGroupPoliciesRequest method. req, resp := client.ListAttachedGroupPoliciesRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListAttachedGroupPolicies

ListAttachedGroupPoliciesWithContext

func (c *IAM) ListAttachedGroupPoliciesWithContext(ctx aws.Context, input *ListAttachedGroupPoliciesInput, opts ...request.Option) (*ListAttachedGroupPoliciesOutput, error)

ListAttachedGroupPoliciesWithContext is the same as ListAttachedGroupPolicies with the addition of the ability to pass a context and additional request options.

See ListAttachedGroupPolicies for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

ListAttachedRolePolicies

func (c *IAM) ListAttachedRolePolicies(input *ListAttachedRolePoliciesInput) (*ListAttachedRolePoliciesOutput, error)

ListAttachedRolePolicies API operation for AWS Identity and Access Management.

Lists all managed policies that are attached to the specified IAM role.

An IAM role can also have inline policies embedded with it. To list the inline policies for a role, use the ListRolePolicies API. For information about policies, see Managed Policies and Inline Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) in the IAM User Guide.

You can paginate the results using the MaxItems and Marker parameters. You can use the PathPrefix parameter to limit the list of policies to only those matching the specified path prefix. If there are no policies attached to the specified role (or none that match the specified path prefix), the operation returns an empty list.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation ListAttachedRolePolicies for usage and error information.

Returned Error Codes:

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeInvalidInputException "InvalidInput" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListAttachedRolePolicies

ListAttachedRolePoliciesPages

func (c *IAM) ListAttachedRolePoliciesPages(input *ListAttachedRolePoliciesInput, fn func(*ListAttachedRolePoliciesOutput, bool) bool) error

ListAttachedRolePoliciesPages iterates over the pages of a ListAttachedRolePolicies operation, calling the "fn" function with the response data for each page. To stop iterating, return false from the fn function.

See ListAttachedRolePolicies method for more information on how to use this operation.

Note: This operation can generate multiple requests to a service.

// Example iterating over at most 3 pages of a ListAttachedRolePolicies operation. pageNum := 0 err := client.ListAttachedRolePoliciesPages(params, func(page *ListAttachedRolePoliciesOutput, lastPage bool) bool { pageNum++ fmt.Println(page) return pageNum <= 3 })

See Also

For more information about using this API, see AWS API Documentation.

ListAttachedRolePoliciesPagesWithContext

func (c *IAM) ListAttachedRolePoliciesPagesWithContext(ctx aws.Context, input *ListAttachedRolePoliciesInput, fn func(*ListAttachedRolePoliciesOutput, bool) bool, opts ...request.Option) error

ListAttachedRolePoliciesPagesWithContext same as ListAttachedRolePoliciesPages except it takes a Context and allows setting request options on the pages.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

ListAttachedRolePoliciesRequest

func (c *IAM) ListAttachedRolePoliciesRequest(input *ListAttachedRolePoliciesInput) (req *request.Request, output *ListAttachedRolePoliciesOutput)

ListAttachedRolePoliciesRequest generates a "aws/request.Request" representing the client's request for the ListAttachedRolePolicies operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See ListAttachedRolePolicies for more information on using the ListAttachedRolePolicies API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the ListAttachedRolePoliciesRequest method. req, resp := client.ListAttachedRolePoliciesRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListAttachedRolePolicies

ListAttachedRolePoliciesWithContext

func (c *IAM) ListAttachedRolePoliciesWithContext(ctx aws.Context, input *ListAttachedRolePoliciesInput, opts ...request.Option) (*ListAttachedRolePoliciesOutput, error)

ListAttachedRolePoliciesWithContext is the same as ListAttachedRolePolicies with the addition of the ability to pass a context and additional request options.

See ListAttachedRolePolicies for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

ListAttachedUserPolicies

func (c *IAM) ListAttachedUserPolicies(input *ListAttachedUserPoliciesInput) (*ListAttachedUserPoliciesOutput, error)

ListAttachedUserPolicies API operation for AWS Identity and Access Management.

Lists all managed policies that are attached to the specified IAM user.

An IAM user can also have inline policies embedded with it. To list the inline policies for a user, use the ListUserPolicies API. For information about policies, see Managed Policies and Inline Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) in the IAM User Guide.

You can paginate the results using the MaxItems and Marker parameters. You can use the PathPrefix parameter to limit the list of policies to only those matching the specified path prefix. If there are no policies attached to the specified group (or none that match the specified path prefix), the operation returns an empty list.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation ListAttachedUserPolicies for usage and error information.

Returned Error Codes:

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeInvalidInputException "InvalidInput" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListAttachedUserPolicies

ListAttachedUserPoliciesPages

func (c *IAM) ListAttachedUserPoliciesPages(input *ListAttachedUserPoliciesInput, fn func(*ListAttachedUserPoliciesOutput, bool) bool) error

ListAttachedUserPoliciesPages iterates over the pages of a ListAttachedUserPolicies operation, calling the "fn" function with the response data for each page. To stop iterating, return false from the fn function.

See ListAttachedUserPolicies method for more information on how to use this operation.

Note: This operation can generate multiple requests to a service.

// Example iterating over at most 3 pages of a ListAttachedUserPolicies operation. pageNum := 0 err := client.ListAttachedUserPoliciesPages(params, func(page *ListAttachedUserPoliciesOutput, lastPage bool) bool { pageNum++ fmt.Println(page) return pageNum <= 3 })

See Also

For more information about using this API, see AWS API Documentation.

ListAttachedUserPoliciesPagesWithContext

func (c *IAM) ListAttachedUserPoliciesPagesWithContext(ctx aws.Context, input *ListAttachedUserPoliciesInput, fn func(*ListAttachedUserPoliciesOutput, bool) bool, opts ...request.Option) error

ListAttachedUserPoliciesPagesWithContext same as ListAttachedUserPoliciesPages except it takes a Context and allows setting request options on the pages.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

ListAttachedUserPoliciesRequest

func (c *IAM) ListAttachedUserPoliciesRequest(input *ListAttachedUserPoliciesInput) (req *request.Request, output *ListAttachedUserPoliciesOutput)

ListAttachedUserPoliciesRequest generates a "aws/request.Request" representing the client's request for the ListAttachedUserPolicies operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See ListAttachedUserPolicies for more information on using the ListAttachedUserPolicies API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the ListAttachedUserPoliciesRequest method. req, resp := client.ListAttachedUserPoliciesRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListAttachedUserPolicies

ListAttachedUserPoliciesWithContext

func (c *IAM) ListAttachedUserPoliciesWithContext(ctx aws.Context, input *ListAttachedUserPoliciesInput, opts ...request.Option) (*ListAttachedUserPoliciesOutput, error)

ListAttachedUserPoliciesWithContext is the same as ListAttachedUserPolicies with the addition of the ability to pass a context and additional request options.

See ListAttachedUserPolicies for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

ListEntitiesForPolicy

func (c *IAM) ListEntitiesForPolicy(input *ListEntitiesForPolicyInput) (*ListEntitiesForPolicyOutput, error)

ListEntitiesForPolicy API operation for AWS Identity and Access Management.

Lists all IAM users, groups, and roles that the specified managed policy is attached to.

You can use the optional EntityFilter parameter to limit the results to a particular type of entity (users, groups, or roles). For example, to list only the roles that are attached to the specified policy, set EntityFilter to Role.

You can paginate the results using the MaxItems and Marker parameters.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation ListEntitiesForPolicy for usage and error information.

Returned Error Codes:

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeInvalidInputException "InvalidInput" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListEntitiesForPolicy

ListEntitiesForPolicyPages

func (c *IAM) ListEntitiesForPolicyPages(input *ListEntitiesForPolicyInput, fn func(*ListEntitiesForPolicyOutput, bool) bool) error

ListEntitiesForPolicyPages iterates over the pages of a ListEntitiesForPolicy operation, calling the "fn" function with the response data for each page. To stop iterating, return false from the fn function.

See ListEntitiesForPolicy method for more information on how to use this operation.

Note: This operation can generate multiple requests to a service.

// Example iterating over at most 3 pages of a ListEntitiesForPolicy operation. pageNum := 0 err := client.ListEntitiesForPolicyPages(params, func(page *ListEntitiesForPolicyOutput, lastPage bool) bool { pageNum++ fmt.Println(page) return pageNum <= 3 })

See Also

For more information about using this API, see AWS API Documentation.

ListEntitiesForPolicyPagesWithContext

func (c *IAM) ListEntitiesForPolicyPagesWithContext(ctx aws.Context, input *ListEntitiesForPolicyInput, fn func(*ListEntitiesForPolicyOutput, bool) bool, opts ...request.Option) error

ListEntitiesForPolicyPagesWithContext same as ListEntitiesForPolicyPages except it takes a Context and allows setting request options on the pages.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

ListEntitiesForPolicyRequest

func (c *IAM) ListEntitiesForPolicyRequest(input *ListEntitiesForPolicyInput) (req *request.Request, output *ListEntitiesForPolicyOutput)

ListEntitiesForPolicyRequest generates a "aws/request.Request" representing the client's request for the ListEntitiesForPolicy operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See ListEntitiesForPolicy for more information on using the ListEntitiesForPolicy API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the ListEntitiesForPolicyRequest method. req, resp := client.ListEntitiesForPolicyRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListEntitiesForPolicy

ListEntitiesForPolicyWithContext

func (c *IAM) ListEntitiesForPolicyWithContext(ctx aws.Context, input *ListEntitiesForPolicyInput, opts ...request.Option) (*ListEntitiesForPolicyOutput, error)

ListEntitiesForPolicyWithContext is the same as ListEntitiesForPolicy with the addition of the ability to pass a context and additional request options.

See ListEntitiesForPolicy for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

ListGroupPolicies

func (c *IAM) ListGroupPolicies(input *ListGroupPoliciesInput) (*ListGroupPoliciesOutput, error)

ListGroupPolicies API operation for AWS Identity and Access Management.

Lists the names of the inline policies that are embedded in the specified IAM group.

An IAM group can also have managed policies attached to it. To list the managed policies that are attached to a group, use ListAttachedGroupPolicies. For more information about policies, see Managed Policies and Inline Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) in the IAM User Guide.

You can paginate the results using the MaxItems and Marker parameters. If there are no inline policies embedded with the specified group, the operation returns an empty list.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation ListGroupPolicies for usage and error information.

Returned Error Codes:

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListGroupPolicies

Example

IAM ListGroupPolicies shared00

To list the in-line policies for an IAM group

The following command lists the names of in-line policies that are embedded in the IAM group named Admins.

{ svc := iam.New(session.New()) input := &iam.ListGroupPoliciesInput{ GroupName: aws.String("Admins"), } result, err := svc.ListGroupPolicies(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case iam.ErrCodeNoSuchEntityException: fmt.Println(iam.ErrCodeNoSuchEntityException, aerr.Error()) case iam.ErrCodeServiceFailureException: fmt.Println(iam.ErrCodeServiceFailureException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

ListGroupPoliciesPages

func (c *IAM) ListGroupPoliciesPages(input *ListGroupPoliciesInput, fn func(*ListGroupPoliciesOutput, bool) bool) error

ListGroupPoliciesPages iterates over the pages of a ListGroupPolicies operation, calling the "fn" function with the response data for each page. To stop iterating, return false from the fn function.

See ListGroupPolicies method for more information on how to use this operation.

Note: This operation can generate multiple requests to a service.

// Example iterating over at most 3 pages of a ListGroupPolicies operation. pageNum := 0 err := client.ListGroupPoliciesPages(params, func(page *ListGroupPoliciesOutput, lastPage bool) bool { pageNum++ fmt.Println(page) return pageNum <= 3 })

See Also

For more information about using this API, see AWS API Documentation.

ListGroupPoliciesPagesWithContext

func (c *IAM) ListGroupPoliciesPagesWithContext(ctx aws.Context, input *ListGroupPoliciesInput, fn func(*ListGroupPoliciesOutput, bool) bool, opts ...request.Option) error

ListGroupPoliciesPagesWithContext same as ListGroupPoliciesPages except it takes a Context and allows setting request options on the pages.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

ListGroupPoliciesRequest

func (c *IAM) ListGroupPoliciesRequest(input *ListGroupPoliciesInput) (req *request.Request, output *ListGroupPoliciesOutput)

ListGroupPoliciesRequest generates a "aws/request.Request" representing the client's request for the ListGroupPolicies operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See ListGroupPolicies for more information on using the ListGroupPolicies API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the ListGroupPoliciesRequest method. req, resp := client.ListGroupPoliciesRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListGroupPolicies

ListGroupPoliciesWithContext

func (c *IAM) ListGroupPoliciesWithContext(ctx aws.Context, input *ListGroupPoliciesInput, opts ...request.Option) (*ListGroupPoliciesOutput, error)

ListGroupPoliciesWithContext is the same as ListGroupPolicies with the addition of the ability to pass a context and additional request options.

See ListGroupPolicies for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

ListGroups

func (c *IAM) ListGroups(input *ListGroupsInput) (*ListGroupsOutput, error)

ListGroups API operation for AWS Identity and Access Management.

Lists the IAM groups that have the specified path prefix.

You can paginate the results using the MaxItems and Marker parameters.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation ListGroups for usage and error information.

Returned Error Codes:

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListGroups

Example

IAM ListGroups shared00

To list the IAM groups for the current account

The following command lists the IAM groups in the current account:

{ svc := iam.New(session.New()) input := &iam.ListGroupsInput{} result, err := svc.ListGroups(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case iam.ErrCodeServiceFailureException: fmt.Println(iam.ErrCodeServiceFailureException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

ListGroupsForUser

func (c *IAM) ListGroupsForUser(input *ListGroupsForUserInput) (*ListGroupsForUserOutput, error)

ListGroupsForUser API operation for AWS Identity and Access Management.

Lists the IAM groups that the specified IAM user belongs to.

You can paginate the results using the MaxItems and Marker parameters.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation ListGroupsForUser for usage and error information.

Returned Error Codes:

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListGroupsForUser

Example

IAM ListGroupsForUser shared00

To list the groups that an IAM user belongs to

The following command displays the groups that the IAM user named Bob belongs to.

{ svc := iam.New(session.New()) input := &iam.ListGroupsForUserInput{ UserName: aws.String("Bob"), } result, err := svc.ListGroupsForUser(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case iam.ErrCodeNoSuchEntityException: fmt.Println(iam.ErrCodeNoSuchEntityException, aerr.Error()) case iam.ErrCodeServiceFailureException: fmt.Println(iam.ErrCodeServiceFailureException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

ListGroupsForUserPages

func (c *IAM) ListGroupsForUserPages(input *ListGroupsForUserInput, fn func(*ListGroupsForUserOutput, bool) bool) error

ListGroupsForUserPages iterates over the pages of a ListGroupsForUser operation, calling the "fn" function with the response data for each page. To stop iterating, return false from the fn function.

See ListGroupsForUser method for more information on how to use this operation.

Note: This operation can generate multiple requests to a service.

// Example iterating over at most 3 pages of a ListGroupsForUser operation. pageNum := 0 err := client.ListGroupsForUserPages(params, func(page *ListGroupsForUserOutput, lastPage bool) bool { pageNum++ fmt.Println(page) return pageNum <= 3 })

See Also

For more information about using this API, see AWS API Documentation.

ListGroupsForUserPagesWithContext

func (c *IAM) ListGroupsForUserPagesWithContext(ctx aws.Context, input *ListGroupsForUserInput, fn func(*ListGroupsForUserOutput, bool) bool, opts ...request.Option) error

ListGroupsForUserPagesWithContext same as ListGroupsForUserPages except it takes a Context and allows setting request options on the pages.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

ListGroupsForUserRequest

func (c *IAM) ListGroupsForUserRequest(input *ListGroupsForUserInput) (req *request.Request, output *ListGroupsForUserOutput)

ListGroupsForUserRequest generates a "aws/request.Request" representing the client's request for the ListGroupsForUser operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See ListGroupsForUser for more information on using the ListGroupsForUser API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the ListGroupsForUserRequest method. req, resp := client.ListGroupsForUserRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListGroupsForUser

ListGroupsForUserWithContext

func (c *IAM) ListGroupsForUserWithContext(ctx aws.Context, input *ListGroupsForUserInput, opts ...request.Option) (*ListGroupsForUserOutput, error)

ListGroupsForUserWithContext is the same as ListGroupsForUser with the addition of the ability to pass a context and additional request options.

See ListGroupsForUser for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

ListGroupsPages

func (c *IAM) ListGroupsPages(input *ListGroupsInput, fn func(*ListGroupsOutput, bool) bool) error

ListGroupsPages iterates over the pages of a ListGroups operation, calling the "fn" function with the response data for each page. To stop iterating, return false from the fn function.

See ListGroups method for more information on how to use this operation.

Note: This operation can generate multiple requests to a service.

// Example iterating over at most 3 pages of a ListGroups operation. pageNum := 0 err := client.ListGroupsPages(params, func(page *ListGroupsOutput, lastPage bool) bool { pageNum++ fmt.Println(page) return pageNum <= 3 })

See Also

For more information about using this API, see AWS API Documentation.

ListGroupsPagesWithContext

func (c *IAM) ListGroupsPagesWithContext(ctx aws.Context, input *ListGroupsInput, fn func(*ListGroupsOutput, bool) bool, opts ...request.Option) error

ListGroupsPagesWithContext same as ListGroupsPages except it takes a Context and allows setting request options on the pages.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

ListGroupsRequest

func (c *IAM) ListGroupsRequest(input *ListGroupsInput) (req *request.Request, output *ListGroupsOutput)

ListGroupsRequest generates a "aws/request.Request" representing the client's request for the ListGroups operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See ListGroups for more information on using the ListGroups API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the ListGroupsRequest method. req, resp := client.ListGroupsRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListGroups

ListGroupsWithContext

func (c *IAM) ListGroupsWithContext(ctx aws.Context, input *ListGroupsInput, opts ...request.Option) (*ListGroupsOutput, error)

ListGroupsWithContext is the same as ListGroups with the addition of the ability to pass a context and additional request options.

See ListGroups for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

ListInstanceProfiles

func (c *IAM) ListInstanceProfiles(input *ListInstanceProfilesInput) (*ListInstanceProfilesOutput, error)

ListInstanceProfiles API operation for AWS Identity and Access Management.

Lists the instance profiles that have the specified path prefix. If there are none, the operation returns an empty list. For more information about instance profiles, go to About Instance Profiles (https://docs.aws.amazon.com/IAM/latest/UserGuide/AboutInstanceProfiles.html).

You can paginate the results using the MaxItems and Marker parameters.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation ListInstanceProfiles for usage and error information.

Returned Error Codes:

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListInstanceProfiles

ListInstanceProfilesForRole

func (c *IAM) ListInstanceProfilesForRole(input *ListInstanceProfilesForRoleInput) (*ListInstanceProfilesForRoleOutput, error)

ListInstanceProfilesForRole API operation for AWS Identity and Access Management.

Lists the instance profiles that have the specified associated IAM role. If there are none, the operation returns an empty list. For more information about instance profiles, go to About Instance Profiles (https://docs.aws.amazon.com/IAM/latest/UserGuide/AboutInstanceProfiles.html).

You can paginate the results using the MaxItems and Marker parameters.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation ListInstanceProfilesForRole for usage and error information.

Returned Error Codes:

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListInstanceProfilesForRole

ListInstanceProfilesForRolePages

func (c *IAM) ListInstanceProfilesForRolePages(input *ListInstanceProfilesForRoleInput, fn func(*ListInstanceProfilesForRoleOutput, bool) bool) error

ListInstanceProfilesForRolePages iterates over the pages of a ListInstanceProfilesForRole operation, calling the "fn" function with the response data for each page. To stop iterating, return false from the fn function.

See ListInstanceProfilesForRole method for more information on how to use this operation.

Note: This operation can generate multiple requests to a service.

// Example iterating over at most 3 pages of a ListInstanceProfilesForRole operation. pageNum := 0 err := client.ListInstanceProfilesForRolePages(params, func(page *ListInstanceProfilesForRoleOutput, lastPage bool) bool { pageNum++ fmt.Println(page) return pageNum <= 3 })

See Also

For more information about using this API, see AWS API Documentation.

ListInstanceProfilesForRolePagesWithContext

func (c *IAM) ListInstanceProfilesForRolePagesWithContext(ctx aws.Context, input *ListInstanceProfilesForRoleInput, fn func(*ListInstanceProfilesForRoleOutput, bool) bool, opts ...request.Option) error

ListInstanceProfilesForRolePagesWithContext same as ListInstanceProfilesForRolePages except it takes a Context and allows setting request options on the pages.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

ListInstanceProfilesForRoleRequest

func (c *IAM) ListInstanceProfilesForRoleRequest(input *ListInstanceProfilesForRoleInput) (req *request.Request, output *ListInstanceProfilesForRoleOutput)

ListInstanceProfilesForRoleRequest generates a "aws/request.Request" representing the client's request for the ListInstanceProfilesForRole operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See ListInstanceProfilesForRole for more information on using the ListInstanceProfilesForRole API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the ListInstanceProfilesForRoleRequest method. req, resp := client.ListInstanceProfilesForRoleRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListInstanceProfilesForRole

ListInstanceProfilesForRoleWithContext

func (c *IAM) ListInstanceProfilesForRoleWithContext(ctx aws.Context, input *ListInstanceProfilesForRoleInput, opts ...request.Option) (*ListInstanceProfilesForRoleOutput, error)

ListInstanceProfilesForRoleWithContext is the same as ListInstanceProfilesForRole with the addition of the ability to pass a context and additional request options.

See ListInstanceProfilesForRole for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

ListInstanceProfilesPages

func (c *IAM) ListInstanceProfilesPages(input *ListInstanceProfilesInput, fn func(*ListInstanceProfilesOutput, bool) bool) error

ListInstanceProfilesPages iterates over the pages of a ListInstanceProfiles operation, calling the "fn" function with the response data for each page. To stop iterating, return false from the fn function.

See ListInstanceProfiles method for more information on how to use this operation.

Note: This operation can generate multiple requests to a service.

// Example iterating over at most 3 pages of a ListInstanceProfiles operation. pageNum := 0 err := client.ListInstanceProfilesPages(params, func(page *ListInstanceProfilesOutput, lastPage bool) bool { pageNum++ fmt.Println(page) return pageNum <= 3 })

See Also

For more information about using this API, see AWS API Documentation.

ListInstanceProfilesPagesWithContext

func (c *IAM) ListInstanceProfilesPagesWithContext(ctx aws.Context, input *ListInstanceProfilesInput, fn func(*ListInstanceProfilesOutput, bool) bool, opts ...request.Option) error

ListInstanceProfilesPagesWithContext same as ListInstanceProfilesPages except it takes a Context and allows setting request options on the pages.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

ListInstanceProfilesRequest

func (c *IAM) ListInstanceProfilesRequest(input *ListInstanceProfilesInput) (req *request.Request, output *ListInstanceProfilesOutput)

ListInstanceProfilesRequest generates a "aws/request.Request" representing the client's request for the ListInstanceProfiles operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See ListInstanceProfiles for more information on using the ListInstanceProfiles API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the ListInstanceProfilesRequest method. req, resp := client.ListInstanceProfilesRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListInstanceProfiles

ListInstanceProfilesWithContext

func (c *IAM) ListInstanceProfilesWithContext(ctx aws.Context, input *ListInstanceProfilesInput, opts ...request.Option) (*ListInstanceProfilesOutput, error)

ListInstanceProfilesWithContext is the same as ListInstanceProfiles with the addition of the ability to pass a context and additional request options.

See ListInstanceProfiles for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

ListMFADevices

func (c *IAM) ListMFADevices(input *ListMFADevicesInput) (*ListMFADevicesOutput, error)

ListMFADevices API operation for AWS Identity and Access Management.

Lists the MFA devices for an IAM user. If the request includes a IAM user name, then this operation lists all the MFA devices associated with the specified user. If you do not specify a user name, IAM determines the user name implicitly based on the AWS access key ID signing the request for this API.

You can paginate the results using the MaxItems and Marker parameters.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation ListMFADevices for usage and error information.

Returned Error Codes:

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListMFADevices

ListMFADevicesPages

func (c *IAM) ListMFADevicesPages(input *ListMFADevicesInput, fn func(*ListMFADevicesOutput, bool) bool) error

ListMFADevicesPages iterates over the pages of a ListMFADevices operation, calling the "fn" function with the response data for each page. To stop iterating, return false from the fn function.

See ListMFADevices method for more information on how to use this operation.

Note: This operation can generate multiple requests to a service.

// Example iterating over at most 3 pages of a ListMFADevices operation. pageNum := 0 err := client.ListMFADevicesPages(params, func(page *ListMFADevicesOutput, lastPage bool) bool { pageNum++ fmt.Println(page) return pageNum <= 3 })

See Also

For more information about using this API, see AWS API Documentation.

ListMFADevicesPagesWithContext

func (c *IAM) ListMFADevicesPagesWithContext(ctx aws.Context, input *ListMFADevicesInput, fn func(*ListMFADevicesOutput, bool) bool, opts ...request.Option) error

ListMFADevicesPagesWithContext same as ListMFADevicesPages except it takes a Context and allows setting request options on the pages.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

ListMFADevicesRequest

func (c *IAM) ListMFADevicesRequest(input *ListMFADevicesInput) (req *request.Request, output *ListMFADevicesOutput)

ListMFADevicesRequest generates a "aws/request.Request" representing the client's request for the ListMFADevices operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See ListMFADevices for more information on using the ListMFADevices API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the ListMFADevicesRequest method. req, resp := client.ListMFADevicesRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListMFADevices

ListMFADevicesWithContext

func (c *IAM) ListMFADevicesWithContext(ctx aws.Context, input *ListMFADevicesInput, opts ...request.Option) (*ListMFADevicesOutput, error)

ListMFADevicesWithContext is the same as ListMFADevices with the addition of the ability to pass a context and additional request options.

See ListMFADevices for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

ListOpenIDConnectProviders

func (c *IAM) ListOpenIDConnectProviders(input *ListOpenIDConnectProvidersInput) (*ListOpenIDConnectProvidersOutput, error)

ListOpenIDConnectProviders API operation for AWS Identity and Access Management.

Lists information about the IAM OpenID Connect (OIDC) provider resource objects defined in the AWS account.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation ListOpenIDConnectProviders for usage and error information.

Returned Error Codes:

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListOpenIDConnectProviders

ListOpenIDConnectProvidersRequest

func (c *IAM) ListOpenIDConnectProvidersRequest(input *ListOpenIDConnectProvidersInput) (req *request.Request, output *ListOpenIDConnectProvidersOutput)

ListOpenIDConnectProvidersRequest generates a "aws/request.Request" representing the client's request for the ListOpenIDConnectProviders operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See ListOpenIDConnectProviders for more information on using the ListOpenIDConnectProviders API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the ListOpenIDConnectProvidersRequest method. req, resp := client.ListOpenIDConnectProvidersRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListOpenIDConnectProviders

ListOpenIDConnectProvidersWithContext

func (c *IAM) ListOpenIDConnectProvidersWithContext(ctx aws.Context, input *ListOpenIDConnectProvidersInput, opts ...request.Option) (*ListOpenIDConnectProvidersOutput, error)

ListOpenIDConnectProvidersWithContext is the same as ListOpenIDConnectProviders with the addition of the ability to pass a context and additional request options.

See ListOpenIDConnectProviders for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

ListPolicies

func (c *IAM) ListPolicies(input *ListPoliciesInput) (*ListPoliciesOutput, error)

ListPolicies API operation for AWS Identity and Access Management.

Lists all the managed policies that are available in your AWS account, including your own customer-defined managed policies and all AWS managed policies.

You can filter the list of policies that is returned using the optional OnlyAttached, Scope, and PathPrefix parameters. For example, to list only the customer managed policies in your AWS account, set Scope to Local. To list only AWS managed policies, set Scope to AWS.

You can paginate the results using the MaxItems and Marker parameters.

For more information about managed policies, see Managed Policies and Inline Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) in the IAM User Guide.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation ListPolicies for usage and error information.

Returned Error Codes:

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListPolicies

ListPoliciesGrantingServiceAccess

func (c *IAM) ListPoliciesGrantingServiceAccess(input *ListPoliciesGrantingServiceAccessInput) (*ListPoliciesGrantingServiceAccessOutput, error)

ListPoliciesGrantingServiceAccess API operation for AWS Identity and Access Management.

Retrieves a list of policies that the IAM identity (user, group, or role) can use to access each specified service.

This operation does not use other policy types when determining whether a resource could access a service. These other policy types include resource-based policies, access control lists, AWS Organizations policies, IAM permissions boundaries, and AWS STS assume role policies. It only applies permissions policy logic. For more about the evaluation of policy types, see Evaluating Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_evaluation-logic.html#policy-eval-basics) in the IAM User Guide.

The list of policies returned by the operation depends on the ARN of the identity that you provide.

  • User – The list of policies includes the managed and inline policies that are attached to the user directly. The list also includes any additional managed and inline policies that are attached to the group to which the user belongs.

  • Group – The list of policies includes only the managed and inline policies that are attached to the group directly. Policies that are attached to the group’s user are not included.

  • Role – The list of policies includes only the managed and inline policies that are attached to the role.

For each managed policy, this operation returns the ARN and policy name. For each inline policy, it returns the policy name and the entity to which it is attached. Inline policies do not have an ARN. For more information about these policy types, see Managed Policies and Inline Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_managed-vs-inline.html) in the IAM User Guide.

Policies that are attached to users and roles as permissions boundaries are not returned. To view which managed policy is currently used to set the permissions boundary for a user or role, use the GetUser or GetRole operations.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation ListPoliciesGrantingServiceAccess for usage and error information.

Returned Error Codes:

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeInvalidInputException "InvalidInput" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListPoliciesGrantingServiceAccess

Example

IAM ListPoliciesGrantingServiceAccess shared00

To list policies that allow access to a service

The following operation lists policies that allow ExampleUser01 to access IAM or EC2.

{ svc := iam.New(session.New()) input := &iam.ListPoliciesGrantingServiceAccessInput{ Arn: aws.String("arn:aws:iam::123456789012:user/ExampleUser01"), ServiceNamespaces: []*string{ aws.String("iam"), aws.String("ec2"), }, } result, err := svc.ListPoliciesGrantingServiceAccess(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case iam.ErrCodeNoSuchEntityException: fmt.Println(iam.ErrCodeNoSuchEntityException, aerr.Error()) case iam.ErrCodeInvalidInputException: fmt.Println(iam.ErrCodeInvalidInputException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

ListPoliciesGrantingServiceAccessRequest

func (c *IAM) ListPoliciesGrantingServiceAccessRequest(input *ListPoliciesGrantingServiceAccessInput) (req *request.Request, output *ListPoliciesGrantingServiceAccessOutput)

ListPoliciesGrantingServiceAccessRequest generates a "aws/request.Request" representing the client's request for the ListPoliciesGrantingServiceAccess operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See ListPoliciesGrantingServiceAccess for more information on using the ListPoliciesGrantingServiceAccess API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the ListPoliciesGrantingServiceAccessRequest method. req, resp := client.ListPoliciesGrantingServiceAccessRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListPoliciesGrantingServiceAccess

ListPoliciesGrantingServiceAccessWithContext

func (c *IAM) ListPoliciesGrantingServiceAccessWithContext(ctx aws.Context, input *ListPoliciesGrantingServiceAccessInput, opts ...request.Option) (*ListPoliciesGrantingServiceAccessOutput, error)

ListPoliciesGrantingServiceAccessWithContext is the same as ListPoliciesGrantingServiceAccess with the addition of the ability to pass a context and additional request options.

See ListPoliciesGrantingServiceAccess for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

ListPoliciesPages

func (c *IAM) ListPoliciesPages(input *ListPoliciesInput, fn func(*ListPoliciesOutput, bool) bool) error

ListPoliciesPages iterates over the pages of a ListPolicies operation, calling the "fn" function with the response data for each page. To stop iterating, return false from the fn function.

See ListPolicies method for more information on how to use this operation.

Note: This operation can generate multiple requests to a service.

// Example iterating over at most 3 pages of a ListPolicies operation. pageNum := 0 err := client.ListPoliciesPages(params, func(page *ListPoliciesOutput, lastPage bool) bool { pageNum++ fmt.Println(page) return pageNum <= 3 })

See Also

For more information about using this API, see AWS API Documentation.

ListPoliciesPagesWithContext

func (c *IAM) ListPoliciesPagesWithContext(ctx aws.Context, input *ListPoliciesInput, fn func(*ListPoliciesOutput, bool) bool, opts ...request.Option) error

ListPoliciesPagesWithContext same as ListPoliciesPages except it takes a Context and allows setting request options on the pages.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

ListPoliciesRequest

func (c *IAM) ListPoliciesRequest(input *ListPoliciesInput) (req *request.Request, output *ListPoliciesOutput)

ListPoliciesRequest generates a "aws/request.Request" representing the client's request for the ListPolicies operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See ListPolicies for more information on using the ListPolicies API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the ListPoliciesRequest method. req, resp := client.ListPoliciesRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListPolicies

ListPoliciesWithContext

func (c *IAM) ListPoliciesWithContext(ctx aws.Context, input *ListPoliciesInput, opts ...request.Option) (*ListPoliciesOutput, error)

ListPoliciesWithContext is the same as ListPolicies with the addition of the ability to pass a context and additional request options.

See ListPolicies for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

ListPolicyVersions

func (c *IAM) ListPolicyVersions(input *ListPolicyVersionsInput) (*ListPolicyVersionsOutput, error)

ListPolicyVersions API operation for AWS Identity and Access Management.

Lists information about the versions of the specified managed policy, including the version that is currently set as the policy's default version.

For more information about managed policies, see Managed Policies and Inline Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) in the IAM User Guide.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation ListPolicyVersions for usage and error information.

Returned Error Codes:

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeInvalidInputException "InvalidInput" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListPolicyVersions

ListPolicyVersionsPages

func (c *IAM) ListPolicyVersionsPages(input *ListPolicyVersionsInput, fn func(*ListPolicyVersionsOutput, bool) bool) error

ListPolicyVersionsPages iterates over the pages of a ListPolicyVersions operation, calling the "fn" function with the response data for each page. To stop iterating, return false from the fn function.

See ListPolicyVersions method for more information on how to use this operation.

Note: This operation can generate multiple requests to a service.

// Example iterating over at most 3 pages of a ListPolicyVersions operation. pageNum := 0 err := client.ListPolicyVersionsPages(params, func(page *ListPolicyVersionsOutput, lastPage bool) bool { pageNum++ fmt.Println(page) return pageNum <= 3 })

See Also

For more information about using this API, see AWS API Documentation.

ListPolicyVersionsPagesWithContext

func (c *IAM) ListPolicyVersionsPagesWithContext(ctx aws.Context, input *ListPolicyVersionsInput, fn func(*ListPolicyVersionsOutput, bool) bool, opts ...request.Option) error

ListPolicyVersionsPagesWithContext same as ListPolicyVersionsPages except it takes a Context and allows setting request options on the pages.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

ListPolicyVersionsRequest

func (c *IAM) ListPolicyVersionsRequest(input *ListPolicyVersionsInput) (req *request.Request, output *ListPolicyVersionsOutput)

ListPolicyVersionsRequest generates a "aws/request.Request" representing the client's request for the ListPolicyVersions operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See ListPolicyVersions for more information on using the ListPolicyVersions API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the ListPolicyVersionsRequest method. req, resp := client.ListPolicyVersionsRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListPolicyVersions

ListPolicyVersionsWithContext

func (c *IAM) ListPolicyVersionsWithContext(ctx aws.Context, input *ListPolicyVersionsInput, opts ...request.Option) (*ListPolicyVersionsOutput, error)

ListPolicyVersionsWithContext is the same as ListPolicyVersions with the addition of the ability to pass a context and additional request options.

See ListPolicyVersions for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

ListRolePolicies

func (c *IAM) ListRolePolicies(input *ListRolePoliciesInput) (*ListRolePoliciesOutput, error)

ListRolePolicies API operation for AWS Identity and Access Management.

Lists the names of the inline policies that are embedded in the specified IAM role.

An IAM role can also have managed policies attached to it. To list the managed policies that are attached to a role, use ListAttachedRolePolicies. For more information about policies, see Managed Policies and Inline Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) in the IAM User Guide.

You can paginate the results using the MaxItems and Marker parameters. If there are no inline policies embedded with the specified role, the operation returns an empty list.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation ListRolePolicies for usage and error information.

Returned Error Codes:

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListRolePolicies

ListRolePoliciesPages

func (c *IAM) ListRolePoliciesPages(input *ListRolePoliciesInput, fn func(*ListRolePoliciesOutput, bool) bool) error

ListRolePoliciesPages iterates over the pages of a ListRolePolicies operation, calling the "fn" function with the response data for each page. To stop iterating, return false from the fn function.

See ListRolePolicies method for more information on how to use this operation.

Note: This operation can generate multiple requests to a service.

// Example iterating over at most 3 pages of a ListRolePolicies operation. pageNum := 0 err := client.ListRolePoliciesPages(params, func(page *ListRolePoliciesOutput, lastPage bool) bool { pageNum++ fmt.Println(page) return pageNum <= 3 })

See Also

For more information about using this API, see AWS API Documentation.

ListRolePoliciesPagesWithContext

func (c *IAM) ListRolePoliciesPagesWithContext(ctx aws.Context, input *ListRolePoliciesInput, fn func(*ListRolePoliciesOutput, bool) bool, opts ...request.Option) error

ListRolePoliciesPagesWithContext same as ListRolePoliciesPages except it takes a Context and allows setting request options on the pages.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

ListRolePoliciesRequest

func (c *IAM) ListRolePoliciesRequest(input *ListRolePoliciesInput) (req *request.Request, output *ListRolePoliciesOutput)

ListRolePoliciesRequest generates a "aws/request.Request" representing the client's request for the ListRolePolicies operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See ListRolePolicies for more information on using the ListRolePolicies API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the ListRolePoliciesRequest method. req, resp := client.ListRolePoliciesRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListRolePolicies

ListRolePoliciesWithContext

func (c *IAM) ListRolePoliciesWithContext(ctx aws.Context, input *ListRolePoliciesInput, opts ...request.Option) (*ListRolePoliciesOutput, error)

ListRolePoliciesWithContext is the same as ListRolePolicies with the addition of the ability to pass a context and additional request options.

See ListRolePolicies for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

ListRoleTags

func (c *IAM) ListRoleTags(input *ListRoleTagsInput) (*ListRoleTagsOutput, error)

ListRoleTags API operation for AWS Identity and Access Management.

Lists the tags that are attached to the specified role. The returned list of tags is sorted by tag key. For more information about tagging, see Tagging IAM Identities (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_tags.html) in the IAM User Guide.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation ListRoleTags for usage and error information.

Returned Error Codes:

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListRoleTags

Example

IAM ListRoleTags shared00

To list the tags attached to an IAM role

The following example shows how to list the tags attached to a role.

{ svc := iam.New(session.New()) input := &iam.ListRoleTagsInput{ RoleName: aws.String("taggedrole1"), } result, err := svc.ListRoleTags(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case iam.ErrCodeNoSuchEntityException: fmt.Println(iam.ErrCodeNoSuchEntityException, aerr.Error()) case iam.ErrCodeServiceFailureException: fmt.Println(iam.ErrCodeServiceFailureException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

ListRoleTagsRequest

func (c *IAM) ListRoleTagsRequest(input *ListRoleTagsInput) (req *request.Request, output *ListRoleTagsOutput)

ListRoleTagsRequest generates a "aws/request.Request" representing the client's request for the ListRoleTags operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See ListRoleTags for more information on using the ListRoleTags API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the ListRoleTagsRequest method. req, resp := client.ListRoleTagsRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListRoleTags

ListRoleTagsWithContext

func (c *IAM) ListRoleTagsWithContext(ctx aws.Context, input *ListRoleTagsInput, opts ...request.Option) (*ListRoleTagsOutput, error)

ListRoleTagsWithContext is the same as ListRoleTags with the addition of the ability to pass a context and additional request options.

See ListRoleTags for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

ListRoles

func (c *IAM) ListRoles(input *ListRolesInput) (*ListRolesOutput, error)

ListRoles API operation for AWS Identity and Access Management.

Lists the IAM roles that have the specified path prefix. If there are none, the operation returns an empty list. For more information about roles, go to Working with Roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/WorkingWithRoles.html).

You can paginate the results using the MaxItems and Marker parameters.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation ListRoles for usage and error information.

Returned Error Codes:

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListRoles

ListRolesPages

func (c *IAM) ListRolesPages(input *ListRolesInput, fn func(*ListRolesOutput, bool) bool) error

ListRolesPages iterates over the pages of a ListRoles operation, calling the "fn" function with the response data for each page. To stop iterating, return false from the fn function.

See ListRoles method for more information on how to use this operation.

Note: This operation can generate multiple requests to a service.

// Example iterating over at most 3 pages of a ListRoles operation. pageNum := 0 err := client.ListRolesPages(params, func(page *ListRolesOutput, lastPage bool) bool { pageNum++ fmt.Println(page) return pageNum <= 3 })

See Also

For more information about using this API, see AWS API Documentation.

ListRolesPagesWithContext

func (c *IAM) ListRolesPagesWithContext(ctx aws.Context, input *ListRolesInput, fn func(*ListRolesOutput, bool) bool, opts ...request.Option) error

ListRolesPagesWithContext same as ListRolesPages except it takes a Context and allows setting request options on the pages.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

ListRolesRequest

func (c *IAM) ListRolesRequest(input *ListRolesInput) (req *request.Request, output *ListRolesOutput)

ListRolesRequest generates a "aws/request.Request" representing the client's request for the ListRoles operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See ListRoles for more information on using the ListRoles API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the ListRolesRequest method. req, resp := client.ListRolesRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListRoles

ListRolesWithContext

func (c *IAM) ListRolesWithContext(ctx aws.Context, input *ListRolesInput, opts ...request.Option) (*ListRolesOutput, error)

ListRolesWithContext is the same as ListRoles with the addition of the ability to pass a context and additional request options.

See ListRoles for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

ListSAMLProviders

func (c *IAM) ListSAMLProviders(input *ListSAMLProvidersInput) (*ListSAMLProvidersOutput, error)

ListSAMLProviders API operation for AWS Identity and Access Management.

Lists the SAML provider resource objects defined in IAM in the account.

This operation requires Signature Version 4 (https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html).

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation ListSAMLProviders for usage and error information.

Returned Error Codes:

  • ErrCodeServiceFailureException "ServiceFailure" The request processing has failed because of an unknown error, exception or failure.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListSAMLProviders

ListSAMLProvidersRequest

func (c *IAM) ListSAMLProvidersRequest(input *ListSAMLProvidersInput) (req *request.Request, output *ListSAMLProvidersOutput)

ListSAMLProvidersRequest generates a "aws/request.Request" representing the client's request for the ListSAMLProviders operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See ListSAMLProviders for more information on using the ListSAMLProviders API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the ListSAMLProvidersRequest method. req, resp := client.ListSAMLProvidersRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListSAMLProviders

ListSAMLProvidersWithContext

func (c *IAM) ListSAMLProvidersWithContext(ctx aws.Context, input *ListSAMLProvidersInput, opts ...request.Option) (*ListSAMLProvidersOutput, error)

ListSAMLProvidersWithContext is the same as ListSAMLProviders with the addition of the ability to pass a context and additional request options.

See ListSAMLProviders for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

ListSSHPublicKeys

func (c *IAM) ListSSHPublicKeys(input *ListSSHPublicKeysInput) (*ListSSHPublicKeysOutput, error)

ListSSHPublicKeys API operation for AWS Identity and Access Management.

Returns information about the SSH public keys associated with the specified IAM user. If there none exists, the operation returns an empty list.

The SSH public keys returned by this operation are used only for authenticating the IAM user to an AWS CodeCommit repository. For more information about using SSH keys to authenticate to an AWS CodeCommit repository, see Set up AWS CodeCommit for SSH Connections (https://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-credentials-ssh.html) in the AWS CodeCommit User Guide.

Although each user is limited to a small number of keys, you can still paginate the results using the MaxItems and Marker parameters.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for AWS Identity and Access Management's API operation ListSSHPublicKeys for usage and error information.

Returned Error Codes:

  • ErrCodeNoSuchEntityException "NoSuchEntity" The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

See also, https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/ListSSHPublicKeys

ListSSHPublicKeysPages

func (c *IAM) ListSSHPublicKeysPages(input *ListSSHPublicKeysInput, fn func(*ListSSHPublicKeysOutput, bool) bool) error

ListSSHPublicKeysPages iterates over the pages of a ListSSHPublicKeys operation, calling the "fn" function with the response data for each page. To stop iterating, return false from the fn function.

See ListSSHPublicKeys method for more information on how to use this operation.