Skip to content

update_container_service

update_container_service(
    service_name: ContainerServiceName,
    *,
    config_overrides: Optional[LightsailClientConfig] = None,
    power: Optional[ContainerServicePowerName] = None,
    scale: Optional[ContainerServiceScale] = None,
    is_disabled: Optional[boolean] = None,
    public_domain_names: Optional[ContainerServicePublicDomains] = None,
    private_registry_access: Optional[PrivateRegistryAccessRequest] = None,
) -> UpdateContainerServiceResult

Updates the configuration of your Amazon Lightsail container service, such as its power, scale, and public domain names.

Parameters:

  • service_name (ContainerServiceName) –

    The name of the container service to update.

  • power (Optional[ContainerServicePowerName], default: None ) –

    The power for the container service.

    The power specifies the amount of memory, vCPUs, and base monthly cost of each node of the container service. The power and scale of a container service makes up its configured capacity. To determine the monthly price of your container service, multiply the base price of the power with the scale (the number of nodes) of the service.

    Use the GetContainerServicePowers action to view the specifications of each power option.

  • scale (Optional[ContainerServiceScale], default: None ) –

    The scale for the container service.

    The scale specifies the allocated compute nodes of the container service. The power and scale of a container service makes up its configured capacity. To determine the monthly price of your container service, multiply the base price of the power with the scale (the number of nodes) of the service.

  • is_disabled (Optional[boolean], default: None ) –

    A Boolean value to indicate whether the container service is disabled.

  • public_domain_names (Optional[ContainerServicePublicDomains], default: None ) –

    The public domain names to use with the container service, such as example.com and www.example.com.

    You can specify up to four public domain names for a container service. The domain names that you specify are used when you create a deployment with a container configured as the public endpoint of your container service.

    If you don't specify public domain names, then you can use the default domain of the container service.

    You must create and validate an SSL/TLS certificate before you can use public domain names with your container service. Use the CreateCertificate action to create a certificate for the public domain names you want to use with your container service.

    You can specify public domain names using a string to array map as shown in the example later on this page.

  • private_registry_access (Optional[PrivateRegistryAccessRequest], default: None ) –

    An object to describe the configuration for the container service to access private container image repositories, such as Amazon Elastic Container Registry (Amazon ECR) private repositories.

    For more information, see Configuring access to an Amazon ECR private repository for an Amazon Lightsail container service in the Amazon Lightsail Developer Guide.

Raises:

  • AccessDeniedException –

    Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.

  • InvalidInputException –

    Lightsail throws this exception when user input does not conform to the validation rules of an input field.

    Domain and distribution APIs are only available in the N. Virginia (us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to us-east-1 to create, view, or edit these resources.

  • NotFoundException –

    Lightsail throws this exception when it cannot find a resource.

  • RegionSetupInProgressException –

    Lightsail throws this exception when an operation is performed on resources in an opt-in Region that is currently being set up.

  • ServiceException –

    A general service exception.

  • UnauthenticatedException –

    Lightsail throws this exception when the user has not been authenticated.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_lightsail/_services/lightsail.py
def update_container_service(
    self,
    service_name: "capo_lightsail.types.container_service_name.ContainerServiceName",
    *,
    config_overrides: Optional[LightsailClientConfig] = None,
    power: Optional[
        "capo_lightsail.types.container_service_power_name.ContainerServicePowerName"
    ] = None,
    scale: Optional[
        "capo_lightsail.types.container_service_scale.ContainerServiceScale"
    ] = None,
    is_disabled: Optional["capo_lightsail.types.boolean.boolean"] = None,
    public_domain_names: Optional[
        "capo_lightsail.types.container_service_public_domains.ContainerServicePublicDomains"
    ] = None,
    private_registry_access: Optional[
        "capo_lightsail.types.private_registry_access_request.PrivateRegistryAccessRequest"
    ] = None,
) -> "capo_lightsail.types.update_container_service_result.UpdateContainerServiceResult":
    """<p>Updates the configuration of your Amazon Lightsail container service, such as its power, scale, and public domain names.</p>

    Args:
        service_name: <p>The name of the container service to update.</p>
        power: <p>The power for the container service.</p> <p>The power specifies the amount of memory, vCPUs, and base monthly cost of each node of the container service. The <code>power</code> and <code>scale</code> of a container service makes up its configured capacity. To determine the monthly price of your container service, multiply the base price of the <code>power</code> with the <code>scale</code> (the number of nodes) of the service.</p> <p>Use the <code>GetContainerServicePowers</code> action to view the specifications of each power option.</p>
        scale: <p>The scale for the container service.</p> <p>The scale specifies the allocated compute nodes of the container service. The <code>power</code> and <code>scale</code> of a container service makes up its configured capacity. To determine the monthly price of your container service, multiply the base price of the <code>power</code> with the <code>scale</code> (the number of nodes) of the service.</p>
        is_disabled: <p>A Boolean value to indicate whether the container service is disabled.</p>
        public_domain_names: <p>The public domain names to use with the container service, such as <code>example.com</code> and <code>www.example.com</code>.</p> <p>You can specify up to four public domain names for a container service. The domain names that you specify are used when you create a deployment with a container configured as the public endpoint of your container service.</p> <p>If you don't specify public domain names, then you can use the default domain of the container service.</p> <important> <p>You must create and validate an SSL/TLS certificate before you can use public domain names with your container service. Use the <code>CreateCertificate</code> action to create a certificate for the public domain names you want to use with your container service.</p> </important> <p>You can specify public domain names using a string to array map as shown in the example later on this page.</p>
        private_registry_access: <p>An object to describe the configuration for the container service to access private container image repositories, such as Amazon Elastic Container Registry (Amazon ECR) private repositories.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-container-service-ecr-private-repo-access">Configuring access to an Amazon ECR private repository for an Amazon Lightsail container service</a> in the <i>Amazon Lightsail Developer Guide</i>.</p>

    Raises:
        capo_lightsail.errors.access_denied_exception.AccessDeniedException: <p>Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.</p>
        capo_lightsail.errors.invalid_input_exception.InvalidInputException: <p>Lightsail throws this exception when user input does not conform to the validation rules of an input field.</p> <note> <p>Domain and distribution APIs are only available in the N. Virginia (<code>us-east-1</code>) Amazon Web Services Region. Please set your Amazon Web Services Region configuration to <code>us-east-1</code> to create, view, or edit these resources.</p> </note>
        capo_lightsail.errors.not_found_exception.NotFoundException: <p>Lightsail throws this exception when it cannot find a resource.</p>
        capo_lightsail.errors.region_setup_in_progress_exception.RegionSetupInProgressException: <p>Lightsail throws this exception when an operation is performed on resources in an opt-in Region that is currently being set up.</p>
        capo_lightsail.errors.service_exception.ServiceException: <p>A general service exception.</p>
        capo_lightsail.errors.unauthenticated_exception.UnauthenticatedException: <p>Lightsail throws this exception when the user has not been authenticated.</p>
        capo_lightsail.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_lightsail.types.update_container_service_request.UpdateContainerServiceRequest]",
    ) -> OperationResponse[
        "capo_lightsail.types.update_container_service_result.UpdateContainerServiceResult"
    ]:
        import capo_lightsail._operations.lightsail_20161128.update_container_service

        output, http_response = (
            capo_lightsail._operations.lightsail_20161128.update_container_service.update_container_service(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateContainerService")
    )
    input_: capo_lightsail.types.update_container_service_request.UpdateContainerServiceRequest = {
        "service_name": service_name
    }
    if power is not None:
        input_["power"] = power
    if scale is not None:
        input_["scale"] = scale
    if is_disabled is not None:
        input_["is_disabled"] = is_disabled
    if public_domain_names is not None:
        input_["public_domain_names"] = public_domain_names
    if private_registry_access is not None:
        input_["private_registry_access"] = private_registry_access

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