Skip to content

create_environment_template

create_environment_template(
    name: ResourceName,
    *,
    config_overrides: Optional[ProtonClientConfig] = None,
    display_name: Optional[DisplayName] = None,
    description: Optional[Description] = None,
    encryption_key: Optional[Arn] = None,
    provisioning: Optional[Provisioning] = None,
    tags: Optional[TagList] = None,
) -> CreateEnvironmentTemplateOutput

Create an environment template for Proton. For more information, see Environment Templates in the Proton User Guide.

You can create an environment template in one of the two following ways:

  • Register and publish a standard environment template that instructs Proton to deploy and manage environment infrastructure.

  • Register and publish a customer managed environment template that connects Proton to your existing provisioned infrastructure that you manage. Proton doesn't manage your existing provisioned infrastructure. To create an environment template for customer provisioned and managed infrastructure, include the provisioning parameter and set the value to CUSTOMER_MANAGED. For more information, see Register and publish an environment template in the Proton User Guide.

Parameters:

  • name (ResourceName) –

    The name of the environment template.

  • display_name (Optional[DisplayName], default: None ) –

    The environment template name as displayed in the developer interface.

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

    A description of the environment template.

  • encryption_key (Optional[Arn], default: None ) –

    A customer provided encryption key that Proton uses to encrypt data.

  • provisioning (Optional[Provisioning], default: None ) –

    When included, indicates that the environment template is for customer provisioned and managed infrastructure.

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

    An optional list of metadata items that you can associate with the Proton environment template. A tag is a key-value pair.

    For more information, see Proton resources and tagging in the Proton User Guide.

Raises:

Source code in docs_src/capo_proton/_services/proton.py
def create_environment_template(
    self,
    name: "capo_proton.types.resource_name.ResourceName",
    *,
    config_overrides: Optional[ProtonClientConfig] = None,
    display_name: Optional["capo_proton.types.display_name.DisplayName"] = None,
    description: Optional["capo_proton.types.description.Description"] = None,
    encryption_key: Optional["capo_proton.types.arn.Arn"] = None,
    provisioning: Optional["capo_proton.types.provisioning.Provisioning"] = None,
    tags: Optional["capo_proton.types.tag_list.TagList"] = None,
) -> "capo_proton.types.create_environment_template_output.CreateEnvironmentTemplateOutput":
    """<p>Create an environment template for Proton. For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/ag-templates.html">Environment Templates</a> in the <i>Proton User Guide</i>.</p> <p>You can create an environment template in one of the two following ways:</p> <ul> <li> <p>Register and publish a <i>standard</i> environment template that instructs Proton to deploy and manage environment infrastructure.</p> </li> <li> <p>Register and publish a <i>customer managed</i> environment template that connects Proton to your existing provisioned infrastructure that you manage. Proton <i>doesn't</i> manage your existing provisioned infrastructure. To create an environment template for customer provisioned and managed infrastructure, include the <code>provisioning</code> parameter and set the value to <code>CUSTOMER_MANAGED</code>. For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/template-create.html">Register and publish an environment template</a> in the <i>Proton User Guide</i>.</p> </li> </ul>

    Args:
        name: <p>The name of the environment template.</p>
        display_name: <p>The environment template name as displayed in the developer interface.</p>
        description: <p>A description of the environment template.</p>
        encryption_key: <p>A customer provided encryption key that Proton uses to encrypt data.</p>
        provisioning: <p>When included, indicates that the environment template is for customer provisioned and managed infrastructure.</p>
        tags: <p>An optional list of metadata items that you can associate with the Proton environment template. A tag is a key-value pair.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/resources.html">Proton resources and tagging</a> in the <i>Proton User Guide</i>.</p>

    Raises:
        capo_proton.errors.access_denied_exception.AccessDeniedException: <p>There <i>isn't</i> sufficient access for performing this action.</p>
        capo_proton.errors.conflict_exception.ConflictException: <p>The request <i>couldn't</i> be made due to a conflicting operation or resource.</p>
        capo_proton.errors.internal_server_exception.InternalServerException: <p>The request failed to register with the service.</p>
        capo_proton.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>A quota was exceeded. For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/ag-limits.html">Proton Quotas</a> in the <i>Proton User Guide</i>.</p>
        capo_proton.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_proton.errors.validation_exception.ValidationException: <p>The input is invalid or an out-of-range value was supplied for the input parameter.</p>
        capo_proton.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_proton.types.create_environment_template_input.CreateEnvironmentTemplateInput]",
    ) -> OperationResponse[
        "capo_proton.types.create_environment_template_output.CreateEnvironmentTemplateOutput"
    ]:
        import capo_proton._operations.aws_proton20200720.create_environment_template

        output, http_response = (
            capo_proton._operations.aws_proton20200720.create_environment_template.create_environment_template(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_proton.types.create_environment_template_input.CreateEnvironmentTemplateInput",
    ) -> dict[str, Any]:
        import capo_proton.types.create_environment_template_input

        return capo_proton.types.create_environment_template_input.redact_sensitive(
            input_
        )

    def _redact_output(
        output: "capo_proton.types.create_environment_template_output.CreateEnvironmentTemplateOutput",
    ) -> dict[str, Any]:
        import capo_proton.types.create_environment_template_output

        return (
            capo_proton.types.create_environment_template_output.redact_sensitive(
                output
            )
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "CreateEnvironmentTemplate",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_proton.types.create_environment_template_input.CreateEnvironmentTemplateInput = {
        "name": name
    }
    if display_name is not None:
        input_["display_name"] = display_name
    if description is not None:
        input_["description"] = description
    if encryption_key is not None:
        input_["encryption_key"] = encryption_key
    if provisioning is not None:
        input_["provisioning"] = provisioning
    if tags is not None:
        input_["tags"] = tags

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