Skip to content
This repository has been archived by the owner on Aug 16, 2022. It is now read-only.

ecs_task_definitions_implementation #317

Merged
merged 5 commits into from
Dec 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ All notable changes to this provider will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
* Added `aws_ecs_task_definitions` resource

## [Unreleased]
### :rocket: Added
Expand Down
40 changes: 40 additions & 0 deletions client/mocks/mock_ecs.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions client/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,8 @@ type EcsClient interface {
DescribeContainerInstances(ctx context.Context, params *ecs.DescribeContainerInstancesInput, optFns ...func(*ecs.Options)) (*ecs.DescribeContainerInstancesOutput, error)
ListServices(ctx context.Context, params *ecs.ListServicesInput, optFns ...func(*ecs.Options)) (*ecs.ListServicesOutput, error)
ListContainerInstances(ctx context.Context, params *ecs.ListContainerInstancesInput, optFns ...func(*ecs.Options)) (*ecs.ListContainerInstancesOutput, error)
ListTaskDefinitions(ctx context.Context, params *ecs.ListTaskDefinitionsInput, optFns ...func(*ecs.Options)) (*ecs.ListTaskDefinitionsOutput, error)
DescribeTaskDefinition(ctx context.Context, params *ecs.DescribeTaskDefinitionInput, optFns ...func(*ecs.Options)) (*ecs.DescribeTaskDefinitionOutput, error)
}

//go:generate mockgen -package=mocks -destination=./mocks/mock_elasticsearch.go . ElasticSearch
Expand Down
60 changes: 60 additions & 0 deletions docs/tables/aws_ecs_task_definition_container_definitions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@

# Table: aws_ecs_task_definition_container_definitions
Container definitions are used in task definitions to describe the different containers that are launched as part of a task.
## Columns
| Name | Type | Description |
| ------------- | ------------- | ----- |
|task_definition_cq_id|uuid|Unique CloudQuery ID of aws_ecs_task_definitions table (FK)|
|command|text[]|The command that is passed to the container|
|cpu|integer|The number of cpu units reserved for the container|
|depends_on|jsonb|The dependencies defined for container startup and shutdown|
|disable_networking|boolean|When this parameter is true, networking is disabled within the container|
|dns_search_domains|text[]|A list of DNS search domains that are presented to the container|
|dns_servers|text[]|A list of DNS servers that are presented to the container|
|docker_labels|jsonb|A key/value map of labels to add to the container|
|docker_security_options|text[]|A list of strings to provide custom labels for SELinux and AppArmor multi-level security systems|
|entry_point|text[]|Early versions of the Amazon ECS container agent do not properly handle entryPoint parameters|
|environment|jsonb|The environment variables to pass to a container|
|environment_files|jsonb|A list of files containing the environment variables to pass to a container. This parameter maps to the --env-file option to docker run (https://docs.docker.com/engine/reference/run/#security-configuration)|
|essential|boolean|If the essential parameter of a container is marked as true, and that container fails or stops for any reason, all other containers that are part of the task are stopped|
|extra_hosts|jsonb|A list of hostnames and IP address mappings to append to the /etc/hosts file on the container|
|firelens_configuration_type|text|The log router to use|
|firelens_configuration_options|jsonb|The options to use when configuring the log router|
|health_check_command|text[]|A string array representing the command that the container runs to determine if it is healthy|
|health_check_interval|integer|The time period in seconds between each health check execution|
|health_check_retries|integer|The number of times to retry a failed health check before the container is considered unhealthy|
|health_check_start_period|integer|The optional grace period within which to provide containers time to bootstrap before failed health checks count towards the maximum number of retries|
|health_check_timeout|integer|The time period in seconds to wait for a health check to succeed before it is considered a failure|
|hostname|text|The hostname to use for your container|
|image|text|The image used to start a container|
|interactive|boolean|When this parameter is true, this allows you to deploy containerized applications that require stdin or a tty to be allocated|
|links|text[]|The links parameter allows containers to communicate with each other without the need for port mappings|
|linux_parameters_capabilities_add|text[]|The Linux capabilities for the container that have been added to the default configuration provided by Docker|
|linux_parameters_capabilities_drop|text[]|The Linux capabilities for the container that have been removed from the default configuration provided by Docker|
|linux_parameters_devices|jsonb|Any host devices to expose to the container|
|linux_parameters_init_process_enabled|boolean|Run an init process inside the container that forwards signals and reaps processes|
|linux_parameters_max_swap|integer|The total amount of swap memory (in MiB) a container can use|
|linux_parameters_shared_memory_size|integer|The value for the size (in MiB) of the /dev/shm volume|
|linux_parameters_swappiness|integer|This allows you to tune a container's memory swappiness behavior|
|linux_parameters_tmpfs|jsonb|The container path, mount options, and size (in MiB) of the tmpfs mount|
|log_configuration_log_driver|text|The log driver to use for the container|
|log_configuration_options|jsonb|The configuration options to send to the log driver|
|log_configuration_secret_options|jsonb|The secrets to pass to the log configuration|
|memory|integer|The amount (in MiB) of memory to present to the container|
|memory_reservation|integer|The soft limit (in MiB) of memory to reserve for the container|
|mount_points|jsonb|The mount points for data volumes in your container|
|name|text|The name of a container|
|port_mappings|jsonb|The list of port mappings for the container|
|privileged|boolean|When this parameter is true, the container is given elevated privileges on the host container instance (similar to the root user)|
|pseudo_terminal|boolean|When this parameter is true, a TTY is allocated|
|readonly_root_filesystem|boolean|When this parameter is true, the container is given read-only access to its root file system|
|repository_credentials_parameter|text|The Amazon Resource Name (ARN) of the secret containing the private repository credentials|
|resource_requirements|jsonb|The type and amount of a resource to assign to a container|
|secrets|jsonb|The secrets to pass to the container|
|start_timeout|integer|Time duration (in seconds) to wait before giving up on resolving dependencies for a container|
|stop_timeout|integer|Time duration (in seconds) to wait before the container is forcefully killed if it doesn't exit normally on its own|
|system_controls|jsonb|A list of namespaced kernel parameters to set in the container|
|ulimits|jsonb|A list of ulimits to set in the container|
|user|text|The user to use inside the container|
|volumes_from|jsonb|Data volumes to mount from another container|
|working_directory|text|The working directory in which to run commands inside the container|
24 changes: 24 additions & 0 deletions docs/tables/aws_ecs_task_definition_volumes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

# Table: aws_ecs_task_definition_volumes
A data volume used in a task definition
## Columns
| Name | Type | Description |
| ------------- | ------------- | ----- |
|task_definition_cq_id|uuid|Unique CloudQuery ID of aws_ecs_task_definitions table (FK)|
|docker_autoprovision|boolean|If this value is true, the Docker volume is created if it does not already exist|
|docker_driver|text|The Docker volume driver to use|
|docker_driver_opts|jsonb|A map of Docker driver-specific options passed through|
|docker_labels|jsonb|Custom metadata to add to your Docker volume|
|docker_scope|text|The scope for the Docker volume that determines its lifecycle|
|efs_file_system_id|text|The Amazon EFS file system ID to use.|
|efs_authorization_config_access_point_id|text|The Amazon EFS access point ID to use|
|efs_authorization_config_iam|text|Whether or not to use the Amazon ECS task IAM role defined in a task definition when mounting the Amazon EFS file system|
|efs_root_directory|text|The directory within the Amazon EFS file system to mount as the root directory inside the host|
|efs_volume_configuration_transit_encryption|text|Whether or not to enable encryption for Amazon EFS data in transit between the Amazon ECS host and the Amazon EFS server|
|efs_transit_encryption_port|integer|The port to use when sending encrypted data between the Amazon ECS host and the Amazon EFS server|
|fsx_wfs_authorization_config_credentials_parameter|text|The authorization credential option to use|
|fsx_wfs_authorization_config_domain|text|A fully qualified domain name hosted by an AWS Directory Service (https://docs.aws.amazon.com/directoryservice/latest/admin-guide/directory_microsoft_ad.html) Managed Microsoft AD (Active Directory) or self-hosted AD on Amazon EC2.|
|fsx_wfs_file_system_id|text|The Amazon FSx for Windows File Server file system ID to use.|
|fsx_wfs_root_directory|text|The directory within the Amazon FSx for Windows File Server file system to mount as the root directory inside the host.|
|host_source_path|text|When the host parameter is used, specify a sourcePath to declare the path on the host container instance that is presented to the container|
|name|text|The name of the volume|
31 changes: 31 additions & 0 deletions docs/tables/aws_ecs_task_definitions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

# Table: aws_ecs_task_definitions
The details of a task definition which describes the container and volume definitions of an Amazon Elastic Container Service task
## Columns
| Name | Type | Description |
| ------------- | ------------- | ----- |
|account_id|text|The AWS Account ID of the resource.|
|region|text|The AWS Region of the resource.|
|tags|jsonb|The metadata that you apply to the service to help you categorize and organize them|
|compatibilities|text[]|The task launch types the task definition validated against during task definition registration|
|cpu|text|The number of cpu units used by the task|
|deregistered_at|timestamp without time zone|The Unix timestamp for when the task definition was deregistered.|
|execution_role_arn|text|The Amazon Resource Name (ARN) of the task execution role that grants the Amazon ECS container agent permission to make AWS API calls on your behalf|
|family|text|The name of a family that this task definition is registered to|
|inference_accelerators|jsonb|The Elastic Inference accelerator associated with the task.|
|ipc_mode|text|The IPC resource namespace to use for the containers in the task|
|memory|text|The amount (in MiB) of memory used by the task|
|network_mode|text|The Docker networking mode to use for the containers in the task|
|pid_mode|text|The process namespace to use for the containers in the task|
|placement_constraints|jsonb|An array of placement constraint objects to use for tasks|
|proxy_configuration_container_name|text|The name of the container that will serve as the App Mesh proxy.|
|proxy_configuration_properties|jsonb|The set of network configuration parameters to provide the Container Network Interface (CNI) plugin, specified as key-value pairs. * IgnoredUID - (Required) The user ID (UID) of the proxy container as defined by the user parameter in a container definition|
|proxy_configuration_type|text|The proxy type|
|registered_at|timestamp without time zone|The Unix timestamp for when the task definition was registered.|
|registered_by|text|The principal that registered the task definition.|
|requires_attributes|jsonb|The container instance attributes required by your task|
|requires_compatibilities|text[]|The task launch types the task definition was validated against|
|revision|integer|The revision of the task in a particular family|
|status|text|The status of the task definition.|
|arn|text|The full Amazon Resource Name (ARN) of the task definition.|
|task_role_arn|text|The short name or full Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that grants containers in the task permission to call AWS APIs on your behalf|
Loading