Skip to main content

attributes

Creates, updates, deletes, gets or lists an attributes resource.

Overview

Nameattributes
TypeResource
Idaws.ecs.attributes

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringThe name of the attribute. The name must contain between 1 and 128 characters. The name may contain letters (uppercase and lowercase), numbers, hyphens (-), underscores (_), forward slashes (/), back slashes (), or periods (.).
target_idstringThe ID of the target. You can specify the short form ID for a resource or the full Amazon Resource Name (ARN).
target_typestringThe type of the target to attach the attribute with. This parameter is required if you use the short form ID for a resource instead of the full ARN. (container-instance)
valuestringThe value of the attribute. The value must contain between 1 and 128 characters. It can contain letters (uppercase and lowercase), numbers, hyphens (-), underscores (_), periods (.), at signs (@), forward slashes (/), back slashes (), colons (:), or spaces. The value can't start or end with a space.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_attributesselectregionLists the attributes for Amazon ECS resources within a specified target type and cluster. When you specify a target type and cluster, ListAttributes returns a list of attribute objects, one for each attribute on each resource. You can filter the list of results to a single attribute name to only return results that have that name. You can also filter the results by attribute name and value. You can do this, for example, to see which container instances in a cluster are running a Linux AMI (ecs.os-type=linux).
put_attributesreplaceregion, attributesCreate or update an attribute on an Amazon ECS resource. If the attribute doesn't exist, it's created. If the attribute exists, its value is replaced with the specified value. To delete an attribute, use DeleteAttributes. For more information, see Attributes in the Amazon Elastic Container Service Developer Guide.
delete_attributesdeleteregionDeletes one or more custom attributes from an Amazon ECS resource.

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

Lists the attributes for Amazon ECS resources within a specified target type and cluster. When you specify a target type and cluster, ListAttributes returns a list of attribute objects, one for each attribute on each resource. You can filter the list of results to a single attribute name to only return results that have that name. You can also filter the results by attribute name and value. You can do this, for example, to see which container instances in a cluster are running a Linux AMI (ecs.os-type=linux).

SELECT
name,
target_id,
target_type,
value
FROM aws.ecs.attributes
WHERE region = '{{ region }}' -- required
;

REPLACE examples

Create or update an attribute on an Amazon ECS resource. If the attribute doesn't exist, it's created. If the attribute exists, its value is replaced with the specified value. To delete an attribute, use DeleteAttributes. For more information, see Attributes in the Amazon Elastic Container Service Developer Guide.

REPLACE aws.ecs.attributes
SET
cluster = '{{ cluster }}',
attributes = '{{ attributes }}'
WHERE
region = '{{ region }}' --required
AND attributes = '{{ attributes }}' --required
RETURNING
attributes;

DELETE examples

Deletes one or more custom attributes from an Amazon ECS resource.

DELETE FROM aws.ecs.attributes
WHERE region = '{{ region }}' --required
;