Skip to content

Commit f40014e

Browse files
committed
Add pre-commit hooks
1 parent 4585c97 commit f40014e

File tree

2 files changed

+92
-0
lines changed

2 files changed

+92
-0
lines changed

.pre-commit-config.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
repos:
2+
- repo: git://github.com/antonbabenko/pre-commit-terraform
3+
rev: v1.50.0
4+
hooks:
5+
- id: terraform_docs
6+
- id: terraform_fmt
7+
- id: terraform_validate

README.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,88 @@ The ECS Cluster module:
2828
The ECS Task Definition module:
2929
* Github Releases: <https://github.com/cn-terraform/terraform-aws-ecs-fargate-task-definition/releases>
3030
* Terraform Module Registry: <https://registry.terraform.io/modules/cn-terraform/ecs-fargate-task-definition/aws>
31+
32+
## Install pre commit hooks.
33+
34+
Pleas run this command right after cloning the repository.
35+
36+
pre-commit install
37+
38+
For that you may need to install the folowwing tools:
39+
* [Pre-commit](https://pre-commit.com/)
40+
* [Terraform Docs](https://terraform-docs.io/)
41+
42+
In order to run all checks at any point run the following command:
43+
44+
pre-commit run --all-files
45+
46+
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
47+
## Requirements
48+
49+
| Name | Version |
50+
|------|---------|
51+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13 |
52+
53+
## Providers
54+
55+
| Name | Version |
56+
|------|---------|
57+
| <a name="provider_aws"></a> [aws](#provider\_aws) | n/a |
58+
59+
## Modules
60+
61+
No modules.
62+
63+
## Resources
64+
65+
| Name | Type |
66+
|------|------|
67+
| [aws_cloudwatch_event_rule.event_rule](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_event_rule) | resource |
68+
| [aws_cloudwatch_event_target.ecs_scheduled_task](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_event_target) | resource |
69+
| [aws_iam_role.scheduled_task_cw_event_role](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource |
70+
| [aws_iam_role_policy.scheduled_task_cw_event_role_cloudwatch_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy) | resource |
71+
| [aws_iam_policy_document.scheduled_task_cw_event_role_assume_role_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |
72+
| [aws_iam_policy_document.scheduled_task_cw_event_role_cloudwatch_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |
73+
74+
## Inputs
75+
76+
| Name | Description | Type | Default | Required |
77+
|------|-------------|------|---------|:--------:|
78+
| <a name="input_ecs_cluster_arn"></a> [ecs\_cluster\_arn](#input\_ecs\_cluster\_arn) | The ECS Cluster where the scheduled task will run | `any` | n/a | yes |
79+
| <a name="input_ecs_execution_task_role_arn"></a> [ecs\_execution\_task\_role\_arn](#input\_ecs\_execution\_task\_role\_arn) | (Required) The task definition execution role. The Amazon Resource Name (ARN) of the IAM role to be used for this target when the rule is triggered. | `any` | n/a | yes |
80+
| <a name="input_event_rule_description"></a> [event\_rule\_description](#input\_event\_rule\_description) | (Optional) The description of the rule. | `any` | `null` | no |
81+
| <a name="input_event_rule_event_bus_name"></a> [event\_rule\_event\_bus\_name](#input\_event\_rule\_event\_bus\_name) | (Optional) The event bus to associate with this rule. If you omit this, the default event bus is used. | `any` | `null` | no |
82+
| <a name="input_event_rule_event_pattern"></a> [event\_rule\_event\_pattern](#input\_event\_rule\_event\_pattern) | (Optional) The event pattern described a JSON object. At least one of schedule\_expression or event\_pattern is required. | `any` | `null` | no |
83+
| <a name="input_event_rule_is_enabled"></a> [event\_rule\_is\_enabled](#input\_event\_rule\_is\_enabled) | (Optional) Whether the rule should be enabled (defaults to true). | `bool` | `true` | no |
84+
| <a name="input_event_rule_name"></a> [event\_rule\_name](#input\_event\_rule\_name) | The name of the rule. | `any` | n/a | yes |
85+
| <a name="input_event_rule_role_arn"></a> [event\_rule\_role\_arn](#input\_event\_rule\_role\_arn) | (Optional) The Amazon Resource Name (ARN) associated with the role that is used for target invocation. | `any` | `null` | no |
86+
| <a name="input_event_rule_schedule_expression"></a> [event\_rule\_schedule\_expression](#input\_event\_rule\_schedule\_expression) | (Optional) The scheduling expression. For example, cron(0 20 * * ? *) or rate(5 minutes). At least one of event\_rule\_schedule\_expression or event\_rule\_event\_pattern is required. Can only be used on the default event bus. | `any` | `null` | no |
87+
| <a name="input_event_target_ecs_target_assign_public_ip"></a> [event\_target\_ecs\_target\_assign\_public\_ip](#input\_event\_target\_ecs\_target\_assign\_public\_ip) | (Optional) Assign a public IP address to the ENI. Default false. | `bool` | `false` | no |
88+
| <a name="input_event_target_ecs_target_group"></a> [event\_target\_ecs\_target\_group](#input\_event\_target\_ecs\_target\_group) | (Optional) Specifies an ECS task group for the task. The maximum length is 255 characters. | `any` | `null` | no |
89+
| <a name="input_event_target_ecs_target_platform_version"></a> [event\_target\_ecs\_target\_platform\_version](#input\_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. For more information about valid platform versions, see AWS Fargate Platform Versions. Default to LATEST | `string` | `"LATEST"` | no |
90+
| <a name="input_event_target_ecs_target_security_groups"></a> [event\_target\_ecs\_target\_security\_groups](#input\_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. | `list(any)` | `null` | no |
91+
| <a name="input_event_target_ecs_target_subnets"></a> [event\_target\_ecs\_target\_subnets](#input\_event\_target\_ecs\_target\_subnets) | The subnets associated with the task or service. | `list(any)` | n/a | yes |
92+
| <a name="input_event_target_ecs_target_task_count"></a> [event\_target\_ecs\_target\_task\_count](#input\_event\_target\_ecs\_target\_task\_count) | (Optional) The number of tasks to create based on the TaskDefinition. The default is 1. | `number` | `1` | no |
93+
| <a name="input_event_target_ecs_target_task_definition_arn"></a> [event\_target\_ecs\_target\_task\_definition\_arn](#input\_event\_target\_ecs\_target\_task\_definition\_arn) | (Required) The ARN of the task definition to use if the event target is an Amazon ECS cluster. | `any` | n/a | yes |
94+
| <a name="input_event_target_input"></a> [event\_target\_input](#input\_event\_target\_input) | (Optional) Valid JSON text passed to the target. Conflicts with event\_target\_input\_path. | `any` | `null` | no |
95+
| <a name="input_event_target_input_path"></a> [event\_target\_input\_path](#input\_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. Conflicts with event\_target\_input. | `any` | `null` | no |
96+
| <a name="input_event_target_target_id"></a> [event\_target\_target\_id](#input\_event\_target\_target\_id) | (Optional) The unique target assignment ID. If missing, will generate a random, unique id. | `any` | `null` | no |
97+
| <a name="input_name_prefix"></a> [name\_prefix](#input\_name\_prefix) | Name prefix for resources on AWS | `any` | n/a | yes |
98+
99+
## Outputs
100+
101+
| Name | Description |
102+
|------|-------------|
103+
| <a name="output_aws_cloudwatch_event_rule_event_rule_arn"></a> [aws\_cloudwatch\_event\_rule\_event\_rule\_arn](#output\_aws\_cloudwatch\_event\_rule\_event\_rule\_arn) | The Amazon Resource Name (ARN) of the CloudWatch Event Rule. |
104+
| <a name="output_aws_cloudwatch_event_rule_event_rule_id"></a> [aws\_cloudwatch\_event\_rule\_event\_rule\_id](#output\_aws\_cloudwatch\_event\_rule\_event\_rule\_id) | The name of the rule. |
105+
| <a name="output_aws_iam_role_policy_scheduled_task_cw_event_role_cloudwatch_policy_id"></a> [aws\_iam\_role\_policy\_scheduled\_task\_cw\_event\_role\_cloudwatch\_policy\_id](#output\_aws\_iam\_role\_policy\_scheduled\_task\_cw\_event\_role\_cloudwatch\_policy\_id) | The role policy ID, in the form of role\_name:role\_policy\_name. |
106+
| <a name="output_aws_iam_role_policy_scheduled_task_cw_event_role_cloudwatch_policy_name"></a> [aws\_iam\_role\_policy\_scheduled\_task\_cw\_event\_role\_cloudwatch\_policy\_name](#output\_aws\_iam\_role\_policy\_scheduled\_task\_cw\_event\_role\_cloudwatch\_policy\_name) | The name of the policy. |
107+
| <a name="output_aws_iam_role_policy_scheduled_task_cw_event_role_cloudwatch_policy_policy"></a> [aws\_iam\_role\_policy\_scheduled\_task\_cw\_event\_role\_cloudwatch\_policy\_policy](#output\_aws\_iam\_role\_policy\_scheduled\_task\_cw\_event\_role\_cloudwatch\_policy\_policy) | The policy document attached to the role. |
108+
| <a name="output_aws_iam_role_policy_scheduled_task_cw_event_role_cloudwatch_policy_role"></a> [aws\_iam\_role\_policy\_scheduled\_task\_cw\_event\_role\_cloudwatch\_policy\_role](#output\_aws\_iam\_role\_policy\_scheduled\_task\_cw\_event\_role\_cloudwatch\_policy\_role) | The name of the role associated with the policy. |
109+
| <a name="output_scheduled_task_cw_event_role_arn"></a> [scheduled\_task\_cw\_event\_role\_arn](#output\_scheduled\_task\_cw\_event\_role\_arn) | The Amazon Resource Name (ARN) specifying the role. |
110+
| <a name="output_scheduled_task_cw_event_role_create_date"></a> [scheduled\_task\_cw\_event\_role\_create\_date](#output\_scheduled\_task\_cw\_event\_role\_create\_date) | The creation date of the IAM role. |
111+
| <a name="output_scheduled_task_cw_event_role_description"></a> [scheduled\_task\_cw\_event\_role\_description](#output\_scheduled\_task\_cw\_event\_role\_description) | The description of the role. |
112+
| <a name="output_scheduled_task_cw_event_role_id"></a> [scheduled\_task\_cw\_event\_role\_id](#output\_scheduled\_task\_cw\_event\_role\_id) | The name of the role. |
113+
| <a name="output_scheduled_task_cw_event_role_name"></a> [scheduled\_task\_cw\_event\_role\_name](#output\_scheduled\_task\_cw\_event\_role\_name) | The name of the role. |
114+
| <a name="output_scheduled_task_cw_event_role_unique_id"></a> [scheduled\_task\_cw\_event\_role\_unique\_id](#output\_scheduled\_task\_cw\_event\_role\_unique\_id) | The stable and unique string identifying the role. |
115+
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

0 commit comments

Comments
 (0)