Skip to content

create_trust_anchor async

create_trust_anchor(
    name: ResourceName,
    source: Source,
    *,
    config_overrides: Optional[AsyncRolesAnywhereClientConfig] = None,
    enabled: Optional[bool] = None,
    crl_dp_revocation_enabled: Optional[bool] = None,
    tags: Optional[TagList] = None,
    notification_settings: Optional[NotificationSettings] = None,
    alias_name: Optional[AliasName] = None,
) -> TrustAnchorDetailResponse

Creates a trust anchor to establish trust between IAM Roles Anywhere and your certificate authority (CA). You can define a trust anchor as a reference to an Private Certificate Authority (Private CA) or by uploading a CA certificate. Your Amazon Web Services workloads can authenticate with the trust anchor using certificates issued by the CA in exchange for temporary Amazon Web Services credentials.

Required permissions: rolesanywhere:CreateTrustAnchor.

Parameters:

  • name (ResourceName) –

    The name of the trust anchor.

  • source (Source) –

    The trust anchor type and its related certificate data.

  • enabled (Optional[bool], default: None ) –

    Specifies whether the trust anchor is enabled.

  • crl_dp_revocation_enabled (Optional[bool], default: None ) –

    Specifies whether the trust anchor checks certificate revocation status against CRL distribution points.

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

    The tags to attach to the trust anchor.

  • notification_settings (Optional[NotificationSettings], default: None ) –

    A list of notification settings to be associated to the trust anchor.

  • alias_name (Optional[AliasName], default: None ) –

    An alias for the trust anchor. When you set an alias, the response includes the alias ARN of the trust anchor in aliasArn.

    An alias name contains 1 to 256 characters. It must begin with a letter (A-Z or a-z). It can contain only letters (A-Z and a-z), numbers (0-9), underscores (_), hyphens (-), and forward slashes (/). A forward slash can appear only between two other characters, so an alias name can't end with a forward slash or contain two in a row. Alias names that begin with aws/, in any combination of uppercase and lowercase letters, are reserved. Alias names are case sensitive.

    The alias name must be unique among resources of the same type in your account and Region. If another resource of the same type already has the alias, the request fails with a ValidationException. An invalid or reserved alias name also causes a ValidationException.

    If you omit this parameter or specify an empty string, the resource is created without an alias.

Raises:

Source code in docs_src/capo_rolesanywhere/_services/async_roles_anywhere.py
async def create_trust_anchor(
    self,
    name: "capo_rolesanywhere.types.resource_name.ResourceName",
    source: "capo_rolesanywhere.types.source.Source",
    *,
    config_overrides: Optional[AsyncRolesAnywhereClientConfig] = None,
    enabled: Optional[bool] = None,
    crl_dp_revocation_enabled: Optional[bool] = None,
    tags: Optional["capo_rolesanywhere.types.tag_list.TagList"] = None,
    notification_settings: Optional[
        "capo_rolesanywhere.types.notification_settings.NotificationSettings"
    ] = None,
    alias_name: Optional["capo_rolesanywhere.types.alias_name.AliasName"] = None,
) -> "capo_rolesanywhere.types.trust_anchor_detail_response.TrustAnchorDetailResponse":
    """<p>Creates a trust anchor to establish trust between IAM Roles Anywhere and your certificate authority (CA). You can define a trust anchor as a reference to an Private Certificate Authority (Private CA) or by uploading a CA certificate. Your Amazon Web Services workloads can authenticate with the trust anchor using certificates issued by the CA in exchange for temporary Amazon Web Services credentials.</p> <p> <b>Required permissions: </b> <code>rolesanywhere:CreateTrustAnchor</code>. </p>

    Args:
        name: <p>The name of the trust anchor.</p>
        source: <p>The trust anchor type and its related certificate data.</p>
        enabled: <p>Specifies whether the trust anchor is enabled.</p>
        crl_dp_revocation_enabled: <p>Specifies whether the trust anchor checks certificate revocation status against CRL distribution points.</p>
        tags: <p>The tags to attach to the trust anchor.</p>
        notification_settings: <p>A list of notification settings to be associated to the trust anchor.</p>
        alias_name: <p>An alias for the trust anchor. When you set an alias, the response includes the alias ARN of the trust anchor in <code>aliasArn</code>.</p> <p>An alias name contains 1 to 256 characters. It must begin with a letter (A-Z or a-z). It can contain only letters (A-Z and a-z), numbers (0-9), underscores (_), hyphens (-), and forward slashes (/). A forward slash can appear only between two other characters, so an alias name can't end with a forward slash or contain two in a row. Alias names that begin with <code>aws/</code>, in any combination of uppercase and lowercase letters, are reserved. Alias names are case sensitive.</p> <p>The alias name must be unique among resources of the same type in your account and Region. If another resource of the same type already has the alias, the request fails with a <code>ValidationException</code>. An invalid or reserved alias name also causes a <code>ValidationException</code>.</p> <p>If you omit this parameter or specify an empty string, the resource is created without an alias.</p>

    Raises:
        capo_rolesanywhere.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_rolesanywhere.errors.service_unavailable_exception.ServiceUnavailableException: <p>The request has failed due to a temporary failure of the service.</p>
        capo_rolesanywhere.errors.validation_exception.ValidationException: <p>Validation exception error.</p>
        capo_rolesanywhere.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_rolesanywhere.types.create_trust_anchor_request.CreateTrustAnchorRequest]",
    ) -> AsyncOperationResponse[
        "capo_rolesanywhere.types.trust_anchor_detail_response.TrustAnchorDetailResponse"
    ]:
        import capo_rolesanywhere._operations.roles_anywhere.create_trust_anchor

        (
            output,
            http_response,
        ) = await capo_rolesanywhere._operations.roles_anywhere.create_trust_anchor.async_create_trust_anchor(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_rolesanywhere.types.create_trust_anchor_request.CreateTrustAnchorRequest",
    ) -> dict[str, Any]:
        import capo_rolesanywhere.types.create_trust_anchor_request

        return (
            capo_rolesanywhere.types.create_trust_anchor_request.redact_sensitive(
                input_
            )
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("CreateTrustAnchor", redact_input=_redact_input),
    )
    input_: capo_rolesanywhere.types.create_trust_anchor_request.CreateTrustAnchorRequest = {
        "name": name,
        "source": source,
    }
    if enabled is not None:
        input_["enabled"] = enabled
    if crl_dp_revocation_enabled is not None:
        input_["crl_dp_revocation_enabled"] = crl_dp_revocation_enabled
    if tags is not None:
        input_["tags"] = tags
    if notification_settings is not None:
        input_["notification_settings"] = notification_settings
    if alias_name is not None:
        input_["alias_name"] = alias_name

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