amazonka-iam-2.0: Amazon Identity and Access Management SDK.
Copyright(c) 2013-2023 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellSafe-Inferred
LanguageHaskell2010

Amazonka.IAM.CreateAccessKey

Description

Creates a new Amazon Web Services secret access key and corresponding Amazon Web Services 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 Amazon Web Services access key ID signing the request. This operation works for access keys under the Amazon Web Services account. Consequently, you can use this operation to manage Amazon Web Services account root user credentials. This is true even if the Amazon Web Services account has no associated users.

For information about quotas on the number of keys you can create, see IAM and STS quotas in the IAM User Guide.

To ensure the security of your Amazon Web Services 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.

Synopsis

Creating a Request

data CreateAccessKey Source #

See: newCreateAccessKey smart constructor.

Constructors

CreateAccessKey' 

Fields

  • userName :: Maybe Text

    The name of the IAM user that the new key will belong to.

    This parameter allows (through its regex pattern) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-

Instances

Instances details
ToHeaders CreateAccessKey Source # 
Instance details

Defined in Amazonka.IAM.CreateAccessKey

ToPath CreateAccessKey Source # 
Instance details

Defined in Amazonka.IAM.CreateAccessKey

ToQuery CreateAccessKey Source # 
Instance details

Defined in Amazonka.IAM.CreateAccessKey

AWSRequest CreateAccessKey Source # 
Instance details

Defined in Amazonka.IAM.CreateAccessKey

Associated Types

type AWSResponse CreateAccessKey #

Generic CreateAccessKey Source # 
Instance details

Defined in Amazonka.IAM.CreateAccessKey

Associated Types

type Rep CreateAccessKey :: Type -> Type #

Read CreateAccessKey Source # 
Instance details

Defined in Amazonka.IAM.CreateAccessKey

Show CreateAccessKey Source # 
Instance details

Defined in Amazonka.IAM.CreateAccessKey

NFData CreateAccessKey Source # 
Instance details

Defined in Amazonka.IAM.CreateAccessKey

Methods

rnf :: CreateAccessKey -> () #

Eq CreateAccessKey Source # 
Instance details

Defined in Amazonka.IAM.CreateAccessKey

Hashable CreateAccessKey Source # 
Instance details

Defined in Amazonka.IAM.CreateAccessKey

type AWSResponse CreateAccessKey Source # 
Instance details

Defined in Amazonka.IAM.CreateAccessKey

type Rep CreateAccessKey Source # 
Instance details

Defined in Amazonka.IAM.CreateAccessKey

type Rep CreateAccessKey = D1 ('MetaData "CreateAccessKey" "Amazonka.IAM.CreateAccessKey" "amazonka-iam-2.0-5DxkArXx9sD3CCYYGFyGET" 'False) (C1 ('MetaCons "CreateAccessKey'" 'PrefixI 'True) (S1 ('MetaSel ('Just "userName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text))))

newCreateAccessKey :: CreateAccessKey Source #

Create a value of CreateAccessKey with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

CreateAccessKey, createAccessKey_userName - The name of the IAM user that the new key will belong to.

This parameter allows (through its regex pattern) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-

Request Lenses

createAccessKey_userName :: Lens' CreateAccessKey (Maybe Text) Source #

The name of the IAM user that the new key will belong to.

This parameter allows (through its regex pattern) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-

Destructuring the Response

data CreateAccessKeyResponse Source #

Contains the response to a successful CreateAccessKey request.

See: newCreateAccessKeyResponse smart constructor.

Constructors

CreateAccessKeyResponse' 

Fields

newCreateAccessKeyResponse Source #

Create a value of CreateAccessKeyResponse with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

$sel:httpStatus:CreateAccessKeyResponse', createAccessKeyResponse_httpStatus - The response's http status code.

$sel:accessKey:CreateAccessKeyResponse', createAccessKeyResponse_accessKey - A structure with details about the access key.

Response Lenses

createAccessKeyResponse_accessKey :: Lens' CreateAccessKeyResponse AccessKeyInfo Source #

A structure with details about the access key.