Skip to content

create_environment

create_environment(
    project_identifier: ProjectId,
    domain_identifier: DomainId,
    name: str,
    *,
    config_overrides: Optional[DataZoneClientConfig] = None,
    description: Optional[str] = None,
    environment_profile_identifier: Optional[EnvironmentProfileId] = None,
    user_parameters: Optional[EnvironmentParametersList] = None,
    glossary_terms: Optional[GlossaryTerms] = None,
    environment_account_identifier: Optional[str] = None,
    environment_account_region: Optional[str] = None,
    environment_blueprint_identifier: Optional[str] = None,
    deployment_order: Optional[int] = None,
    environment_configuration_id: Optional[str] = None,
    environment_configuration_name: Optional[EnvironmentConfigurationName] = None,
) -> CreateEnvironmentOutput

Create an Amazon DataZone environment.

Parameters:

  • project_identifier (ProjectId) –

    The identifier of the Amazon DataZone project in which this environment is created.

  • domain_identifier (DomainId) –

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

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

    The description of the Amazon DataZone environment.

  • name (str) –

    The name of the Amazon DataZone environment.

  • environment_profile_identifier (Optional[EnvironmentProfileId], default: None ) –

    The identifier of the environment profile that is used to create this Amazon DataZone environment.

  • user_parameters (Optional[EnvironmentParametersList], default: None ) –

    The user parameters of this Amazon DataZone environment.

  • glossary_terms (Optional[GlossaryTerms], default: None ) –

    The glossary terms that can be used in this Amazon DataZone environment.

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

    The ID of the account in which the environment is being created.

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

    The region of the account in which the environment is being created.

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

    The ID of the blueprint with which the environment is being created.

    This parameter is only valid for V1 domains. If provided for a V2 domain, the service returns a ValidationException.

  • deployment_order (Optional[int], default: None ) –

    The deployment order of the environment.

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

    The configuration ID of the environment.

  • environment_configuration_name (Optional[EnvironmentConfigurationName], default: None ) –

    The configuration name of the environment.

Raises:

Source code in docs_src/capo_datazone/_services/data_zone.py
def create_environment(
    self,
    project_identifier: "capo_datazone.types.project_id.ProjectId",
    domain_identifier: "capo_datazone.types.domain_id.DomainId",
    name: str,
    *,
    config_overrides: Optional[DataZoneClientConfig] = None,
    description: Optional[str] = None,
    environment_profile_identifier: Optional[
        "capo_datazone.types.environment_profile_id.EnvironmentProfileId"
    ] = None,
    user_parameters: Optional[
        "capo_datazone.types.environment_parameters_list.EnvironmentParametersList"
    ] = None,
    glossary_terms: Optional[
        "capo_datazone.types.glossary_terms.GlossaryTerms"
    ] = None,
    environment_account_identifier: Optional[str] = None,
    environment_account_region: Optional[str] = None,
    environment_blueprint_identifier: Optional[str] = None,
    deployment_order: Optional[int] = None,
    environment_configuration_id: Optional[str] = None,
    environment_configuration_name: Optional[
        "capo_datazone.types.environment_configuration_name.EnvironmentConfigurationName"
    ] = None,
) -> "capo_datazone.types.create_environment_output.CreateEnvironmentOutput":
    """<p>Create an Amazon DataZone environment.</p>

    Args:
        project_identifier: <p>The identifier of the Amazon DataZone project in which this environment is created.</p>
        domain_identifier: <p>The identifier of the Amazon DataZone domain in which the environment is created.</p>
        description: <p>The description of the Amazon DataZone environment.</p>
        name: <p>The name of the Amazon DataZone environment.</p>
        environment_profile_identifier: <p>The identifier of the environment profile that is used to create this Amazon DataZone environment.</p>
        user_parameters: <p>The user parameters of this Amazon DataZone environment.</p>
        glossary_terms: <p>The glossary terms that can be used in this Amazon DataZone environment.</p>
        environment_account_identifier: <p>The ID of the account in which the environment is being created.</p>
        environment_account_region: <p>The region of the account in which the environment is being created.</p>
        environment_blueprint_identifier: <p>The ID of the blueprint with which the environment is being created.</p> <note> <p>This parameter is only valid for V1 domains. If provided for a V2 domain, the service returns a ValidationException.</p> </note>
        deployment_order: <p>The deployment order of the environment.</p>
        environment_configuration_id: <p>The configuration ID of the environment.</p>
        environment_configuration_name: <p>The configuration name of the environment.</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_environment_input.CreateEnvironmentInput]",
    ) -> OperationResponse[
        "capo_datazone.types.create_environment_output.CreateEnvironmentOutput"
    ]:
        import capo_datazone._operations.data_zone.create_environment

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

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

        return capo_datazone.types.create_environment_input.redact_sensitive(input_)

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

        return capo_datazone.types.create_environment_output.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "CreateEnvironment",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_datazone.types.create_environment_input.CreateEnvironmentInput = {
        "project_identifier": project_identifier,
        "domain_identifier": domain_identifier,
        "name": name,
    }
    if description is not None:
        input_["description"] = description
    if environment_profile_identifier is not None:
        input_["environment_profile_identifier"] = environment_profile_identifier
    if user_parameters is not None:
        input_["user_parameters"] = user_parameters
    if glossary_terms is not None:
        input_["glossary_terms"] = glossary_terms
    if environment_account_identifier is not None:
        input_["environment_account_identifier"] = environment_account_identifier
    if environment_account_region is not None:
        input_["environment_account_region"] = environment_account_region
    if environment_blueprint_identifier is not None:
        input_["environment_blueprint_identifier"] = (
            environment_blueprint_identifier
        )
    if deployment_order is not None:
        input_["deployment_order"] = deployment_order
    if environment_configuration_id is not None:
        input_["environment_configuration_id"] = environment_configuration_id
    if environment_configuration_name is not None:
        input_["environment_configuration_name"] = environment_configuration_name

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