attributes
Creates, updates, deletes, gets or lists an attributes resource.
Overview
| Name | attributes |
| Type | Resource |
| Id | aws.ecs.attributes |
Fields
The following fields are returned by SELECT queries:
- list_attributes
| Name | Datatype | Description |
|---|---|---|
name | string | The 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_id | string | The ID of the target. You can specify the short form ID for a resource or the full Amazon Resource Name (ARN). |
target_type | string | The 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) |
value | string | The 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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_attributes | select | region | 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). | |
put_attributes | replace | region, attributes | 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. | |
delete_attributes | delete | region | Deletes 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.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- list_attributes
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
- put_attributes
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
- delete_attributes
Deletes one or more custom attributes from an Amazon ECS resource.
DELETE FROM aws.ecs.attributes
WHERE region = '{{ region }}' --required
;