Skip to content

create_designation

create_designation(
    domain_identifier: DomainId,
    name: DesignationName,
    policy: CedarDesignationPolicy,
    *,
    config_overrides: Optional[DataZoneClientConfig] = None,
    description: Optional[Description] = None,
    deletion_protection: Optional[bool] = None,
) -> CreateDesignationOutput

Creates a new user-defined designation with a Cedar permit policy. The designation defines a named role that can be assigned to project members through CreateProjectMembership or granted through AddPolicyGrant.

Parameters:

  • domain_identifier (DomainId) –

    The identifier of the Amazon DataZone domain in which the designation is created.

  • name (DesignationName) –

    The name of the designation. The name must be unique within the domain.

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

    A human-readable description of the designation and its intended use.

  • policy (CedarDesignationPolicy) –

    The Cedar permit policy that defines the actions holders of this designation are allowed to perform.

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

    Specifies whether deletion protection is enabled for this designation. Defaults to true when omitted. When enabled, DeleteDesignation is rejected until protection is disabled through UpdateDesignation.

Raises:

Source code in docs_src/capo_datazone/_services/data_zone.py
def create_designation(
    self,
    domain_identifier: "capo_datazone.types.domain_id.DomainId",
    name: "capo_datazone.types.designation_name.DesignationName",
    policy: "capo_datazone.types.cedar_designation_policy.CedarDesignationPolicy",
    *,
    config_overrides: Optional[DataZoneClientConfig] = None,
    description: Optional["capo_datazone.types.description.Description"] = None,
    deletion_protection: Optional[bool] = None,
) -> "capo_datazone.types.create_designation_output.CreateDesignationOutput":
    """<p>Creates a new user-defined designation with a Cedar permit policy. The designation defines a named role that can be assigned to project members through <code>CreateProjectMembership</code> or granted through <code>AddPolicyGrant</code>.</p>

    Args:
        domain_identifier: <p>The identifier of the Amazon DataZone domain in which the designation is created.</p>
        name: <p>The name of the designation. The name must be unique within the domain.</p>
        description: <p>A human-readable description of the designation and its intended use.</p>
        policy: <p>The Cedar permit policy that defines the actions holders of this designation are allowed to perform.</p>
        deletion_protection: <p>Specifies whether deletion protection is enabled for this designation. Defaults to <code>true</code> when omitted. When enabled, <code>DeleteDesignation</code> is rejected until protection is disabled through <code>UpdateDesignation</code>.</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.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The request has exceeded the specified service quota.</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_designation_input.CreateDesignationInput]",
    ) -> OperationResponse[
        "capo_datazone.types.create_designation_output.CreateDesignationOutput"
    ]:
        import capo_datazone._operations.data_zone.create_designation

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

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

        return capo_datazone.types.create_designation_input.redact_sensitive(input_)

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

        return capo_datazone.types.create_designation_output.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "CreateDesignation",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_datazone.types.create_designation_input.CreateDesignationInput = {
        "domain_identifier": domain_identifier,
        "name": name,
        "policy": policy,
    }
    if description is not None:
        input_["description"] = description
    if deletion_protection is not None:
        input_["deletion_protection"] = deletion_protection

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