Skip to content

aws.lightsail.get_container_services

Example SQL Queries

SELECT * FROM
aws.lightsail.get_container_services;

Description

Returns information about one or more of your Amazon Lightsail container services.

Table Definition

Column NameColumn Data Type
service_name Input Column

The name of the container service for which to return information.

When omitted, the response includes all of your container services in the Amazon Web Services Region where the request is made.

VARCHAR
_aws_profile Input Column

The AWS profile defines the AWS identity used. It can be defined via credentials or by assuming a IAM role.

STRUCT(
"type" VARCHAR,
"name" VARCHAR,
"account_id" VARCHAR,
"via_profile_name" VARCHAR,
"assumed_role_arn" VARCHAR,
"organization" STRUCT(
"account_name" VARCHAR,
"id" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[],
"master_account" STRUCT(
"id" VARCHAR,
"email" VARCHAR
),
"parents" STRUCT(
"type" VARCHAR,
"id" VARCHAR,
"name" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[]
)[]
)
)
Show child fields
_aws_profile.account_id

The AWS account id

_aws_profile.assumed_role_arn

The ARN of the assumed role

_aws_profile.name

The unique name of the profile.

_aws_profile.organization

Information about this profile's membership in the AWS organization.

Show child fields
_aws_profile.organization.account_name

The name of account speciifed by the organization

_aws_profile.organization.id

The organization id

_aws_profile.organization.master_account
Show child fields
_aws_profile.organization.master_account.email

The organization master account email address

_aws_profile.organization.master_account.id

The organization master account id

_aws_profile.organization.parents[]
Show child fields
_aws_profile.organization.parents[].id

The id of the parent

_aws_profile.organization.parents[].name

The name of the parent

_aws_profile.organization.parents[].tags[]
Show child fields
_aws_profile.organization.parents[].tags[].key
_aws_profile.organization.parents[].tags[].value
_aws_profile.organization.parents[].type

The type of parent can be an organization unit or a root

_aws_profile.organization.tags[]
Show child fields
_aws_profile.organization.tags[].key
_aws_profile.organization.tags[].value
_aws_profile.type

The type of profile, either 'credentials' or 'assumed_role'

_aws_profile.via_profile_name

This IAM role for this profile is assumed by first utilizing another profile with this name to obtain credentials.

_aws_region Input Column

The AWS region to use.

VARCHAR
container_services

An array of objects that describe one or more container services.

STRUCT(
"container_service_name" VARCHAR,
"arn" VARCHAR,
"created_at" TIMESTAMP_S,
"location" STRUCT(
"availability_zone" VARCHAR,
"region_name" VARCHAR
),
"resource_type" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[],
"power" VARCHAR,
"power_id" VARCHAR,
"state" VARCHAR,
"state_detail" STRUCT(
"code" VARCHAR,
"message" VARCHAR
),
"scale" BIGINT,
"current_deployment" STRUCT(
"version" BIGINT,
"state" VARCHAR,
"containers" MAP(VARCHAR, STRUCT(
"image" VARCHAR,
"command" VARCHAR[],
"environment" MAP(VARCHAR, VARCHAR),
"ports" MAP(VARCHAR, VARCHAR)
)),
"public_endpoint" STRUCT(
"container_name" VARCHAR,
"container_port" BIGINT,
"health_check" STRUCT(
"healthy_threshold" BIGINT,
"unhealthy_threshold" BIGINT,
"timeout_seconds" BIGINT,
"interval_seconds" BIGINT,
"path" VARCHAR,
"success_codes" VARCHAR
)
),
"created_at" TIMESTAMP_S
),
"next_deployment" STRUCT(
"version" BIGINT,
"state" VARCHAR,
"containers" MAP(VARCHAR, STRUCT(
"image" VARCHAR,
"command" VARCHAR[],
"environment" MAP(VARCHAR, VARCHAR),
"ports" MAP(VARCHAR, VARCHAR)
)),
"public_endpoint" STRUCT(
"container_name" VARCHAR,
"container_port" BIGINT,
"health_check" STRUCT(
"healthy_threshold" BIGINT,
"unhealthy_threshold" BIGINT,
"timeout_seconds" BIGINT,
"interval_seconds" BIGINT,
"path" VARCHAR,
"success_codes" VARCHAR
)
),
"created_at" TIMESTAMP_S
),
"is_disabled" BOOLEAN,
"principal_arn" VARCHAR,
"private_domain_name" VARCHAR,
"public_domain_names" MAP(VARCHAR, VARCHAR[]),
"url" VARCHAR,
"private_registry_access" STRUCT(
"ecr_image_puller_role" STRUCT(
"is_active" BOOLEAN,
"principal_arn" VARCHAR
)
)
)[]
Show child fields
container_services[]
Show child fields
container_services[].arn

The Amazon Resource Name (ARN) of the container service.

container_services[].container_service_name

The name of the container service.

container_services[].created_at

The timestamp when the container service was created.

container_services[].current_deployment

An object that describes the current container deployment of the container service.

Show child fields
container_services[].current_deployment.containers

An object that describes the configuration for the containers of the deployment.

container_services[].current_deployment.created_at

The timestamp when the deployment was created.

container_services[].current_deployment.public_endpoint

An object that describes the endpoint of the deployment.

Show child fields
container_services[].current_deployment.public_endpoint.container_name

The name of the container entry of the deployment that the endpoint configuration applies to.

container_services[].current_deployment.public_endpoint.container_port

The port of the specified container to which traffic is forwarded to.

container_services[].current_deployment.public_endpoint.health_check

An object that describes the health check configuration of the container.

Show child fields
container_services[].current_deployment.public_endpoint.health_check.healthy_threshold

The number of consecutive health checks successes required before moving the container to the Healthy state. The default value is 2.

container_services[].current_deployment.public_endpoint.health_check.interval_seconds

The approximate interval, in seconds, between health checks of an individual container. You can specify between 5 and 300 seconds. The default value is 5.

container_services[].current_deployment.public_endpoint.health_check.path

The path on the container on which to perform the health check. The default value is /.

container_services[].current_deployment.public_endpoint.health_check.success_codes

The HTTP codes to use when checking for a successful response from a container. You can specify values between 200 and 499. You can specify multiple values (for example, 200,202) or a range of values (for example, 200-299).

container_services[].current_deployment.public_endpoint.health_check.timeout_seconds

The amount of time, in seconds, during which no response means a failed health check. You can specify between 2 and 60 seconds. The default value is 2.

container_services[].current_deployment.public_endpoint.health_check.unhealthy_threshold

The number of consecutive health check failures required before moving the container to the Unhealthy state. The default value is 2.

container_services[].current_deployment.state

The state of the deployment.

A deployment can be in one of the following states:

  • ACTIVATING - The deployment is being created.

  • ACTIVE - The deployment was successfully created, and it's currently running on the container service. The container service can have only one deployment in an active state at a time.

  • INACTIVE - The deployment was previously successfully created, but it is not currently running on the container service.

  • FAILED - The deployment failed. Use the GetContainerLog action to view the log events for the containers in the deployment to try to determine the reason for the failure.

container_services[].current_deployment.version

The version number of the deployment.

container_services[].is_disabled

A Boolean value indicating whether the container service is disabled.

container_services[].location

An object that describes the location of the container service, such as the Amazon Web Services Region and Availability Zone.

Show child fields
container_services[].location.availability_zone

The Availability Zone. Follows the format us-east-2a (case-sensitive).

container_services[].location.region_name

The Amazon Web Services Region name.

container_services[].next_deployment

An object that describes the next deployment of the container service.

This value is null when there is no deployment in a pending state.

Show child fields
container_services[].next_deployment.containers

An object that describes the configuration for the containers of the deployment.

container_services[].next_deployment.created_at

The timestamp when the deployment was created.

container_services[].next_deployment.public_endpoint

An object that describes the endpoint of the deployment.

Show child fields
container_services[].next_deployment.public_endpoint.container_name

The name of the container entry of the deployment that the endpoint configuration applies to.

container_services[].next_deployment.public_endpoint.container_port

The port of the specified container to which traffic is forwarded to.

container_services[].next_deployment.public_endpoint.health_check

An object that describes the health check configuration of the container.

Show child fields
container_services[].next_deployment.public_endpoint.health_check.healthy_threshold

The number of consecutive health checks successes required before moving the container to the Healthy state. The default value is 2.

container_services[].next_deployment.public_endpoint.health_check.interval_seconds

The approximate interval, in seconds, between health checks of an individual container. You can specify between 5 and 300 seconds. The default value is 5.

container_services[].next_deployment.public_endpoint.health_check.path

The path on the container on which to perform the health check. The default value is /.

container_services[].next_deployment.public_endpoint.health_check.success_codes

The HTTP codes to use when checking for a successful response from a container. You can specify values between 200 and 499. You can specify multiple values (for example, 200,202) or a range of values (for example, 200-299).

container_services[].next_deployment.public_endpoint.health_check.timeout_seconds

The amount of time, in seconds, during which no response means a failed health check. You can specify between 2 and 60 seconds. The default value is 2.

container_services[].next_deployment.public_endpoint.health_check.unhealthy_threshold

The number of consecutive health check failures required before moving the container to the Unhealthy state. The default value is 2.

container_services[].next_deployment.state

The state of the deployment.

A deployment can be in one of the following states:

  • ACTIVATING - The deployment is being created.

  • ACTIVE - The deployment was successfully created, and it's currently running on the container service. The container service can have only one deployment in an active state at a time.

  • INACTIVE - The deployment was previously successfully created, but it is not currently running on the container service.

  • FAILED - The deployment failed. Use the GetContainerLog action to view the log events for the containers in the deployment to try to determine the reason for the failure.

container_services[].next_deployment.version

The version number of the deployment.

container_services[].power

The power specification of the container service.

The power specifies the amount of RAM, the number of vCPUs, and the base price of the container service.

container_services[].power_id

The ID of the power of the container service.

container_services[].principal_arn

The principal ARN of the container service.

The principal ARN can be used to create a trust relationship between your standard Amazon Web Services account and your Lightsail container service. This allows you to give your service permission to access resources in your standard Amazon Web Services account.

container_services[].private_domain_name

The private domain name of the container service.

The private domain name is accessible only by other resources within the default virtual private cloud (VPC) of your Lightsail account.

container_services[].private_registry_access

An object that describes 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.

Show child fields
container_services[].private_registry_access.ecr_image_puller_role

An object that describes the activation status of the role that you can use to grant a Lightsail container service access to Amazon ECR private repositories. If the role is activated, the Amazon Resource Name (ARN) of the role is also listed.

Show child fields
container_services[].private_registry_access.ecr_image_puller_role.is_active

A Boolean value that indicates whether the role is activated.

container_services[].private_registry_access.ecr_image_puller_role.principal_arn

The Amazon Resource Name (ARN) of the role, if it is activated.

container_services[].public_domain_names

The public domain name of 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.

See CreateContainerService or UpdateContainerService for information about how to specify public domain names for your Lightsail container service.

container_services[].resource_type

The Lightsail resource type of the container service.

container_services[].scale

The scale specification of the container service.

The scale specifies the allocated compute nodes of the container service.

container_services[].state

The current state of the container service.

The following container service states are possible:

  • PENDING - The container service is being created.

  • READY - The container service is running but it does not have an active container deployment.

  • DEPLOYING - The container service is launching a container deployment.

  • RUNNING - The container service is running and it has an active container deployment.

  • UPDATING - The container service capacity or its custom domains are being updated.

  • DELETING - The container service is being deleted.

  • DISABLED - The container service is disabled, and its active deployment and containers, if any, are shut down.

container_services[].state_detail

An object that describes the current state of the container service.

The state detail is populated only when a container service is in a PENDING, DEPLOYING, or UPDATING state.

Show child fields
container_services[].state_detail.code

The state code of the container service.

The following state codes are possible:

  • The following state codes are possible if your container service is in a DEPLOYING or UPDATING state:

    • CREATING_SYSTEM_RESOURCES - The system resources for your container service are being created.

    • CREATING_NETWORK_INFRASTRUCTURE - The network infrastructure for your container service are being created.

    • PROVISIONING_CERTIFICATE - The SSL/TLS certificate for your container service is being created.

    • PROVISIONING_SERVICE - Your container service is being provisioned.

    • CREATING_DEPLOYMENT - Your deployment is being created on your container service.

    • EVALUATING_HEALTH_CHECK - The health of your deployment is being evaluated.

    • ACTIVATING_DEPLOYMENT - Your deployment is being activated.

  • The following state codes are possible if your container service is in a PENDING state:

    • CERTIFICATE_LIMIT_EXCEEDED - The SSL/TLS certificate required for your container service exceeds the maximum number of certificates allowed for your account.

    • UNKNOWN_ERROR - An error was experienced when your container service was being created.

container_services[].state_detail.message

A message that provides more information for the state code.

The state detail is populated only when a container service is in a PENDING, DEPLOYING, or UPDATING state.

container_services[].tags[]
Show child fields
container_services[].tags[].key

The key of the tag.

Constraints: Tag keys accept a maximum of 128 letters, numbers, spaces in UTF-8, or the following characters: + - = . _ :/@

container_services[].tags[].value

The value of the tag.

Constraints: Tag values accept a maximum of 256 letters, numbers, spaces in UTF-8, or the following characters: + - = . _ :/@

container_services[].url

The publicly accessible URL of the container service.

If no public endpoint is specified in the currentDeployment, this URL returns a 404 response.