Skip to main content

container_associations

Creates, updates, deletes, gets or lists a container_associations resource.

Overview

Namecontainer_associations
TypeResource
Idaws.network_firewall.container_associations

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
container_association_arnstringThe Amazon Resource Name (ARN) of the container association. (pattern: <code>^arn:aws.*</code>)
container_association_namestringThe descriptive name of the container association. (pattern: <code>^[a-zA-Z0-9-]+$</code>)
container_monitoring_configurationsarrayThe monitoring configurations for the container association.
descriptionstringA description of the container association. (pattern: <code>^.*$</code>)
last_updated_timestring (date-time)The most recent time that Network Firewall updated the container association.
resolved_cidr_countintegerThe number of CIDR blocks resolved from the monitored containers.
statusstringThe current status of the container association. (ACTIVE, CREATING, DELETING, UPDATING)
tagsarrayThe key:value pairs to associate with the resource.
typestringThe container type. Valid values: ECS - Amazon Elastic Container Service EKS - Amazon Elastic Kubernetes Service (ECS, EKS)
update_tokenstringA token used for optimistic locking. Network Firewall returns a token to your requests that access the container association. The token marks the state of the container association resource at the time of the request. To make changes to the container association, you provide the token in your request. Network Firewall uses the token to ensure that the container association hasn't changed since you last retrieved it. If it has changed, the operation fails with an InvalidTokenException. If this happens, retrieve the container association again to get a current copy of it with a current token. Reapply your changes as needed, then try the operation again using the new token. (pattern: <code>^([0-9a-f]{8})-([0-9a-f]{4}-){3}([0-9a-f]{12})$</code>)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_container_associationselectregionRetrieves the configuration and status of a container association.
list_container_associationsselectregionLists the container associations in your account and Region. Use the NextToken parameter in subsequent requests to retrieve additional results.
create_container_associationinsertregion, ContainerAssociationName, ContainerMonitoringConfigurationsCreates a Network Firewall container association. The association monitors container lifecycle events in your Amazon ECS or Amazon EKS clusters and resolves running container addresses for use in firewall rules.
update_container_associationupdateregion, ContainerMonitoringConfigurations, UpdateTokenUpdates the monitoring configurations and description of a container association. You can't change the container type after creation. Provide an update token to enable optimistic concurrency control.
delete_container_associationdeleteregionDeletes a container association. The resource transitions to a DELETING state. Deletion is asynchronous - Network Firewall returns immediately while cleanup proceeds in the background. You can't delete a container association while a rule group references it.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

Retrieves the configuration and status of a container association.

SELECT
container_association_arn,
container_association_name,
container_monitoring_configurations,
description,
last_updated_time,
resolved_cidr_count,
status,
tags,
type,
update_token
FROM aws.network_firewall.container_associations
WHERE region = '{{ region }}' -- required
;

INSERT examples

Creates a Network Firewall container association. The association monitors container lifecycle events in your Amazon ECS or Amazon EKS clusters and resolves running container addresses for use in firewall rules.

INSERT INTO aws.network_firewall.container_associations (
ContainerAssociationName,
Description,
Type,
ContainerMonitoringConfigurations,
Tags,
region
)
SELECT
'{{ ContainerAssociationName }}' /* required */,
'{{ Description }}',
'{{ Type }}',
'{{ ContainerMonitoringConfigurations }}' /* required */,
'{{ Tags }}',
'{{ region }}'
RETURNING
container_association_arn,
container_association_name,
container_monitoring_configurations,
description,
status,
tags,
type,
update_token
;

UPDATE examples

Updates the monitoring configurations and description of a container association. You can't change the container type after creation. Provide an update token to enable optimistic concurrency control.

UPDATE aws.network_firewall.container_associations
SET
ContainerAssociationName = '{{ ContainerAssociationName }}',
ContainerAssociationArn = '{{ ContainerAssociationArn }}',
Description = '{{ Description }}',
Type = '{{ Type }}',
ContainerMonitoringConfigurations = '{{ ContainerMonitoringConfigurations }}',
Tags = '{{ Tags }}',
UpdateToken = '{{ UpdateToken }}'
WHERE
region = '{{ region }}' --required
AND ContainerMonitoringConfigurations = '{{ ContainerMonitoringConfigurations }}' --required
AND UpdateToken = '{{ UpdateToken }}' --required
RETURNING
container_association_arn,
container_association_name,
container_monitoring_configurations,
description,
status,
tags,
type,
update_token;

DELETE examples

Deletes a container association. The resource transitions to a DELETING state. Deletion is asynchronous - Network Firewall returns immediately while cleanup proceeds in the background. You can't delete a container association while a rule group references it.

DELETE FROM aws.network_firewall.container_associations
WHERE region = '{{ region }}' --required
;