Skip to content

Commit

Permalink
Fix pre-commit issues (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
wayne-root authored Jan 17, 2023
1 parent 0cef36e commit e7adc22
Show file tree
Hide file tree
Showing 15 changed files with 45 additions and 26 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ on:
push:
branches:
- main

permissions:
actions: read
checks: read
contents: read
pull-requests: write
security-events: write

jobs:
ci:
uses: SPHTech-Platform/reusable-workflows/.github/workflows/terraform.yaml@main
Expand Down
17 changes: 14 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,36 @@ repos:
- repo: https://github.com/gruntwork-io/pre-commit
rev: v0.1.17
hooks:
- id: markdown-link-check
- id: shellcheck

- repo: https://github.com/tcort/markdown-link-check
rev: v3.9.3
hooks:
- id: markdown-link-check
args:
- "--config=mlc_config.json"

- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.72.1
rev: v1.77.0
hooks:
- id: terraform_fmt
- id: terraform_validate
args:
- --hook-config=--retry-once-with-cleanup=true
- id: terraform_tflint
args:
- --args=--module
- --args=--config=__GIT_WORKING_DIR__/.tflint.hcl
- id: terraform_docs
args:
- "--args=--lockfile=false"
- --hook-config=--path-to-file=README.md
- --hook-config=--add-to-existing-file=true
- --hook-config=--recursive=true
- id: terraform_tfsec
args:
- --args=--exclude-downloaded-modules
- id: terraform_checkov

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0
hooks:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ No resources.
| <a name="input_enable_execute_command"></a> [enable\_execute\_command](#input\_enable\_execute\_command) | Specifies whether to enable Amazon ECS Exec for the tasks within the service | `bool` | `false` | no |
| <a name="input_launch_type"></a> [launch\_type](#input\_launch\_type) | The launch type on which to run your task.(EC2\|FARGATE) | `string` | `"EC2"` | no |
| <a name="input_link_ecs_to_asg_capacity_provider"></a> [link\_ecs\_to\_asg\_capacity\_provider](#input\_link\_ecs\_to\_asg\_capacity\_provider) | Specify whether to link ECS to autoscaling group capacity provider | `bool` | `false` | no |
| <a name="input_name"></a> [name](#input\_name) | Name of the product/project/application | `string` | `null` | no |
| <a name="input_name"></a> [name](#input\_name) | Name of the product/project/application | `string` | `""` | no |
| <a name="input_platform_version"></a> [platform\_version](#input\_platform\_version) | Platform version (applicable for FARGATE launch type) | `string` | `"LATEST"` | no |
| <a name="input_service_deployment_maximum_percent"></a> [service\_deployment\_maximum\_percent](#input\_service\_deployment\_maximum\_percent) | Upper limit (as a percentage of the service's desiredCount) of the number of running tasks that can be running in a service during a deployment. Not valid when using the DAEMON scheduling strategy. | `number` | `200` | no |
| <a name="input_service_deployment_minimum_healthy_percent"></a> [service\_deployment\_minimum\_healthy\_percent](#input\_service\_deployment\_minimum\_healthy\_percent) | Lower limit (as a percentage of the service's desiredCount) of the number of running tasks that must remain running and healthy in a service during a deployment. | `number` | `100` | no |
Expand Down
4 changes: 2 additions & 2 deletions examples/ec2/README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | ~> 4.16 |
| <a name="provider_local"></a> [local](#provider\_local) | ~> 2.2 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | 4.36.1 |
| <a name="provider_local"></a> [local](#provider\_local) | 2.2.3 |

## Modules

Expand Down
2 changes: 1 addition & 1 deletion examples/fargate/README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | ~> 4.16 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | 4.45.0 |

## Modules

Expand Down
2 changes: 1 addition & 1 deletion modules/autoscaling-policy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.0 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | 4.36.1 |

## Modules

Expand Down
16 changes: 8 additions & 8 deletions modules/autoscaling-policy/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
output "cpu_autoscaling_arn" {
description = "The ARN assigned by AWS to the scaling policy."
value = join("", aws_autoscaling_policy.asg_cpu_autoscaling.*.arn)
value = join("", aws_autoscaling_policy.asg_cpu_autoscaling[*].arn)
}

output "cpu_autoscaling_name" {
description = "The scaling policy's name."
value = join("", aws_autoscaling_policy.asg_cpu_autoscaling.*.name)
value = join("", aws_autoscaling_policy.asg_cpu_autoscaling[*].name)
}

output "cpu_autoscaling_asg_name" {
description = "The scaling policy's assigned autoscaling group."
value = join("", aws_autoscaling_policy.asg_cpu_autoscaling.*.autoscaling_group_name)
value = join("", aws_autoscaling_policy.asg_cpu_autoscaling[*].autoscaling_group_name)
}

output "cpu_autoscaling_policy_type" {
description = "The scaling policy's type."
value = join("", aws_autoscaling_policy.asg_cpu_autoscaling.*.policy_type)
value = join("", aws_autoscaling_policy.asg_cpu_autoscaling[*].policy_type)
}

output "memory_autoscaling_arn" {
description = "The ARN assigned by AWS to the scaling policy."
value = join("", aws_autoscaling_policy.asg_memory_autoscaling.*.arn)
value = join("", aws_autoscaling_policy.asg_memory_autoscaling[*].arn)
}

output "memory_autoscaling_name" {
description = "The scaling policy's name."
value = join("", aws_autoscaling_policy.asg_memory_autoscaling.*.name)
value = join("", aws_autoscaling_policy.asg_memory_autoscaling[*].name)
}

output "memory_autoscaling_asg_name" {
description = "The scaling policy's assigned autoscaling group."
value = join("", aws_autoscaling_policy.asg_memory_autoscaling.*.autoscaling_group_name)
value = join("", aws_autoscaling_policy.asg_memory_autoscaling[*].autoscaling_group_name)
}

output "memory_autoscaling_policy_type" {
description = "The scaling policy's type."
value = join("", aws_autoscaling_policy.asg_memory_autoscaling.*.policy_type)
value = join("", aws_autoscaling_policy.asg_memory_autoscaling[*].policy_type)
}

output "cpu_policy_arn" {
Expand Down
4 changes: 2 additions & 2 deletions modules/cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.0 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | 4.36.1 |

## Modules

Expand Down Expand Up @@ -47,7 +47,7 @@ No modules.
| <a name="input_log_group_name"></a> [log\_group\_name](#input\_log\_group\_name) | Provide name for log group | `string` | `""` | no |
| <a name="input_log_retention"></a> [log\_retention](#input\_log\_retention) | Specify log retention in days | `number` | `30` | no |
| <a name="input_managed_scaling"></a> [managed\_scaling](#input\_managed\_scaling) | Specifies whether to enable managed scaling | `bool` | `true` | no |
| <a name="input_name"></a> [name](#input\_name) | Name of the product/project/application | `string` | `null` | no |
| <a name="input_name"></a> [name](#input\_name) | Name of the product/project/application | `string` | `""` | no |
| <a name="input_scaling_max_step_size"></a> [scaling\_max\_step\_size](#input\_scaling\_max\_step\_size) | Sets managed scaling max step size | `number` | `10` | no |
| <a name="input_scaling_min_step_size"></a> [scaling\_min\_step\_size](#input\_scaling\_min\_step\_size) | Sets managed scaling min step size | `number` | `1` | no |
| <a name="input_scaling_target_capacity"></a> [scaling\_target\_capacity](#input\_scaling\_target\_capacity) | Sets managed scaling target capacity | `number` | `80` | no |
Expand Down
2 changes: 1 addition & 1 deletion modules/cluster/variables.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
variable "name" {
description = "Name of the product/project/application"
type = string
default = null
default = ""
}

variable "ecs_cluster_name" {
Expand Down
2 changes: 1 addition & 1 deletion modules/iam/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | ~> 4.0 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | 4.36.1 |

## Modules

Expand Down
2 changes: 1 addition & 1 deletion modules/service-discovery/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.0 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | 4.36.1 |

## Modules

Expand Down
2 changes: 1 addition & 1 deletion modules/service-discovery/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ resource "aws_service_discovery_service" "this" {
name = each.value

dns_config {
namespace_id = element(aws_service_discovery_private_dns_namespace.this.*.id, 0)
namespace_id = element(aws_service_discovery_private_dns_namespace.this[*].id, 0)

dns_records {
ttl = var.service_discovery_record_ttl
Expand Down
4 changes: 2 additions & 2 deletions modules/service-discovery/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
output "namespace_id" {
description = "The ID of the namespace that you want to use to create the service."
value = aws_service_discovery_private_dns_namespace.this.*.id
value = aws_service_discovery_private_dns_namespace.this[*].id
}

output "namespace_arn" {
description = "arn of the namespace"
value = aws_service_discovery_private_dns_namespace.this.*.arn
value = aws_service_discovery_private_dns_namespace.this[*].arn
}

output "service_ids" {
Expand Down
2 changes: 1 addition & 1 deletion modules/service/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.0 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | 4.36.1 |

## Modules

Expand Down
2 changes: 1 addition & 1 deletion variables.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
variable "name" {
description = "Name of the product/project/application"
type = string
default = null
default = ""
}

##############################
Expand Down

0 comments on commit e7adc22

Please sign in to comment.