create_service_specific_credential¶
Operation¶
create_service_specific_credential
async
¶
create_service_specific_credential(input: CreateServiceSpecificCredentialInput, plugins: list[Plugin] | None = None) -> 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:
-
For service-specific credentials with CodeCommit, refer to IAM credentials for CodeCommit: Git credentials, SSH keys, and Amazon Web Services access keys in the IAM User Guide.
-
For service-specific credentials with Amazon Keyspaces (for Apache Cassandra), refer to Use IAM with Amazon Keyspaces (for Apache Cassandra) in the IAM User Guide.
-
For services that support long-term API keys, refer to API keys for Amazon Web Services services in the IAM User Guide.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input
|
CreateServiceSpecificCredentialInput
|
An instance of |
required |
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
|
Returns:
| Type | Description |
|---|---|
CreateServiceSpecificCredentialOutput
|
An instance of |
Input¶
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
¶
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
¶
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.