create_service_specific_credential
async
¶
create_service_specific_credential(
user_name: userNameType,
service_name: serviceName,
*,
config_overrides: Optional[AsyncIAMClientConfig] = None,
credential_age_days: Optional[credentialAgeDays] = None,
) -> CreateServiceSpecificCredentialResponse
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:
-
user_name(userNameType) –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: _+=,.@-
-
service_name(serviceName) –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.
-
credential_age_days(Optional[credentialAgeDays], default: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.
Raises:
-
LimitExceededException–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.
-
NoSuchEntityException–The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.
-
ServiceNotSupportedException–The specified service does not support service-specific credentials.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_iam/_services/async_iam.py
1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 | |