Skip to content

create_subscription_target

create_subscription_target(
    domain_identifier: DomainId,
    environment_identifier: EnvironmentId,
    name: SubscriptionTargetName,
    type: str,
    subscription_target_config: SubscriptionTargetForms,
    authorized_principals: AuthorizedPrincipalIdentifiers,
    manage_access_role: IamRoleArn,
    applicable_asset_types: ApplicableAssetTypes,
    *,
    config_overrides: Optional[DataZoneClientConfig] = None,
    provider: Optional[str] = None,
    client_token: Optional[str] = None,
    subscription_grant_creation_mode: Optional[SubscriptionGrantCreationMode] = None,
) -> CreateSubscriptionTargetOutput

Creates a subscription target in Amazon DataZone.

Parameters:

  • domain_identifier (DomainId) –

    The ID of the Amazon DataZone domain in which subscription target is created.

  • environment_identifier (EnvironmentId) –

    The ID of the environment in which subscription target is created.

  • name (SubscriptionTargetName) –

    The name of the subscription target.

  • type (str) –

    The type of the subscription target.

  • subscription_target_config (SubscriptionTargetForms) –

    The configuration of the subscription target.

  • authorized_principals (AuthorizedPrincipalIdentifiers) –

    The authorized principals of the subscription target.

  • manage_access_role (IamRoleArn) –

    The manage access role that is used to create the subscription target.

  • applicable_asset_types (ApplicableAssetTypes) –

    The asset types that can be included in the subscription target.

  • provider (Optional[str], default: None ) –

    The provider of the subscription target.

  • client_token (Optional[str], default: None ) –

    A unique, case-sensitive identifier that is provided to ensure the idempotency of the request.

  • subscription_grant_creation_mode (Optional[SubscriptionGrantCreationMode], default: None ) –

    Determines the subscription grant creation mode for this target, defining if grants are auto-created upon subscription approval or managed manually.

Raises:

Source code in docs_src/capo_datazone/_services/data_zone.py
def create_subscription_target(
    self,
    domain_identifier: "capo_datazone.types.domain_id.DomainId",
    environment_identifier: "capo_datazone.types.environment_id.EnvironmentId",
    name: "capo_datazone.types.subscription_target_name.SubscriptionTargetName",
    type: str,
    subscription_target_config: "capo_datazone.types.subscription_target_forms.SubscriptionTargetForms",
    authorized_principals: "capo_datazone.types.authorized_principal_identifiers.AuthorizedPrincipalIdentifiers",
    manage_access_role: "capo_datazone.types.iam_role_arn.IamRoleArn",
    applicable_asset_types: "capo_datazone.types.applicable_asset_types.ApplicableAssetTypes",
    *,
    config_overrides: Optional[DataZoneClientConfig] = None,
    provider: Optional[str] = None,
    client_token: Optional[str] = None,
    subscription_grant_creation_mode: Optional[
        "capo_datazone.types.subscription_grant_creation_mode.SubscriptionGrantCreationMode"
    ] = None,
) -> "capo_datazone.types.create_subscription_target_output.CreateSubscriptionTargetOutput":
    """<p>Creates a subscription target in Amazon DataZone.</p>

    Args:
        domain_identifier: <p>The ID of the Amazon DataZone domain in which subscription target is created.</p>
        environment_identifier: <p>The ID of the environment in which subscription target is created.</p>
        name: <p>The name of the subscription target.</p>
        type: <p>The type of the subscription target.</p>
        subscription_target_config: <p>The configuration of the subscription target.</p>
        authorized_principals: <p>The authorized principals of the subscription target.</p>
        manage_access_role: <p>The manage access role that is used to create the subscription target.</p>
        applicable_asset_types: <p>The asset types that can be included in the subscription target.</p>
        provider: <p>The provider of the subscription target.</p>
        client_token: <p>A unique, case-sensitive identifier that is provided to ensure the idempotency of the request.</p>
        subscription_grant_creation_mode: <p> Determines the subscription grant creation mode for this target, defining if grants are auto-created upon subscription approval or managed manually. </p>

    Raises:
        capo_datazone.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_datazone.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_datazone.errors.unauthorized_exception.UnauthorizedException: <p>You do not have permission to perform this action.</p>
        capo_datazone.errors.conflict_exception.ConflictException: <p>There is a conflict while performing this action.</p>
        capo_datazone.errors.internal_server_exception.InternalServerException: <p>The request has failed because of an unknown error, exception or failure.</p>
        capo_datazone.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource cannot be found.</p>
        capo_datazone.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by the Amazon Web Services service.</p>
        capo_datazone.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_datazone.types.create_subscription_target_input.CreateSubscriptionTargetInput]",
    ) -> OperationResponse[
        "capo_datazone.types.create_subscription_target_output.CreateSubscriptionTargetOutput"
    ]:
        import capo_datazone._operations.data_zone.create_subscription_target

        output, http_response = (
            capo_datazone._operations.data_zone.create_subscription_target.create_subscription_target(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_datazone.types.create_subscription_target_input.CreateSubscriptionTargetInput",
    ) -> dict[str, Any]:
        import capo_datazone.types.create_subscription_target_input

        return (
            capo_datazone.types.create_subscription_target_input.redact_sensitive(
                input_
            )
        )

    def _redact_output(
        output: "capo_datazone.types.create_subscription_target_output.CreateSubscriptionTargetOutput",
    ) -> dict[str, Any]:
        import capo_datazone.types.create_subscription_target_output

        return (
            capo_datazone.types.create_subscription_target_output.redact_sensitive(
                output
            )
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "CreateSubscriptionTarget",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_datazone.types.create_subscription_target_input.CreateSubscriptionTargetInput = {
        "domain_identifier": domain_identifier,
        "environment_identifier": environment_identifier,
        "name": name,
        "type": type,
        "subscription_target_config": subscription_target_config,
        "authorized_principals": authorized_principals,
        "manage_access_role": manage_access_role,
        "applicable_asset_types": applicable_asset_types,
    }
    if provider is not None:
        input_["provider"] = provider
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if subscription_grant_creation_mode is not None:
        input_["subscription_grant_creation_mode"] = (
            subscription_grant_creation_mode
        )

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