Skip to content

Commit d46e326

Browse files
committed
Updating README.md
1 parent 58d8f10 commit d46e326

File tree

1 file changed

+78
-4
lines changed

1 file changed

+78
-4
lines changed

README.md

Lines changed: 78 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,105 @@ This Terraform module deploys an AWS ECS Fargate scheduled task service.
44

55
[![CircleCI](https://circleci.com/gh/jnonino/terraform-aws-ecs-fargate-scheduled-task/tree/master.svg?style=svg)](https://circleci.com/gh/jnonino/terraform-aws-ecs-fargate-scheduled-task/tree/master)
66

7+
## Usage
8+
9+
Check versions for this module on:
10+
* Github Releases: <https://github.com/jnonino/terraform-aws-ecs-fargate-scheduled-task/releases>
11+
* Terraform Module Registry: <https://registry.terraform.io/modules/jnonino/ecs-fargate-scheduled-task/aws>
12+
13+
module "td" {
14+
source = "jnonino/ecs-fargate-scheduled-task/aws"
15+
version = "1.0.0"
16+
name_preffix = var.name_preffix
17+
profile = var.profile
18+
region = var.region
19+
ecs_cluster_arn = module.ecs-cluster.aws_ecs_cluster_cluster_arn
20+
event_rule_name = <RULE_NAME>
21+
ecs_execution_task_role_arn = module.td.aws_iam_role_ecs_task_execution_role_arn
22+
event_rule_schedule_expression = <SCHEDULE_EXPRESSION>
23+
event_rule_event_pattern = <EVENT_PATTERN>
24+
event_target_ecs_target_task_definition_arn = module.td.aws_ecs_task_definition_td_arn
25+
event_target_ecs_target_subnets = module.networking.private_subnets_ids
26+
}
27+
28+
Check the section "Other modules that you may need to use this module" for details about modules mentioned in the usage example.
29+
730
## Input values
831

932
* name_preffix: Name preffix for resources on AWS.
1033
* profile: AWS API key credentials to use.
1134
* region: AWS Region the infrastructure is hosted in.
1235
* ecs_cluster_arn: The ECS Cluster where the scheduled task will run.
1336
* event_rule_name: The rule's name.
14-
* event_rule_description: (Optional) The description of the rule.
37+
* ecs_execution_task_role_arn: The task definition execution role.
1538
* event_rule_schedule_expression: (Required, if event_pattern isn't specified) The scheduling expression. For example, cron(0 20 * * ? *) or rate(5 minutes).
1639
* event_rule_event_pattern: (Required, if schedule_expression isn't specified) Event pattern described a JSON object. See full documentation of CloudWatch Events and Event Patterns for details.
40+
* event_target_ecs_target_task_definition_arn: The ARN of the task definition to use if the event target is an Amazon ECS cluster.
41+
* event_target_ecs_target_subnets: The subnets associated with the task or service.
42+
* event_rule_description: (Optional) The description of the rule.
1743
* event_rule_role_arn: (Optional) The Amazon Resource Name (ARN) associated with the role that is used for target invocation.
1844
* event_rule_is_enabled: (Optional) Whether the rule should be enabled (defaults to true).
1945
* event_target_target_id: (Optional) The unique target assignment ID. If missing, will generate a random, unique id.
2046
* event_target_input: (Optional) Valid JSON text passed to the target.
2147
* event_target_input_path: (Optional) The value of the JSONPath that is used for extracting part of the matched event when passing it to the target.
22-
* event_target_ecs_target_task_definition_arn: The ARN of the task definition to use if the event target is an Amazon ECS cluster.
23-
* event_target_ecs_target_subnets: The subnets associated with the task or service.
2448
* event_target_ecs_target_security_groups: (Optional) The security groups associated with the task or service. If you do not specify a security group, the default security group for the VPC is used.
2549
* event_target_ecs_target_assign_public_ip: (Optional) Assign a public IP address to the ENI (Fargate launch type only). Valid values are true or false. Default false.
2650
* event_target_ecs_target_task_count: (Optional) The number of tasks to create based on the TaskDefinition. The default is 1.
2751
* event_target_ecs_target_platform_version: (Optional) Specifies the platform version for the task. Specify only the numeric portion of the platform version, such as 1.1.0. This is used only if LaunchType is FARGATE.
2852
* event_target_ecs_target_group: (Optional) Specifies an ECS task group for the task. The maximum length is 255 characters.
29-
* ecs_execution_task_role_arn: The task definition execution role
3053

3154
## Output values
3255

3356
* aws_cloudwatch_event_rule_event_rule_arn: The Amazon Resource Name (ARN) of the CloudWatch Event Rule.
3457

58+
## Other modules that you may need to use this module
59+
60+
The networking module should look like this:
61+
62+
module "networking" {
63+
source = "jnonino/networking/aws"
64+
version = "2.0.3"
65+
name_preffix = var.name_preffix
66+
profile = var.profile
67+
region = var.region
68+
vpc_cidr_block = "192.168.0.0/16"
69+
availability_zones = [ "us-east-1a", "us-east-1b", "us-east-1c", "us-east-1d" ]
70+
public_subnets_cidrs_per_availability_zone = [ "192.168.0.0/19", "192.168.32.0/19", "192.168.64.0/19", "192.168.96.0/19" ]
71+
private_subnets_cidrs_per_availability_zone = [ "192.168.128.0/19", "192.168.160.0/19", "192.168.192.0/19", "192.168.224.0/19" ]
72+
}
73+
74+
Check versions for this module on:
75+
* Github Releases: <https://github.com/jnonino/terraform-aws-networking/releases>
76+
* Terraform Module Registry: <https://registry.terraform.io/modules/jnonino/networking/aws>
77+
78+
The ECS cluster module should look like this:
79+
80+
module "ecs-cluster":
81+
source = "jnonino/ecs-cluster/aws"
82+
version = "1.0.0"
83+
name_preffix = var.name_preffix
84+
profile = var.profile
85+
region = var.region
86+
}
87+
88+
Check versions for this module on:
89+
* Github Releases: <https://github.com/jnonino/terraform-aws-ecs-cluster/releases>
90+
* Terraform Module Registry: <https://registry.terraform.io/modules/jnonino/ecs-cluster/aws>
91+
92+
The task definition module should like this:
93+
94+
module "td" {
95+
source = "jnonino/ecs-fargate-task-definition/aws"
96+
version = "1.0.0"
97+
name_preffix = var.name_preffix
98+
profile = var.profile
99+
region = var.region
100+
container_name = "${var.name_preffix}-<NAME>"
101+
container_image = "<IMAGE_NAME>:<IMAGE_TAG>"
102+
container_port = <PORT>
103+
}
104+
105+
Check versions for this module on:
106+
* Github Releases: <https://github.com/jnonino/terraform-aws-ecs-fargate-task-definition/releases>
107+
* Terraform Module Registry: <https://registry.terraform.io/modules/jnonino/ecs-fargate-task-definition/aws>
108+

0 commit comments

Comments
 (0)