Skip to content

Commit

Permalink
Push pre-commit changes
Browse files Browse the repository at this point in the history
  • Loading branch information
siddharth-singh1 authored and github-actions[bot] committed Dec 2, 2024
1 parent 3f23674 commit 9be8b5f
Show file tree
Hide file tree
Showing 18 changed files with 136 additions and 108 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ Terraform will display a plan showing the changes it intends to make. Review the
| <a name="module_acm"></a> [acm](#module\_acm) | git::https://github.com/cloudposse/terraform-aws-acm-request-certificate | 0.17.0 |
| <a name="module_alb"></a> [alb](#module\_alb) | ./modules/alb | n/a |
| <a name="module_alb_sg"></a> [alb\_sg](#module\_alb\_sg) | git::https://github.com/cloudposse/terraform-aws-security-group | 2.0.0 |
| <a name="module_ecs"></a> [ecs](#module\_ecs) | git::https://github.com/terraform-aws-modules/terraform-aws-ecs | v5.11.1 |
| <a name="module_ecs"></a> [ecs](#module\_ecs) | ./modules/ecs | n/a |
| <a name="module_health_check"></a> [health\_check](#module\_health\_check) | ./modules/health-check | n/a |

## Resources
Expand Down
1 change: 1 addition & 0 deletions example/alb/.terraform.lock.hcl

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

10 changes: 5 additions & 5 deletions example/alb/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ module "alb" {
source = "../../modules/alb"

alb = {
name = "arc-poc-alb"
name = "arc-poc-alb"
internal = false
}

alb_target_group = [{
name = "arc-poc-alb-tg"
port = 80
name = "arc-poc-alb-tg"
port = 80
vpc_id = "vpc-1234"
health_check = {
enabled = true
path = "/"
path = "/"
}
}]

listener_rules = {}
}
}
22 changes: 5 additions & 17 deletions example/ecs-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,22 @@ Example demonstrating how to use terraform-aws-refarch-ecs.
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | ~> 1.5 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | ~> 4.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | ~> 5.0 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | 4.67.0 |
No providers.

## Modules

| Name | Source | Version |
|------|--------|---------|
| <a name="module_ecs"></a> [ecs](#module\_ecs) | sourcefuse/arc-ecs/aws | n/a |
| <a name="module_ecs"></a> [ecs](#module\_ecs) | ../modules/ecs | n/a |
| <a name="module_tags"></a> [tags](#module\_tags) | sourcefuse/arc-tags/aws | 1.2.3 |

## Resources

| Name | Type |
|------|------|
| [aws_route53_zone.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/route53_zone) | data source |
| [aws_subnets.private](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/subnets) | data source |
| [aws_subnets.public](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/subnets) | data source |
| [aws_vpc.vpc](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/vpc) | data source |
No resources.

## Inputs

Expand All @@ -50,10 +43,5 @@ Example demonstrating how to use terraform-aws-refarch-ecs.

## Outputs

| Name | Description |
|------|-------------|
| <a name="output_cluster_arn"></a> [cluster\_arn](#output\_cluster\_arn) | ECS Cluster ARN |
| <a name="output_cluster_id"></a> [cluster\_id](#output\_cluster\_id) | ECS Cluster ID |
| <a name="output_cluster_name"></a> [cluster\_name](#output\_cluster\_name) | Name of the ECS Cluster |
| <a name="output_health_check_fqdn"></a> [health\_check\_fqdn](#output\_health\_check\_fqdn) | Health check FQDN record created in Route 53. |
No outputs.
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
14 changes: 7 additions & 7 deletions example/ecs-cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ module "ecs" {
cluster_service_connect_defaults = []
create_cloudwatch_log_group = true
cluster_service_connect_defaults = {}
cluster_settings = []
cluster_settings = []
cluster_configuration = {
execute_command_configuration = {
logging = "OVERRIDE"
log_configuration = {
cloud_watch_log_group_name = "arc-poc-cluster-log-group"
}
execute_command_configuration = {
logging = "OVERRIDE"
log_configuration = {
cloud_watch_log_group_name = "arc-poc-cluster-log-group"
}
}
}

}
Expand All @@ -63,7 +63,7 @@ module "ecs" {
autoscaling_capacity_providers = {}
fargate_capacity_providers = {
fargate_cp = {
name = "FARGATE"
name = "FARGATE"
tags = {
Environment = "poc"
}
Expand Down
26 changes: 13 additions & 13 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,36 +16,36 @@ terraform {
## cluster
################################################################################
module "ecs" {
source = "./modules/ecs"
source = "./modules/ecs"

create = true

ecs_cluster = {
cluster_name = "my-ecs-cluster"
cluster_name = "my-ecs-cluster"
cluster_service_connect_defaults = []
create_cloudwatch_log_group = false
create_cloudwatch_log_group = false

}

cloudwatch = {
log_group_name = "my-cloudwatch-log-group"
log_group_name = "my-cloudwatch-log-group"
log_group_retention_in_days = 7
log_group_kms_key_id = null
log_group_tags = { Environment = "production" }
log_group_kms_key_id = null
log_group_tags = { Environment = "production" }
}

capacity_provider = {
autoscaling_capacity_providers = {
my-provider = {
name = "my-autoscaling-provider"
auto_scaling_group_arn = "arn:aws:autoscaling:region:account-id:autoScalingGroup:autoScalingGroupName/my-asg"
managed_scaling = { instance_warmup_period = 300, maximum_scaling_step_size = 10, minimum_scaling_step_size = 1, status = "ENABLED", target_capacity = 100 }
name = "my-autoscaling-provider"
auto_scaling_group_arn = "arn:aws:autoscaling:region:account-id:autoScalingGroup:autoScalingGroupName/my-asg"
managed_scaling = { instance_warmup_period = 300, maximum_scaling_step_size = 10, minimum_scaling_step_size = 1, status = "ENABLED", target_capacity = 100 }
managed_termination_protection = "ENABLED"
managed_draining = "ENABLED"
tags = { Environment = "production" }
managed_draining = "ENABLED"
tags = { Environment = "production" }
}
}
fargate_capacity_providers = {}
fargate_capacity_providers = {}
default_capacity_provider_use_fargate = false
}

Expand Down
25 changes: 25 additions & 0 deletions modules/alb/.terraform.lock.hcl

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

40 changes: 17 additions & 23 deletions modules/alb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,43 +9,37 @@ AWS Terraform ALB Module

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | ~> 1.3 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | ~> 4.30 |
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | ~> 1.5 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | ~> 5.0 |

## Providers

No providers.
| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | 5.78.0 |

## Modules

| Name | Source | Version |
|------|--------|---------|
| <a name="module_alb"></a> [alb](#module\_alb) | git::https://github.com/cloudposse/terraform-aws-alb | 1.5.0 |
No modules.

## Resources

No resources.
| Name | Type |
|------|------|
| [aws_lb.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lb) | resource |
| [aws_lb_listener.http](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lb_listener) | resource |
| [aws_lb_listener_rule.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lb_listener_rule) | resource |
| [aws_lb_target_group.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lb_target_group) | resource |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_access_logs_enabled"></a> [access\_logs\_enabled](#input\_access\_logs\_enabled) | A boolean flag to enable/disable access\_logs | `bool` | `true` | no |
| <a name="input_alb_access_logs_s3_bucket_force_destroy"></a> [alb\_access\_logs\_s3\_bucket\_force\_destroy](#input\_alb\_access\_logs\_s3\_bucket\_force\_destroy) | A boolean that indicates all objects should be deleted from the ALB access logs S3 bucket so that the bucket can be destroyed without error | `bool` | `false` | no |
| <a name="input_alb_access_logs_s3_bucket_force_destroy_enabled"></a> [alb\_access\_logs\_s3\_bucket\_force\_destroy\_enabled](#input\_alb\_access\_logs\_s3\_bucket\_force\_destroy\_enabled) | When `true`, permits `force_destroy` to be set to `true`.<br>This is an extra safety precaution to reduce the chance that Terraform will destroy and recreate<br>your S3 bucket, causing COMPLETE LOSS OF ALL DATA even if it was stored in Glacier.<br>WARNING: Upgrading this module from a version prior to 0.27.0 to this version<br> will cause Terraform to delete your existing S3 bucket CAUSING COMPLETE DATA LOSS<br> unless you follow the upgrade instructions on the Wiki [here](https://github.com/cloudposse/terraform-aws-s3-log-storage/wiki/Upgrading-to-v0.27.0-(POTENTIAL-DATA-LOSS)).<br> See additional instructions for upgrading from v0.27.0 to v0.28.0 [here](https://github.com/cloudposse/terraform-aws-s3-log-storage/wiki/Upgrading-to-v0.28.0-and-AWS-provider-v4-(POTENTIAL-DATA-LOSS)). | `bool` | `false` | no |
| <a name="input_cross_zone_load_balancing_enabled"></a> [cross\_zone\_load\_balancing\_enabled](#input\_cross\_zone\_load\_balancing\_enabled) | A boolean flag to enable/disable cross zone load balancing | `bool` | `true` | no |
| <a name="input_deletion_protection_enabled"></a> [deletion\_protection\_enabled](#input\_deletion\_protection\_enabled) | A boolean flag to enable/disable deletion protection for ALB | `bool` | `false` | no |
| <a name="input_deregistration_delay"></a> [deregistration\_delay](#input\_deregistration\_delay) | The amount of time to wait in seconds before changing the state of a deregistering target to unused | `number` | `15` | no |
| <a name="input_http_ingress_cidr_blocks"></a> [http\_ingress\_cidr\_blocks](#input\_http\_ingress\_cidr\_blocks) | List of CIDR blocks to allow in HTTP security group | `list(string)` | <pre>[<br> "0.0.0.0/0"<br>]</pre> | no |
| <a name="input_https_ingress_cidr_blocks"></a> [https\_ingress\_cidr\_blocks](#input\_https\_ingress\_cidr\_blocks) | List of CIDR blocks to allow in HTTPS security group | `list(string)` | <pre>[<br> "0.0.0.0/0"<br>]</pre> | no |
| <a name="input_idle_timeout"></a> [idle\_timeout](#input\_idle\_timeout) | The time in seconds that the connection is allowed to be idle | `number` | `60` | no |
| <a name="input_internal"></a> [internal](#input\_internal) | Internal or external facing ALB. | `bool` | `false` | no |
| <a name="input_ip_address_type"></a> [ip\_address\_type](#input\_ip\_address\_type) | The type of IP addresses used by the subnets for your load balancer. The possible values are `ipv4` and `dualstack`. | `string` | `"ipv4"` | no |
| <a name="input_name"></a> [name](#input\_name) | Name to assign the resource | `string` | `""` | no |
| <a name="input_security_group_ids"></a> [security\_group\_ids](#input\_security\_group\_ids) | Security group Ids for access | `list(string)` | n/a | yes |
| <a name="input_subnet_ids"></a> [subnet\_ids](#input\_subnet\_ids) | Subnet Ids assigned to the LB | `list(string)` | n/a | yes |
| <a name="input_tags"></a> [tags](#input\_tags) | Tags to assign the resources | `map(string)` | `{}` | no |
| <a name="input_vpc_id"></a> [vpc\_id](#input\_vpc\_id) | Id of the VPC where the resources will live | `string` | n/a | yes |
| <a name="input_alb"></a> [alb](#input\_alb) | n/a | <pre>object({<br> name = optional(string, null)<br> internal = optional(bool, false)<br> load_balancer_type = optional(string, "application")<br> idle_timeout = optional(number, 60)<br> enable_deletion_protection = optional(bool, false)<br> enable_http2 = optional(bool, true)<br> certificate_arn = optional(string, null)<br><br> access_logs = optional(object({<br> bucket = string<br> enabled = optional(bool, false)<br> prefix = optional(string, "")<br> }))<br><br> tags = optional(map(string), {})<br> })</pre> | n/a | yes |
| <a name="input_alb_target_group"></a> [alb\_target\_group](#input\_alb\_target\_group) | List of target groups to create | <pre>list(object({<br> name = optional(string, null)<br> port = number<br> protocol = optional(string, null)<br> protocol_version = optional(string, "HTTP1")<br> vpc_id = optional(string, "")<br> target_type = optional(string, "instance")<br> ip_address_type = optional(string, "ipv4")<br> load_balancing_algorithm_type = optional(string, "round_robin")<br> load_balancing_cross_zone_enabled = optional(string, "use_load_balancer_configuration")<br> deregistration_delay = optional(number, 300)<br> slow_start = optional(number, 0)<br> tags = optional(map(string), {})<br><br> health_check = optional(object({<br> enabled = optional(bool, true)<br> protocol = optional(string, "HTTP") # Allowed values: "HTTP", "HTTPS", "TCP", etc.<br> path = optional(string, "/")<br> port = optional(string, "traffic-port")<br> timeout = optional(number, 6)<br> healthy_threshold = optional(number, 3)<br> unhealthy_threshold = optional(number, 3)<br> interval = optional(number, 30)<br> matcher = optional(string, "200") # Default HTTP matcher. Range 200 to 499<br> }))<br><br> stickiness = optional(object({<br> enabled = optional(bool, true)<br> type = string<br> cookie_duration = optional(number, 86400)<br> })<br> )<br><br> }))</pre> | n/a | yes |
| <a name="input_create_alb"></a> [create\_alb](#input\_create\_alb) | A flag that decides whether to create alb | `bool` | `false` | no |
| <a name="input_create_listener_rule"></a> [create\_listener\_rule](#input\_create\_listener\_rule) | n/a | `bool` | `false` | no |
| <a name="input_listener_rules"></a> [listener\_rules](#input\_listener\_rules) | List of listener rules to create | <pre>list(object({<br> listener_arn = string<br> priority = number<br> conditions = list(object({<br> field = string<br> values = list(string)<br> }))<br> actions = list(object({<br> type = string<br> target_group_arn = optional(string)<br> order = optional(number)<br> redirect = optional(object({<br> protocol = string<br> port = string<br> host = optional(string)<br> path = optional(string)<br> query = optional(string)<br> status_code = string<br> }), null)<br> fixed_response = optional(object({<br> content_type = string<br> message_body = optional(string)<br> status_code = optional(string)<br> }), null)<br> }))<br> }))</pre> | n/a | yes |

## Outputs

Expand Down
28 changes: 14 additions & 14 deletions modules/alb/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ resource "aws_lb_target_group" "this" {
create_before_destroy = true
}

tags = each.value.tags
tags = each.value.tags
}

# Listener
Expand All @@ -86,7 +86,7 @@ resource "aws_lb_listener" "http" {
port = var.alb.port
protocol = var.alb.protocol

certificate_arn = var.alb.certificate_arn
certificate_arn = var.alb.certificate_arn

dynamic "default_action" {
for_each = var.listener_rules
Expand All @@ -105,23 +105,23 @@ resource "aws_lb_listener_rule" "this" {
priority = each.value.priority

dynamic "condition" {
for_each = each.value.conditions
content {
dynamic "host_header" {
for_each = each.value.field == "host-header" ? [each.value] : []
content {
values = each.value.values
for_each = each.value.conditions
content {
dynamic "host_header" {
for_each = each.value.field == "host-header" ? [each.value] : []
content {
values = each.value.values
}
}
}

dynamic "path_pattern" {
for_each = each.value.field == "path-pattern" ? [each.value] : []
content {
values = each.value.values
dynamic "path_pattern" {
for_each = each.value.field == "path-pattern" ? [each.value] : []
content {
values = each.value.values
}
}
}
}
}

dynamic "action" {
for_each = each.value.actions
Expand Down
10 changes: 5 additions & 5 deletions modules/alb/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ variable "create_alb" {
}

variable "create_listener_rule" {
type = bool
default = false
type = bool
default = false
}

variable "alb" {
Expand Down Expand Up @@ -72,9 +72,9 @@ variable "listener_rules" {
type = list(object({
listener_arn = string
priority = number
conditions = list(object({
field = string
values = list(string)
conditions = list(object({
field = string
values = list(string)
}))
actions = list(object({
type = string
Expand Down
Loading

0 comments on commit 9be8b5f

Please sign in to comment.