Skip to content

create_environment_template_version

create_environment_template_version(
    template_name: ResourceName,
    source: TemplateVersionSourceInput,
    *,
    config_overrides: Optional[ProtonClientConfig] = None,
    client_token: Optional[ClientToken] = None,
    description: Optional[Description] = None,
    major_version: Optional[TemplateVersionPart] = None,
    tags: Optional[TagList] = None,
) -> CreateEnvironmentTemplateVersionOutput

Create a new major or minor version of an environment template. A major version of an environment template is a version that isn't backwards compatible. A minor version of an environment template is a version that's backwards compatible within its major version.

Parameters:

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

    When included, if two identical requests are made with the same client token, Proton returns the environment template version that the first request created.

  • template_name (ResourceName) –

    The name of the environment template.

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

    A description of the new version of an environment template.

  • major_version (Optional[TemplateVersionPart], default: None ) –

    To create a new minor version of the environment template, include major Version.

    To create a new major and minor version of the environment template, exclude major Version.

  • source (TemplateVersionSourceInput) –

    An object that includes the template bundle S3 bucket path and name for the new version of an template.

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

    An optional list of metadata items that you can associate with the Proton environment template version. 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_version(
    self,
    template_name: "capo_proton.types.resource_name.ResourceName",
    source: "capo_proton.types.template_version_source_input.TemplateVersionSourceInput",
    *,
    config_overrides: Optional[ProtonClientConfig] = None,
    client_token: Optional["capo_proton.types.client_token.ClientToken"] = None,
    description: Optional["capo_proton.types.description.Description"] = None,
    major_version: Optional[
        "capo_proton.types.template_version_part.TemplateVersionPart"
    ] = None,
    tags: Optional["capo_proton.types.tag_list.TagList"] = None,
) -> "capo_proton.types.create_environment_template_version_output.CreateEnvironmentTemplateVersionOutput":
    """<p>Create a new major or minor version of an environment template. A major version of an environment template is a version that <i>isn't</i> backwards compatible. A minor version of an environment template is a version that's backwards compatible within its major version.</p>

    Args:
        client_token: <p>When included, if two identical requests are made with the same client token, Proton returns the environment template version that the first request created.</p>
        template_name: <p>The name of the environment template.</p>
        description: <p>A description of the new version of an environment template.</p>
        major_version: <p>To create a new minor version of the environment template, include <code>major Version</code>.</p> <p>To create a new major and minor version of the environment template, exclude <code>major Version</code>.</p>
        source: <p>An object that includes the template bundle S3 bucket path and name for the new version of an template.</p>
        tags: <p>An optional list of metadata items that you can associate with the Proton environment template version. 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.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource <i>wasn't</i> found.</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_version_input.CreateEnvironmentTemplateVersionInput]",
    ) -> OperationResponse[
        "capo_proton.types.create_environment_template_version_output.CreateEnvironmentTemplateVersionOutput"
    ]:
        import capo_proton._operations.aws_proton20200720.create_environment_template_version

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

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

        return capo_proton.types.create_environment_template_version_input.redact_sensitive(
            input_
        )

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

        return capo_proton.types.create_environment_template_version_output.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "CreateEnvironmentTemplateVersion",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_proton.types.create_environment_template_version_input.CreateEnvironmentTemplateVersionInput = {
        "template_name": template_name,
        "source": source,
    }
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if description is not None:
        input_["description"] = description
    if major_version is not None:
        input_["major_version"] = major_version
    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