Skip to content

create_service_template

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

Create a service template. The administrator creates a service template to define standardized infrastructure and an optional CI/CD service pipeline. Developers, in turn, select the service template from Proton. If the selected service template includes a service pipeline definition, they provide a link to their source code repository. Proton then deploys and manages the infrastructure defined by the selected service template. For more information, see Proton templates in the Proton User Guide.

Parameters:

  • name (ResourceName) –

    The name of the service template.

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

    The name of the service template as displayed in the developer interface.

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

    A description of the service template.

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

    A customer provided encryption key that's used to encrypt data.

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

    By default, Proton provides a service pipeline for your service. When this parameter is included, it indicates that an Proton service pipeline isn't provided for your service. After it's included, it can't be changed. For more information, see Template bundles in the Proton User Guide.

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

    An optional list of metadata items that you can associate with the Proton service 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_service_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,
    pipeline_provisioning: Optional[
        "capo_proton.types.provisioning.Provisioning"
    ] = None,
    tags: Optional["capo_proton.types.tag_list.TagList"] = None,
) -> "capo_proton.types.create_service_template_output.CreateServiceTemplateOutput":
    """<p>Create a service template. The administrator creates a service template to define standardized infrastructure and an optional CI/CD service pipeline. Developers, in turn, select the service template from Proton. If the selected service template includes a service pipeline definition, they provide a link to their source code repository. Proton then deploys and manages the infrastructure defined by the selected service template. For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/ag-templates.html">Proton templates</a> in the <i>Proton User Guide</i>.</p>

    Args:
        name: <p>The name of the service template.</p>
        display_name: <p>The name of the service template as displayed in the developer interface.</p>
        description: <p>A description of the service template.</p>
        encryption_key: <p>A customer provided encryption key that's used to encrypt data.</p>
        pipeline_provisioning: <p>By default, Proton provides a service pipeline for your service. When this parameter is included, it indicates that an Proton service pipeline <i>isn't</i> provided for your service. After it's included, it <i>can't</i> be changed. For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/ag-template-authoring.html#ag-template-bundles">Template bundles</a> in the <i>Proton User Guide</i>.</p>
        tags: <p>An optional list of metadata items that you can associate with the Proton service 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_service_template_input.CreateServiceTemplateInput]",
    ) -> OperationResponse[
        "capo_proton.types.create_service_template_output.CreateServiceTemplateOutput"
    ]:
        import capo_proton._operations.aws_proton20200720.create_service_template

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

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

        return capo_proton.types.create_service_template_input.redact_sensitive(
            input_
        )

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

        return capo_proton.types.create_service_template_output.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "CreateServiceTemplate",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_proton.types.create_service_template_input.CreateServiceTemplateInput = {
        "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 pipeline_provisioning is not None:
        input_["pipeline_provisioning"] = pipeline_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