Skip to content

create_workload_identity_provider async

create_workload_identity_provider(
    provider_name: workloadIdentityProviderNameType,
    scheme: workloadIdentityProviderSchemeType,
    *,
    config_overrides: Optional[AsyncIAMClientConfig] = None,
    description: Optional[workloadIdentityProviderDescriptionType] = None,
    workload_identity_domain: Optional[WorkloadIdentityDomainType] = None,
    resource_scope: Optional[workloadIdentityProviderScopeType] = None,
    tags: Optional[tagListType] = None,
) -> CreateWorkloadIdentityProviderResponse

Creates a workload identity provider in your account or in your organization, according to ResourceScope. A provider is the issuer and the trust boundary for every workload identifier minted under it.

The provider's name must be unique within the collection it is created in. A name conflict returns EntityAlreadyExistsException.

IAM creates one JSON Web Token (JWT) outbound signer for each supported signing algorithm along with the provider.

Parameters:

  • provider_name (workloadIdentityProviderNameType) –

    The friendly name of the provider to create. The name must be unique within the collection the provider is created in, and it becomes the resource name segment of the provider's ARN.

  • description (Optional[workloadIdentityProviderDescriptionType], default: None ) –

    A description of the provider. If you omit it, the provider carries no description and responses omit the Description element.

  • scheme (workloadIdentityProviderSchemeType) –

    The naming scheme of the identifiers minted under the provider.

    • SPIFFE – Renders the identifier in the form defined by SPIFFE (Secure Production Identity Framework For Everyone), an open standard for workload identity, rooted at the provider's WorkloadIdentityDomain.

    • NONE – Renders the path alone, with neither the spiffe:// prefix nor the domain.

  • workload_identity_domain (Optional[WorkloadIdentityDomainType], default: None ) –

    The domain that roots the identifiers minted under the provider. Use lowercase characters only.

    This parameter is required when Scheme is SPIFFE, because the domain is the naming root rendered into every identifier. Do not include it when Scheme is NONE.

  • resource_scope (Optional[workloadIdentityProviderScopeType], default: None ) –

    The scope the provider is created at, which is fixed at creation. ACCOUNT creates the provider in your account and ORGANIZATION creates it in your organization. If you do not include this parameter, it defaults to ACCOUNT.

  • tags (Optional[tagListType], default: None ) –

    A list of tags that you want to attach to the new provider. Each tag consists of a key name and an associated value. Both members of a tag are required. Tag keys are case sensitive, and two tag keys that differ only in case are rejected with InvalidInputException. For more information about tagging, see Tagging IAM resources in the IAM User Guide.

    If any one of the tags is invalid or if you exceed the allowed maximum number of tags, then the entire request fails and the resource is not created.

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.

  • 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.

  • 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/async_iam.py
async def create_workload_identity_provider(
    self,
    provider_name: "capo_iam.types.workload_identity_provider_name_type.workloadIdentityProviderNameType",
    scheme: "capo_iam.types.workload_identity_provider_scheme_type.workloadIdentityProviderSchemeType",
    *,
    config_overrides: Optional[AsyncIAMClientConfig] = None,
    description: Optional[
        "capo_iam.types.workload_identity_provider_description_type.workloadIdentityProviderDescriptionType"
    ] = None,
    workload_identity_domain: Optional[
        "capo_iam.types.workload_identity_domain_type.WorkloadIdentityDomainType"
    ] = None,
    resource_scope: Optional[
        "capo_iam.types.workload_identity_provider_scope_type.workloadIdentityProviderScopeType"
    ] = None,
    tags: Optional["capo_iam.types.tag_list_type.tagListType"] = None,
) -> "capo_iam.types.create_workload_identity_provider_response.CreateWorkloadIdentityProviderResponse":
    """<p>Creates a workload identity provider in your account or in your organization, according to <code>ResourceScope</code>. A provider is the issuer and the trust boundary for every workload identifier minted under it.</p> <p>The provider's name must be unique within the collection it is created in. A name conflict returns <code>EntityAlreadyExistsException</code>.</p> <p>IAM creates one JSON Web Token (JWT) outbound signer for each supported signing algorithm along with the provider.</p>

    Args:
        provider_name: <p>The friendly name of the provider to create. The name must be unique within the collection the provider is created in, and it becomes the resource name segment of the provider's ARN.</p>
        description: <p>A description of the provider. If you omit it, the provider carries no description and responses omit the <code>Description</code> element.</p>
        scheme: <p>The naming scheme of the identifiers minted under the provider.</p> <ul> <li> <p> <code>SPIFFE</code> – Renders the identifier in the form defined by SPIFFE (Secure Production Identity Framework For Everyone), an open standard for workload identity, rooted at the provider's <code>WorkloadIdentityDomain</code>.</p> </li> <li> <p> <code>NONE</code> – Renders the path alone, with neither the <code>spiffe://</code> prefix nor the domain.</p> </li> </ul>
        workload_identity_domain: <p>The domain that roots the identifiers minted under the provider. Use lowercase characters only.</p> <p>This parameter is required when <code>Scheme</code> is <code>SPIFFE</code>, because the domain is the naming root rendered into every identifier. Do not include it when <code>Scheme</code> is <code>NONE</code>.</p>
        resource_scope: <p>The scope the provider is created at, which is fixed at creation. <code>ACCOUNT</code> creates the provider in your account and <code>ORGANIZATION</code> creates it in your organization. If you do not include this parameter, it defaults to <code>ACCOUNT</code>.</p>
        tags: <p>A list of tags that you want to attach to the new provider. Each tag consists of a key name and an associated value. Both members of a tag are required. Tag keys are case sensitive, and two tag keys that differ only in case are rejected with <code>InvalidInputException</code>. For more information about tagging, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_tags.html">Tagging IAM resources</a> in the <i>IAM User Guide</i>.</p> <note> <p>If any one of the tags is invalid or if you exceed the allowed maximum number of tags, then the entire request fails and the resource is not created.</p> </note>

    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.limit_exceeded_exception.LimitExceededException: <p>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.</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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_iam.types.create_workload_identity_provider_request.CreateWorkloadIdentityProviderRequest]",
    ) -> AsyncOperationResponse[
        "capo_iam.types.create_workload_identity_provider_response.CreateWorkloadIdentityProviderResponse"
    ]:
        import capo_iam._operations.aws_identity_management_v20100508.create_workload_identity_provider

        (
            output,
            http_response,
        ) = await capo_iam._operations.aws_identity_management_v20100508.create_workload_identity_provider.async_create_workload_identity_provider(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateWorkloadIdentityProvider")
    )
    input_: capo_iam.types.create_workload_identity_provider_request.CreateWorkloadIdentityProviderRequest = {
        "provider_name": provider_name,
        "scheme": scheme,
    }
    if description is not None:
        input_["description"] = description
    if workload_identity_domain is not None:
        input_["workload_identity_domain"] = workload_identity_domain
    if resource_scope is not None:
        input_["resource_scope"] = resource_scope
    if tags is not None:
        input_["tags"] = tags

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output