Skip to main content

service_specific_credentials

Creates, updates, deletes, gets or lists a service_specific_credentials resource.

Overview

Nameservice_specific_credentials
TypeResource
Idaws.iam.service_specific_credentials

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
create_datestringThe date and time, in ISO 8601 date-time format, when the service-specific credential were created.
expiration_datestringThe date and time when the service specific credential expires. This field is only present for Bedrock API keys and CloudWatch Logs API keys that were created with an expiration period.
service_credential_aliasstringFor Bedrock API keys and CloudWatch Logs API keys, this is the public portion of the credential that includes the IAM user name and a suffix containing version and creation information.
service_namestringThe name of the service associated with the service-specific credential.
service_specific_credential_idstringThe unique identifier for the service-specific credential.
service_user_namestringThe generated user name for the service-specific credential.
statusstringThe status of the service-specific credential. Active means that the key is valid for API calls, while Inactive means it is not.
user_namestringThe name of the IAM user associated with the service-specific credential.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_service_specific_credentialsselectregionUserName, ServiceName, AllUsers, Marker, MaxItemsReturns information about the service-specific credentials associated with the specified IAM user. If none exists, the operation returns an empty list. The service-specific credentials returned by this operation are used only for authenticating the IAM user to a specific service. 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.
create_service_specific_credentialinsertUserName, ServiceName, regionCredentialAgeDaysGenerates 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.
update_service_specific_credentialupdateServiceSpecificCredentialId, regionUserName, StatusSets the status of a service-specific credential to Active or Inactive. Service-specific credentials that are inactive cannot be used for authentication to the service. This operation can be used to disable a user's service-specific credential as part of a credential rotation work flow.
delete_service_specific_credentialdeleteServiceSpecificCredentialId, regionUserNameDeletes the specified service-specific credential.
reset_service_specific_credentialexecServiceSpecificCredentialId, regionUserNameResets the password for a service-specific credential. The new password is Amazon Web Services generated and cryptographically strong. It cannot be configured by the user. Resetting the password immediately invalidates the previous password associated with this user.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
ServiceNamestringThe 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.
ServiceSpecificCredentialIdstringThe unique identifier of the service-specific credential. This parameter allows (through its regex pattern) a string of characters that can consist of any upper or lowercased letter or digit.
UserNamestringThe 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: _+=,.@-
regionstringAWS region (default: us-east-1)
AllUsersbooleanA flag indicating whether to list service specific credentials for all users. This parameter cannot be specified together with UserName. When true, returns all credentials associated with the specified service.
CredentialAgeDaysintegerThe 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.
MarkerstringUse this parameter only when paginating results and only after you receive a response indicating that the results are truncated. Set it to the value of the Marker from the response that you received to indicate where the next call should start.
MaxItemsintegerUse this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the IsTruncated response element is true.
ServiceNamestringFilters the returned results to only those for the specified Amazon Web Services service. If not specified, then Amazon Web Services returns service-specific credentials for all services.
StatusstringThe status to be assigned to the service-specific credential.
UserNamestringThe name of the IAM user associated with the service-specific credential. If this value is not specified, then the operation assumes the user whose credentials are used to call the operation. 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: _+=,.@-

SELECT examples

Returns information about the service-specific credentials associated with the specified IAM user. If none exists, the operation returns an empty list. The service-specific credentials returned by this operation are used only for authenticating the IAM user to a specific service. 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.

SELECT
create_date,
expiration_date,
service_credential_alias,
service_name,
service_specific_credential_id,
service_user_name,
status,
user_name
FROM aws.iam.service_specific_credentials
WHERE region = '{{ region }}' -- required
AND UserName = '{{ UserName }}'
AND ServiceName = '{{ ServiceName }}'
AND AllUsers = '{{ AllUsers }}'
AND Marker = '{{ Marker }}'
AND MaxItems = '{{ MaxItems }}'
;

INSERT examples

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.

INSERT INTO aws.iam.service_specific_credentials (
UserName,
ServiceName,
region,
CredentialAgeDays
)
SELECT
'{{ UserName }}',
'{{ ServiceName }}',
'{{ region }}',
'{{ CredentialAgeDays }}'
RETURNING
create_date,
expiration_date,
service_credential_alias,
service_credential_secret,
service_name,
service_password,
service_specific_credential_id,
service_user_name,
status,
user_name
;

UPDATE examples

Sets the status of a service-specific credential to Active or Inactive. Service-specific credentials that are inactive cannot be used for authentication to the service. This operation can be used to disable a user's service-specific credential as part of a credential rotation work flow.

UPDATE aws.iam.service_specific_credentials
SET
-- No updatable properties
WHERE
ServiceSpecificCredentialId = '{{ ServiceSpecificCredentialId }}' --required
AND region = '{{ region }}' --required
AND UserName = '{{ UserName}}'
AND Status = '{{ Status}}';

DELETE examples

Deletes the specified service-specific credential.

DELETE FROM aws.iam.service_specific_credentials
WHERE ServiceSpecificCredentialId = '{{ ServiceSpecificCredentialId }}' --required
AND region = '{{ region }}' --required
AND UserName = '{{ UserName }}'
;

Lifecycle Methods

Resets the password for a service-specific credential. The new password is Amazon Web Services generated and cryptographically strong. It cannot be configured by the user. Resetting the password immediately invalidates the previous password associated with this user.

EXEC aws.iam.service_specific_credentials.reset_service_specific_credential
@ServiceSpecificCredentialId='{{ ServiceSpecificCredentialId }}' --required,
@region='{{ region }}' --required,
@UserName='{{ UserName }}'
;