Skip to content

create_trust_anchor

create_trust_anchor(
    name: ResourceName,
    source: Source,
    *,
    config_overrides: Optional[RolesAnywhereClientConfig] = None,
    enabled: Optional[bool] = None,
    tags: Optional[TagList] = None,
    notification_settings: Optional[NotificationSettings] = 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.

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

Raises:

Source code in docs_src/capo_rolesanywhere/_services/roles_anywhere.py
def create_trust_anchor(
    self,
    name: "capo_rolesanywhere.types.resource_name.ResourceName",
    source: "capo_rolesanywhere.types.source.Source",
    *,
    config_overrides: Optional[RolesAnywhereClientConfig] = None,
    enabled: Optional[bool] = None,
    tags: Optional["capo_rolesanywhere.types.tag_list.TagList"] = None,
    notification_settings: Optional[
        "capo_rolesanywhere.types.notification_settings.NotificationSettings"
    ] = 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>
        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>

    Raises:
        capo_rolesanywhere.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</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.
    """

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

        output, http_response = (
            capo_rolesanywhere._operations.roles_anywhere.create_trust_anchor.create_trust_anchor(
                req.options, req.input
            )
        )
        return OperationResponse(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 tags is not None:
        input_["tags"] = tags
    if notification_settings is not None:
        input_["notification_settings"] = notification_settings

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output