Skip to content

create_service_specific_credential

Operation

create_service_specific_credential

create_service_specific_credential(request: CreateServiceSpecificCredentialInput | CreateServiceSpecificCredentialInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[CreateServiceSpecificCredentialInputDict]) -> CreateServiceSpecificCredentialOutput

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.

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

For more information about using service-specific credentials to authenticate to an Amazon Web Services service, refer to the following docs:

Parameters:

Name Type Description Default
request CreateServiceSpecificCredentialInput | CreateServiceSpecificCredentialInputDict | None

The input as a model or dictionary. Pass this or keyword arguments, not both.

None
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None
**kwargs Unpack[CreateServiceSpecificCredentialInputDict]

The input fields as keyword arguments.

{}

Returns:

Type Description
CreateServiceSpecificCredentialOutput

An instance of CreateServiceSpecificCredentialOutput.

create_service_specific_credential async

create_service_specific_credential(request: CreateServiceSpecificCredentialInput | CreateServiceSpecificCredentialInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[CreateServiceSpecificCredentialInputDict]) -> CreateServiceSpecificCredentialOutput

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.

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

For more information about using service-specific credentials to authenticate to an Amazon Web Services service, refer to the following docs:

Parameters:

Name Type Description Default
request CreateServiceSpecificCredentialInput | CreateServiceSpecificCredentialInputDict | None

The input as a model or dictionary. Pass this or keyword arguments, not both.

None
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None
**kwargs Unpack[CreateServiceSpecificCredentialInputDict]

The input fields as keyword arguments.

{}

Returns:

Type Description
CreateServiceSpecificCredentialOutput

An instance of CreateServiceSpecificCredentialOutput.

Input

Pass the input as keyword arguments, a positional dictionary, or a positional model object. Pass plugins separately as a keyword argument.

CreateServiceSpecificCredentialInputDict

Bases: TypedDict

Dictionary form of CreateServiceSpecificCredentialInput.

Attributes

credential_age_days instance-attribute
credential_age_days: int | None

The number of days until the service specific credential expires. This field is only valid for services that support long-term API keys and must be a positive integer. When not specified, the credential will not expire.

To see which services support long-term API keys, refer to API keys for Amazon Web Services services in the IAM User Guide.

service_name instance-attribute
service_name: Required[str]

The name of the Amazon Web Services service that is to be associated with the credentials. The service you specify here is the only service that can be accessed using these credentials.

user_name instance-attribute
user_name: Required[str]

The name of the IAM user that is to be associated with the credentials. The new service-specific credentials have the same permissions as the associated user except that they can be used only to access the specified service.

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: _+=,.@-

CreateServiceSpecificCredentialInput dataclass

Bases: _SerdeShape

Dataclass for CreateServiceSpecificCredentialInput structure.

Attributes

credential_age_days class-attribute instance-attribute
credential_age_days: int | None = ...

The number of days until the service specific credential expires. This field is only valid for services that support long-term API keys and must be a positive integer. When not specified, the credential will not expire.

To see which services support long-term API keys, refer to API keys for Amazon Web Services services in the IAM User Guide.

service_name class-attribute instance-attribute
service_name: str | None = ...

The name of the Amazon Web Services service that is to be associated with the credentials. The service you specify here is the only service that can be accessed using these credentials.

user_name class-attribute instance-attribute
user_name: str | None = ...

The name of the IAM user that is to be associated with the credentials. The new service-specific credentials have the same permissions as the associated user except that they can be used only to access the specified service.

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: _+=,.@-

Output

CreateServiceSpecificCredentialOutput dataclass

Bases: _SerdeShape

Dataclass for CreateServiceSpecificCredentialOutput structure.

Attributes

response_metadata class-attribute instance-attribute
response_metadata: ResponseMetadata = ...

Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.

service_specific_credential class-attribute instance-attribute
service_specific_credential: ServiceSpecificCredential | None = ...

A structure that contains information about the newly created service-specific credential.

Warning

This is the only time that the password for this credential set is available. It cannot be recovered later. Instead, you must reset the password with ResetServiceSpecificCredential.