Attaches an Amazon Web Services Private CA certificate authority to a workload identity provider as an X.509 outbound signer, in a slot that is empty. An outbound signer is the signing authority a provider uses to issue credentials of one format. It belongs to its provider and has no ARN of its own. IAM groups X.509 signers into slots by key algorithm.
For an organization-scoped provider, only the organization's management account or a delegated administrator can call this operation.
The new signer starts in IN_TRANSITION and begins signing after SigningDelayInHours. Until then, the provider issues no X.509 credentials from it. To see the new signer and its StartSigningTime, call GetWorkloadIdentityProvider or ListWorkloadIdentityProviderOutboundSigners.
If the slot for the certificate authority's key algorithm already holds any signer, the request fails with EntityAlreadyExistsException. That includes a signer that is disabled, VALIDATING or INACTIVE. To replace the authority in a slot, use UpdateWorkloadIdentityProviderOutboundSigner. To free the slot, use DeleteWorkloadIdentityProviderOutboundSigner.
The certificate authority must meet all of the following requirements, and a certificate authority that fails any of them returns InvalidInputException:
-
It is in the US East (N. Virginia) Amazon Web Services Region, us-east-1.
-
Its status is ACTIVE.
-
Its type is ROOT or SUBORDINATE. A subordinate certificate authority must chain up to a root certificate authority, which is the certificate IAM publishes as the trust anchor.
-
Its key algorithm is one of EC_prime256v1, EC_secp384r1, EC_secp521r1, RSA_2048, RSA_3072 or RSA_4096. ML-DSA and SM2 keys are not supported.
-
It is a service-affiliated certificate authority created for use with IAM Workload Identity, with a UsageMode of SERVICE_AFFILIATED and a service affiliation code of IAM_WORKLOAD_IDENTITY.
IAM chooses the signature algorithm from the certificate authority's key algorithm rather than from the certificate authority's configured signing algorithm:
-
EC_prime256v1 signs with ECDSA_SHA_256.
-
EC_secp384r1 signs with ECDSA_SHA_384.
-
EC_secp521r1 signs with ECDSA_SHA_512.
-
RSA_2048 signs with RSASSA_PKCS1_V1_5_SHA_256.
-
RSA_3072 and RSA_4096 sign with RSASSA_PKCS1_V1_5_SHA_384.
IAM calls Amazon Web Services Private CA with your credentials, so you need the acm-pca permissions on the certificate authority. If the certificate authority is in another account, that certificate authority's resource policy must grant them too.
Parameters:
-
workload_identity_provider_arn
(arnType)
–
The Amazon Resource Name (ARN) of the workload identity provider.
-
outbound_signer
(WorkloadIdentityOutboundSignerConfiguration)
–
The certificate authority to attach. Specify the X509 member.
-
signing_delay_in_hours
(Optional[workloadIdentitySigningDelayInHoursType], default:
None
)
–
The number of hours before the new signer starts signing. During that time IAM publishes the signer's trust material, so verifiers can obtain it before the signer starts signing.
Default: 1.
Raises:
-
ConcurrentModificationException
–
The request was rejected because multiple requests to change this object were submitted simultaneously. Wait a few minutes and submit your request again.
-
EntityAlreadyExistsException
–
The request was rejected because it attempted to create a resource that already exists.
-
InvalidInputException
–
The request was rejected because an invalid or out-of-range value was supplied for an input parameter.
-
NoSuchEntityException
–
The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.
-
ServiceFailureException
–
The request processing has failed because of an unknown error, exception or failure.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Source code in docs_src/capo_iam/_services/iam.py
| def create_workload_identity_provider_outbound_signer(
self,
workload_identity_provider_arn: "capo_iam.types.arn_type.arnType",
outbound_signer: "capo_iam.types.workload_identity_outbound_signer_configuration.WorkloadIdentityOutboundSignerConfiguration",
*,
config_overrides: Optional[IAMClientConfig] = None,
signing_delay_in_hours: Optional[
"capo_iam.types.workload_identity_signing_delay_in_hours_type.workloadIdentitySigningDelayInHoursType"
] = None,
) -> "capo_iam.types.create_workload_identity_provider_outbound_signer_response.CreateWorkloadIdentityProviderOutboundSignerResponse":
"""<p>Attaches an Amazon Web Services Private CA certificate authority to a workload identity provider as an X.509 outbound signer, in a slot that is empty. An outbound signer is the signing authority a provider uses to issue credentials of one format. It belongs to its provider and has no ARN of its own. IAM groups X.509 signers into slots by key algorithm.</p> <p>For an organization-scoped provider, only the organization's management account or a delegated administrator can call this operation.</p> <p>The new signer starts in <code>IN_TRANSITION</code> and begins signing after <code>SigningDelayInHours</code>. Until then, the provider issues no X.509 credentials from it. To see the new signer and its <code>StartSigningTime</code>, call <a href="https://docs.aws.amazon.com/IAM/latest/APIReference/API_GetWorkloadIdentityProvider.html">GetWorkloadIdentityProvider</a> or <a href="https://docs.aws.amazon.com/IAM/latest/APIReference/API_ListWorkloadIdentityProviderOutboundSigners.html">ListWorkloadIdentityProviderOutboundSigners</a>.</p> <p>If the slot for the certificate authority's key algorithm already holds any signer, the request fails with <code>EntityAlreadyExistsException</code>. That includes a signer that is disabled, <code>VALIDATING</code> or <code>INACTIVE</code>. To replace the authority in a slot, use <a href="https://docs.aws.amazon.com/IAM/latest/APIReference/API_UpdateWorkloadIdentityProviderOutboundSigner.html">UpdateWorkloadIdentityProviderOutboundSigner</a>. To free the slot, use <a href="https://docs.aws.amazon.com/IAM/latest/APIReference/API_DeleteWorkloadIdentityProviderOutboundSigner.html">DeleteWorkloadIdentityProviderOutboundSigner</a>.</p> <p>The certificate authority must meet all of the following requirements, and a certificate authority that fails any of them returns <code>InvalidInputException</code>:</p> <ul> <li> <p>It is in the US East (N. Virginia) Amazon Web Services Region, <code>us-east-1</code>.</p> </li> <li> <p>Its status is <code>ACTIVE</code>.</p> </li> <li> <p>Its type is <code>ROOT</code> or <code>SUBORDINATE</code>. A subordinate certificate authority must chain up to a root certificate authority, which is the certificate IAM publishes as the trust anchor.</p> </li> <li> <p>Its key algorithm is one of <code>EC_prime256v1</code>, <code>EC_secp384r1</code>, <code>EC_secp521r1</code>, <code>RSA_2048</code>, <code>RSA_3072</code> or <code>RSA_4096</code>. ML-DSA and SM2 keys are not supported.</p> </li> <li> <p>It is a service-affiliated certificate authority created for use with IAM Workload Identity, with a <code>UsageMode</code> of <code>SERVICE_AFFILIATED</code> and a service affiliation code of <code>IAM_WORKLOAD_IDENTITY</code>.</p> </li> </ul> <p>IAM chooses the signature algorithm from the certificate authority's key algorithm rather than from the certificate authority's configured signing algorithm:</p> <ul> <li> <p> <code>EC_prime256v1</code> signs with <code>ECDSA_SHA_256</code>.</p> </li> <li> <p> <code>EC_secp384r1</code> signs with <code>ECDSA_SHA_384</code>.</p> </li> <li> <p> <code>EC_secp521r1</code> signs with <code>ECDSA_SHA_512</code>.</p> </li> <li> <p> <code>RSA_2048</code> signs with <code>RSASSA_PKCS1_V1_5_SHA_256</code>.</p> </li> <li> <p> <code>RSA_3072</code> and <code>RSA_4096</code> sign with <code>RSASSA_PKCS1_V1_5_SHA_384</code>.</p> </li> </ul> <note> <p>IAM calls Amazon Web Services Private CA with your credentials, so you need the <code>acm-pca</code> permissions on the certificate authority. If the certificate authority is in another account, that certificate authority's resource policy must grant them too.</p> </note>
Args:
workload_identity_provider_arn: <p>The Amazon Resource Name (ARN) of the workload identity provider.</p>
outbound_signer: <p>The certificate authority to attach. Specify the <code>X509</code> member.</p>
signing_delay_in_hours: <p>The number of hours before the new signer starts signing. During that time IAM publishes the signer's trust material, so verifiers can obtain it before the signer starts signing.</p> <p>Default: 1.</p>
Raises:
capo_iam.errors.concurrent_modification_exception.ConcurrentModificationException: <p>The request was rejected because multiple requests to change this object were submitted simultaneously. Wait a few minutes and submit your request again.</p>
capo_iam.errors.entity_already_exists_exception.EntityAlreadyExistsException: <p>The request was rejected because it attempted to create a resource that already exists.</p>
capo_iam.errors.invalid_input_exception.InvalidInputException: <p>The request was rejected because an invalid or out-of-range value was supplied for an input parameter.</p>
capo_iam.errors.no_such_entity_exception.NoSuchEntityException: <p>The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.</p>
capo_iam.errors.service_failure_exception.ServiceFailureException: <p>The request processing has failed because of an unknown error, exception or failure.</p>
capo_iam.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_iam.types.create_workload_identity_provider_outbound_signer_request.CreateWorkloadIdentityProviderOutboundSignerRequest]",
) -> OperationResponse[
"capo_iam.types.create_workload_identity_provider_outbound_signer_response.CreateWorkloadIdentityProviderOutboundSignerResponse"
]:
import capo_iam._operations.aws_identity_management_v20100508.create_workload_identity_provider_outbound_signer
output, http_response = (
capo_iam._operations.aws_identity_management_v20100508.create_workload_identity_provider_outbound_signer.create_workload_identity_provider_outbound_signer(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides,
OperationLogging("CreateWorkloadIdentityProviderOutboundSigner"),
)
input_: capo_iam.types.create_workload_identity_provider_outbound_signer_request.CreateWorkloadIdentityProviderOutboundSignerRequest = {
"workload_identity_provider_arn": workload_identity_provider_arn,
"outbound_signer": outbound_signer,
}
if signing_delay_in_hours is not None:
input_["signing_delay_in_hours"] = signing_delay_in_hours
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|