Jump to Content

This API Documentation is now deprecated

We are excited to announce our new API Documentation.

Class CreateServiceSpecificCredentialCommandProtected

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 create service-specific credentials for CodeCommit and Amazon Keyspaces (for Apache Cassandra).

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 CodeCommit: Git credentials, SSH keys, and Amazon Web Services access keys in the IAM User Guide.

Example

Use a bare-bones client and the command you need to make an API call.

import { IAMClient, CreateServiceSpecificCredentialCommand } from "@aws-sdk/client-iam"; // ES Modules import
// const { IAMClient, CreateServiceSpecificCredentialCommand } = require("@aws-sdk/client-iam"); // CommonJS import
const client = new IAMClient(config);
const input = { // CreateServiceSpecificCredentialRequest
UserName: "STRING_VALUE", // required
ServiceName: "STRING_VALUE", // required
};
const command = new CreateServiceSpecificCredentialCommand(input);
const response = await client.send(command);
// { // CreateServiceSpecificCredentialResponse
// ServiceSpecificCredential: { // ServiceSpecificCredential
// CreateDate: new Date("TIMESTAMP"), // required
// ServiceName: "STRING_VALUE", // required
// ServiceUserName: "STRING_VALUE", // required
// ServicePassword: "STRING_VALUE", // required
// ServiceSpecificCredentialId: "STRING_VALUE", // required
// UserName: "STRING_VALUE", // required
// Status: "Active" || "Inactive", // required
// },
// };

Param

CreateServiceSpecificCredentialCommandInput

Returns

CreateServiceSpecificCredentialCommandOutput

See

Throws

LimitExceededException (client fault)

The request was rejected because it attempted to create resources beyond the current Amazon Web Services account limits. The error message describes the limit exceeded.

Throws

NoSuchEntityException (client fault)

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

Throws

ServiceNotSupportedException (client fault)

The specified service does not support service-specific credentials.

Throws

IAMServiceException

Base exception class for all service exceptions from IAM service.

Hierarchy

Constructors

Properties

Methods

Constructors

Properties

Methods