containers
Creates, updates, deletes or gets a container resource or lists containers in a region
Overview
| Name | containers |
| Type | Resource |
| Description | Resource Type definition for AWS::Lightsail::Container |
| Id | awscc.lightsail.containers |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
service_name | string | The name for the container service. |
power | string | The power specification for the container service. |
container_arn | string | |
scale | integer | The scale specification for the container service. |
public_domain_names | array | The public domain names to use with the container service, such as example.com and www.example.com. |
container_service_deployment | object | Describes a container deployment configuration of an Amazon Lightsail container service. |
is_disabled | boolean | A Boolean value to indicate whether the container service is disabled. |
private_registry_access | object | A 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. |
url | string | The publicly accessible URL of the container service. |
principal_arn | string | The principal ARN of the container service. |
tags | array | An array of key-value pairs to apply to this resource. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
service_name | string | The name for the container service. |
region | string | AWS region. |
For more information, see AWS::Lightsail::Container.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | containers | INSERT | ServiceName, Power, Scale, region |
delete_resource | containers | DELETE | Identifier, region |
update_resource | containers | UPDATE | Identifier, PatchDocument, region |
list_resources | containers_list_only | SELECT | region |
get_resource | containers | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
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 = 'us-east-1' AND
Identifier = '{{ service_name }}';
Lists all containers in a region.
SELECT
region,
service_name
FROM awscc.lightsail.containers_list_only
WHERE
region = 'us-east-1';
INSERT example
Use the following StackQL query and manifest file to create a new container resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.lightsail.containers (
ServiceName,
Power,
Scale,
region
)
SELECT
'{{ service_name }}',
'{{ power }}',
'{{ scale }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.lightsail.containers (
ServiceName,
Power,
Scale,
PublicDomainNames,
ContainerServiceDeployment,
IsDisabled,
PrivateRegistryAccess,
Tags,
region
)
SELECT
'{{ service_name }}',
'{{ power }}',
'{{ scale }}',
'{{ public_domain_names }}',
'{{ container_service_deployment }}',
'{{ is_disabled }}',
'{{ private_registry_access }}',
'{{ tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: container
props:
- name: service_name
value: '{{ service_name }}'
- name: power
value: '{{ power }}'
- name: scale
value: '{{ scale }}'
- name: public_domain_names
value:
- certificate_name: '{{ certificate_name }}'
domain_names:
- '{{ domain_names[0] }}'
- name: container_service_deployment
value:
containers:
- service_name: '{{ service_name }}'
power: '{{ power }}'
scale: '{{ scale }}'
public_domain_names:
- null
container_service_deployment: null
is_disabled: '{{ is_disabled }}'
private_registry_access:
ecr_image_puller_role:
is_active: '{{ is_active }}'
principal_arn: '{{ principal_arn }}'
tags:
- key: '{{ key }}'
value: '{{ value }}'
public_endpoint:
container_name: '{{ container_name }}'
container_port: '{{ container_port }}'
health_check_config:
healthy_threshold: '{{ healthy_threshold }}'
interval_seconds: '{{ interval_seconds }}'
path: '{{ path }}'
success_codes: '{{ success_codes }}'
timeout_seconds: '{{ timeout_seconds }}'
unhealthy_threshold: '{{ unhealthy_threshold }}'
- name: is_disabled
value: '{{ is_disabled }}'
- name: private_registry_access
value: null
- name: tags
value:
- null
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 }}';
DELETE example
/*+ delete */
DELETE FROM awscc.lightsail.containers
WHERE
Identifier = '{{ service_name }}' AND
region = 'us-east-1';
Permissions
To operate on the containers resource, the following permissions are required:
- Create
- Read
- Delete
- List
- Update
lightsail:CreateContainerService,
lightsail:CreateContainerServiceDeployment,
lightsail:GetContainerServices,
lightsail:TagResource,
lightsail:UntagResource,
lightsail:UpdateContainerService
lightsail:GetContainerServices
lightsail:DeleteContainerService,
lightsail:GetContainerServices
lightsail:GetContainerServices
lightsail:CreateContainerServiceDeployment,
lightsail:GetContainerServices,
lightsail:TagResource,
lightsail:UntagResource,
lightsail:UpdateContainerService