Skip to content

Commit 7f38473

Browse files
committed
chore: update pre-commit configuration
1 parent 3150c2f commit 7f38473

File tree

12 files changed

+88
-74
lines changed

12 files changed

+88
-74
lines changed

.pre-commit-config.yaml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,39 @@
1+
default_install_hook_types:
2+
- pre-commit
3+
- commit-msg
4+
15
repos:
26
- repo: https://github.com/antonbabenko/pre-commit-terraform
37
rev: v1.97.4
48
hooks:
59
- id: terraform_fmt
10+
name: (terraform) Format .tf files with `terraform fmt`
611
args:
712
- --args=-diff
813
- id: terraform_validate
14+
name: (terraform) Check with `terraform validate`
915
args:
10-
- --tf-init-args=-upgrade
1116
- --hook-config=--retry-once-with-cleanup=true
12-
- id: terraform_providers_lock
13-
args:
14-
- --hook-config=--mode=always-regenerate-lockfile
17+
- --tf-init-args=-upgrade
1518
- id: terraform_tflint
19+
name: (terraform) Check with `tflint`
1620
args:
1721
- --args=--config=__GIT_WORKING_DIR__/.tflint.hcl
1822
files: ^modules/
1923
- id: terraform_docs
24+
name: (terraform) Generate docs with `terraform-docs`
2025
args: ["--args=--sort-by required"]
2126

2227
- repo: https://github.com/adrienverge/yamllint
2328
rev: v1.36.2
2429
hooks:
2530
- id: yamllint
31+
name: (yaml) Check with `yamllint`
32+
33+
- repo: https://github.com/compilerla/conventional-pre-commit
34+
rev: v4.0.0
35+
hooks:
36+
- id: conventional-pre-commit
37+
name: (commit-message) Check conventional commit
38+
stages: [commit-msg]
39+
args: []

.tflint.hcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ rule "terraform_unused_required_providers" {
7070

7171
plugin "aws" {
7272
source = "github.com/terraform-linters/tflint-ruleset-aws"
73-
version = "0.21.1"
73+
version = "0.38.0"
7474

7575
enabled = true
7676
deep_check = false

modules/ecr-registry/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This module creates following resources.
88
- `aws_ecr_pull_through_cache_rule` (optional)
99
- `aws_ecr_registry_scanning_configuration`
1010

11-
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
11+
<!-- BEGIN_TF_DOCS -->
1212
## Requirements
1313

1414
| Name | Version |
@@ -71,4 +71,4 @@ No modules.
7171
| <a name="output_scanning_basic_version"></a> [scanning\_basic\_version](#output\_scanning\_basic\_version) | The version of basic scanning for the registry. |
7272
| <a name="output_scanning_rules"></a> [scanning\_rules](#output\_scanning\_rules) | A list of scanning rules to determine which repository filters are used and at what frequency scanning will occur. |
7373
| <a name="output_scanning_type"></a> [scanning\_type](#output\_scanning\_type) | The scanning type to set for the registry. |
74-
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
74+
<!-- END_TF_DOCS -->

modules/ecr-repository/README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@ This module creates following resources.
66
- `aws_ecr_repository_policy` (optional)
77
- `aws_ecr_lifecycle_policy` (optional)
88

9-
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
9+
<!-- BEGIN_TF_DOCS -->
1010
## Requirements
1111

1212
| Name | Version |
1313
|------|---------|
14-
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.5 |
15-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.10 |
14+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.10 |
15+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.44 |
1616

1717
## Providers
1818

1919
| Name | Version |
2020
|------|---------|
21-
| <a name="provider_aws"></a> [aws](#provider\_aws) | 5.19.0 |
21+
| <a name="provider_aws"></a> [aws](#provider\_aws) | 5.91.0 |
2222

2323
## Modules
2424

@@ -39,14 +39,13 @@ This module creates following resources.
3939
| Name | Description | Type | Default | Required |
4040
|------|-------------|------|---------|:--------:|
4141
| <a name="input_name"></a> [name](#input\_name) | (Required) Desired name for the repository. | `string` | n/a | yes |
42-
| <a name="input_encryption_kms_key"></a> [encryption\_kms\_key](#input\_encryption\_kms\_key) | (Optional) The ARN of the KMS key to use when encryption\_type is `KMS`. If not specified, uses the default AWS managed key for ECR. | `string` | `null` | no |
43-
| <a name="input_encryption_type"></a> [encryption\_type](#input\_encryption\_type) | (Optional) The encryption type to use for the repository. Valid values are `AES256` or `KMS`. | `string` | `"AES256"` | no |
44-
| <a name="input_force_delete"></a> [force\_delete](#input\_force\_delete) | (Optional) If `true`, will delete the repository even if it contains images. Defaults to `false`. | `bool` | `false` | no |
45-
| <a name="input_image_scan_on_push_enabled"></a> [image\_scan\_on\_push\_enabled](#input\_image\_scan\_on\_push\_enabled) | (Optional, Deprecated) Indicates whether images are scanned after being pushed to the repository or not scanned. | `bool` | `false` | no |
46-
| <a name="input_image_tag_immutable_enabled"></a> [image\_tag\_immutable\_enabled](#input\_image\_tag\_immutable\_enabled) | (Optional) Enable tag immutability to prevent image tags from being overwritten by subsequent image pushes using the same tag. Disable tag immutability to allow image tags to be overwritten. | `bool` | `false` | no |
47-
| <a name="input_lifecycle_rules"></a> [lifecycle\_rules](#input\_lifecycle\_rules) | (Optional) A list of ECR Repository Lifecycle rules. `priority` must be unique and do not need to be sequential across rules. `descriptoin` is optional. `type` is one of `tagged`, `untagged`, or `any`. `tag_prefixes` is required if you specified `tagged` type. Specify one of `expiration_days` or `expiration_count` | `any` | `[]` | no |
42+
| <a name="input_encryption"></a> [encryption](#input\_encryption) | (Optional) The encryption configuration of the repository. `encryption` as defined below.<br/> (Optional) `type` - The encryption type to use for the repository. Valid values are `AES256` or `KMS`. Defaults to `AES256`.<br/> (Optional) `kms_key` - The ARN of the KMS key to use for encryption of the repository when `type` is `KMS`. If not specified, uses the default AWS managed key for ECR. | <pre>object({<br/> type = optional(string, "AES256")<br/> kms_key = optional(string)<br/> })</pre> | `{}` | no |
43+
| <a name="input_force_delete"></a> [force\_delete](#input\_force\_delete) | (Optional) If `true`, will delete the repository even if it contains images. Defaults to `true`. | `bool` | `true` | no |
44+
| <a name="input_image_scan_on_push_enabled"></a> [image\_scan\_on\_push\_enabled](#input\_image\_scan\_on\_push\_enabled) | (Optional, Deprecated) Indicates whether images are scanned after being pushed to the repository or not scanned. This configuration is deprecated in favor of registry level scan filters. Defaults to `false`. | `bool` | `false` | no |
45+
| <a name="input_image_tag_immutable_enabled"></a> [image\_tag\_immutable\_enabled](#input\_image\_tag\_immutable\_enabled) | (Optional) Whether to enable the image tag immutability setting for the repository. Enable tag immutability to prevent image tags from being overwritten by subsequent image pushes using the same tag. Disable tag immutability to allow image tags to be overwritten. Defaults to `false`. | `bool` | `false` | no |
46+
| <a name="input_lifecycle_rules"></a> [lifecycle\_rules](#input\_lifecycle\_rules) | (Optional) A list of Lifecycle rules for ECR repository. Each block of `lifecycle_rules` as defined below.<br/> (Required) `priority` - The order in which rules are applied, lowest to highest. A lifecycle policy rule with a priority of `1` will be applied first, a rule with priority of `2` will be next, and so on. Must be unique and do not need to be sequential across rules.<br/> (Optional) `descriptoin` - The description of the rule to describe the purpose of a rule within a lifecycle policy.<br/> (Required) `target` - The configuration of target images for the rule. `target` as defined below.<br/><br/> (Required) `status` - Valid values are `tagged`, `untagged`, or `any`. When you specify `tagged` status, either `tag_patterns` or `tag_prefixes` are required, but not both.<br/> (Optional) `tag_patterns` - A list of tag patterns to filter target images. If you specify multiple tags, only the images with all specified tags are selected. There is a maximum limit of four wildcards (*) per string.<br/> (Optional) `tag_prefixes` - A list of tag prefixes to filter target images. If you specify multiple prefixes, only the images with all specified prefixes are selected.<br/> (Required) `expiration` - The configuration of expiration condition for the rule. `expiration` as defined below.<br/><br/> (Optional) `count` - The maximum number of images to keep.<br/> (Optional) `days` - The maximum age of days to keep images. | <pre>list(object({<br/> priority = number<br/> description = optional(string, "Managed by Terraform.")<br/><br/> target = object({<br/> status = string<br/> tag_patterns = optional(list(string), [])<br/> tag_prefixes = optional(list(string), [])<br/> })<br/> expiration = object({<br/> count = optional(number)<br/> days = optional(number)<br/> })<br/> }))</pre> | `[]` | no |
4847
| <a name="input_module_tags_enabled"></a> [module\_tags\_enabled](#input\_module\_tags\_enabled) | (Optional) Whether to create AWS Resource Tags for the module informations. | `bool` | `true` | no |
49-
| <a name="input_repository_policy"></a> [repository\_policy](#input\_repository\_policy) | (Optional) The policy document for ECR Repository. This is a JSON formatted string. | `string` | `""` | no |
48+
| <a name="input_policy"></a> [policy](#input\_policy) | (Optional) The policy document for ECR Repository. This is a JSON formatted string. | `string` | `""` | no |
5049
| <a name="input_resource_group_description"></a> [resource\_group\_description](#input\_resource\_group\_description) | (Optional) The description of Resource Group. | `string` | `"Managed by Terraform."` | no |
5150
| <a name="input_resource_group_enabled"></a> [resource\_group\_enabled](#input\_resource\_group\_enabled) | (Optional) Whether to create Resource Group to find and group AWS resources which are created by this module. | `bool` | `true` | no |
5251
| <a name="input_resource_group_name"></a> [resource\_group\_name](#input\_resource\_group\_name) | (Optional) The name of Resource Group. A Resource Group name can have a maximum of 127 characters, including letters, numbers, hyphens, dots, and underscores. The name cannot start with `AWS` or `aws`. | `string` | `""` | no |
@@ -57,10 +56,11 @@ This module creates following resources.
5756
| Name | Description |
5857
|------|-------------|
5958
| <a name="output_arn"></a> [arn](#output\_arn) | The ARN of the repository. |
60-
| <a name="output_encryption"></a> [encryption](#output\_encryption) | The configuration for the encryption of repository. |
59+
| <a name="output_encryption"></a> [encryption](#output\_encryption) | The encryption configuration of the repository. |
6160
| <a name="output_image_scan_on_push_enabled"></a> [image\_scan\_on\_push\_enabled](#output\_image\_scan\_on\_push\_enabled) | Whether to scan image on push. |
6261
| <a name="output_image_tag_immutable_enabled"></a> [image\_tag\_immutable\_enabled](#output\_image\_tag\_immutable\_enabled) | Whether to enable tag immutability to prevent image tags from being overwritten. |
62+
| <a name="output_lifecycle_rules"></a> [lifecycle\_rules](#output\_lifecycle\_rules) | The lifecycle rules for the repository. |
6363
| <a name="output_name"></a> [name](#output\_name) | The name of the repository. |
6464
| <a name="output_registry_id"></a> [registry\_id](#output\_registry\_id) | The registry ID where the repository was created. |
6565
| <a name="output_url"></a> [url](#output\_url) | The URL of the repository (in the form aws\_account\_id.dkr.ecr.region.amazonaws.com/repositoryName). |
66-
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
66+
<!-- END_TF_DOCS -->

modules/eks-access-entry/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ This module creates following resources.
55
- `aws_eks_access_entry`
66
- `aws_eks_access_policy_association` (optional)
77

8-
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
8+
<!-- BEGIN_TF_DOCS -->
99
## Requirements
1010

1111
| Name | Version |
1212
|------|---------|
13-
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.6 |
13+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.10 |
1414
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.42 |
1515

1616
## Providers
@@ -40,14 +40,14 @@ This module creates following resources.
4040
| <a name="input_name"></a> [name](#input\_name) | (Required) The name of the Amazon EKS access entry. | `string` | n/a | yes |
4141
| <a name="input_principal"></a> [principal](#input\_principal) | (Required) The ARN of one, and only one, existing IAM principal to grant access to Kubernetes objects on the cluster. An IAM principal can't be included in more than one access entry. | `string` | n/a | yes |
4242
| <a name="input_kubernetes_groups"></a> [kubernetes\_groups](#input\_kubernetes\_groups) | (Optional) A set of groups within the Kubernetes cluster. Only used when `type` is `STANDARD`. | `set(string)` | `[]` | no |
43-
| <a name="input_kubernetes_permissions"></a> [kubernetes\_permissions](#input\_kubernetes\_permissions) | (Optional) A list of permissions for EKS access entry to the EKS cluster. Each item of `kubernetes_permissions` block as defined below.<br> (Required) `policy` - The ARN of the access policy that you're associating.<br> (Optional) `scope` - The type of access scope that you're associating. Valid values are `NAMESPACE`, `CLUSTER`. Defaults to `CLUSTER`.<br> (Optional) `namespaces` - A set of namespaces to which the access scope applies. You can enter plain text namespaces, or wildcard namespaces such as `dev-*`. | <pre>list(object({<br> policy = string<br> scope = optional(string, "CLUSTER")<br> namespaces = optional(set(string), [])<br> }))</pre> | `[]` | no |
43+
| <a name="input_kubernetes_permissions"></a> [kubernetes\_permissions](#input\_kubernetes\_permissions) | (Optional) A list of permissions for EKS access entry to the EKS cluster. Each item of `kubernetes_permissions` block as defined below.<br/> (Required) `policy` - The ARN of the access policy that you're associating.<br/> (Optional) `scope` - The type of access scope that you're associating. Valid values are `NAMESPACE`, `CLUSTER`. Defaults to `CLUSTER`.<br/> (Optional) `namespaces` - A set of namespaces to which the access scope applies. You can enter plain text namespaces, or wildcard namespaces such as `dev-*`. | <pre>list(object({<br/> policy = string<br/> scope = optional(string, "CLUSTER")<br/> namespaces = optional(set(string), [])<br/> }))</pre> | `[]` | no |
4444
| <a name="input_kubernetes_username"></a> [kubernetes\_username](#input\_kubernetes\_username) | (Optional) The username to authenticate to Kubernetes with. We recommend not specifying a username and letting Amazon EKS specify it for you. Defaults to the IAM principal ARN. Only used when `type` is `STANDARD`. | `string` | `null` | no |
4545
| <a name="input_module_tags_enabled"></a> [module\_tags\_enabled](#input\_module\_tags\_enabled) | (Optional) Whether to create AWS Resource Tags for the module informations. | `bool` | `true` | no |
4646
| <a name="input_resource_group_description"></a> [resource\_group\_description](#input\_resource\_group\_description) | (Optional) The description of Resource Group. | `string` | `"Managed by Terraform."` | no |
4747
| <a name="input_resource_group_enabled"></a> [resource\_group\_enabled](#input\_resource\_group\_enabled) | (Optional) Whether to create Resource Group to find and group AWS resources which are created by this module. | `bool` | `true` | no |
4848
| <a name="input_resource_group_name"></a> [resource\_group\_name](#input\_resource\_group\_name) | (Optional) The name of Resource Group. A Resource Group name can have a maximum of 127 characters, including letters, numbers, hyphens, dots, and underscores. The name cannot start with `AWS` or `aws`. | `string` | `""` | no |
4949
| <a name="input_tags"></a> [tags](#input\_tags) | (Optional) A map of tags to add to all resources. | `map(string)` | `{}` | no |
50-
| <a name="input_timeouts"></a> [timeouts](#input\_timeouts) | (Optional) How long to wait for the EKS access entry to be created/deleted. | <pre>object({<br> create = optional(string, "20m")<br> delete = optional(string, "40m")<br> })</pre> | `{}` | no |
50+
| <a name="input_timeouts"></a> [timeouts](#input\_timeouts) | (Optional) How long to wait for the EKS access entry to be created/deleted. | <pre>object({<br/> create = optional(string, "20m")<br/> delete = optional(string, "40m")<br/> })</pre> | `{}` | no |
5151
| <a name="input_type"></a> [type](#input\_type) | (Optional) The type of the access entry. Valid values are `EC2_LINUX`, `EC2_WINDOWS`, `FARGATE_LINUX`, `STANDARD`. Defaults to `STANDARD`. | `string` | `"STANDARD"` | no |
5252

5353
## Outputs
@@ -64,4 +64,4 @@ This module creates following resources.
6464
| <a name="output_principal"></a> [principal](#output\_principal) | The ARN of one, and only one, existing IAM principal to grant access to Kubernetes objects on the cluster. |
6565
| <a name="output_type"></a> [type](#output\_type) | The type of the access entry. |
6666
| <a name="output_updated_at"></a> [updated\_at](#output\_updated\_at) | Date and time in RFC3339 format that the EKS access entry was updated. |
67-
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
67+
<!-- END_TF_DOCS -->

0 commit comments

Comments
 (0)