Skip to main content

containers

Creates, updates, deletes or gets a container resource or lists containers in a region

Overview

Namecontainers
TypeResource
DescriptionResource Type definition for AWS::Lightsail::Container
Idawscc.lightsail.containers

Fields

NameDatatypeDescription
service_namestringThe name for the container service.
powerstringThe power specification for the container service.
container_arnstring
scaleintegerThe scale specification for the container service.
public_domain_namesarrayThe public domain names to use with the container service, such as example.com and www.example.com.
container_service_deploymentobjectDescribes a container deployment configuration of an Amazon Lightsail container service.
is_disabledbooleanA Boolean value to indicate whether the container service is disabled.
private_registry_accessobjectA Boolean value to indicate whether the container service has access to private container image repositories, such as Amazon Elastic Container Registry (Amazon ECR) private repositories.
urlstringThe publicly accessible URL of the container service.
principal_arnstringThe principal ARN of the container service.
tagsarrayAn array of key-value pairs to apply to this resource.
regionstringAWS region.

For more information, see AWS::Lightsail::Container.

Methods

NameResourceAccessible byRequired Params
create_resourcecontainersINSERTServiceName, Power, Scale, region
delete_resourcecontainersDELETEIdentifier, region
update_resourcecontainersUPDATEIdentifier, PatchDocument, region
list_resourcescontainers_list_onlySELECTregion
get_resourcecontainersSELECTIdentifier, region

SELECT examples

Gets all properties from an individual container.

SELECT
region,
service_name,
power,
container_arn,
scale,
public_domain_names,
container_service_deployment,
is_disabled,
private_registry_access,
url,
principal_arn,
tags
FROM awscc.lightsail.containers
WHERE
region = '{{ region }}' AND
Identifier = '{{ service_name }}';

INSERT example

Use the following StackQL query and manifest file to create a new container resource, using stack-deploy.

/*+ create */
INSERT INTO awscc.lightsail.containers (
ServiceName,
Power,
Scale,
region
)
SELECT
'{{ service_name }}',
'{{ power }}',
'{{ scale }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

UPDATE example

Use the following StackQL query and manifest file to update a container resource, using stack-deploy.

/*+ update */
UPDATE awscc.lightsail.containers
SET PatchDocument = string('{{ {
"Power": power,
"Scale": scale,
"PublicDomainNames": public_domain_names,
"ContainerServiceDeployment": container_service_deployment,
"IsDisabled": is_disabled,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ service_name }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.lightsail.containers
WHERE
Identifier = '{{ service_name }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

Additional Parameters

Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:

ParameterDescription
ClientToken
A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.
A client token is valid for 36 hours once used.
After that, a resource request with the same client token is treated as a new request.
If you do not specify a client token, one is generated for inclusion in the request.
RoleArn
The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.
If you do not specify a role, a temporary session is created using your AWS user credentials.
TypeVersionId
For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used.

Permissions

To operate on the containers resource, the following permissions are required:

lightsail:CreateContainerService,
lightsail:CreateContainerServiceDeployment,
lightsail:GetContainerServices,
lightsail:TagResource,
lightsail:UntagResource,
lightsail:UpdateContainerService