From 79e939b670677a38fa0fca5f957215dfec88375f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Fr=C3=B6mbgen?= <23717573+mfroembgen@users.noreply.github.com> Date: Mon, 15 May 2023 09:39:22 +0200 Subject: [PATCH] feat: update_context_versions_variables_outputs (#14) --- README.md | 14 +++++---- examples/basic/versions.tf | 2 +- main.tf | 12 ++++---- variables.tf | 62 +++++++++++++++++--------------------- versions.tf | 2 +- 5 files changed, 44 insertions(+), 48 deletions(-) diff --git a/README.md b/README.md index 9b71c85..5b64963 100644 --- a/README.md +++ b/README.md @@ -4,24 +4,24 @@ | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.3.0 | -| [aws](#requirement\_aws) | >= 4.30.0 | +| [aws](#requirement\_aws) | >= 4.67 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 4.30.0 | +| [aws](#provider\_aws) | >= 4.67 | ## Modules | Name | Source | Version | |------|--------|---------| | [cadvisor\_definition](#module\_cadvisor\_definition) | cloudposse/ecs-container-definition/aws | 0.58.1 | -| [cadvisor\_label](#module\_cadvisor\_label) | cloudposse/label/null | 0.25.0 | +| [cadvisor\_label](#module\_cadvisor\_label) | justtrackio/label/null | 0.26.0 | | [ecs\_service\_task](#module\_ecs\_service\_task) | justtrackio/ecs-alb-service-task/aws | 1.0.0 | | [node\_exporter\_definition](#module\_node\_exporter\_definition) | cloudposse/ecs-container-definition/aws | 0.58.1 | -| [node\_exporter\_label](#module\_node\_exporter\_label) | cloudposse/label/null | 0.25.0 | -| [this](#module\_this) | cloudposse/label/null | 0.25.0 | +| [node\_exporter\_label](#module\_node\_exporter\_label) | justtrackio/label/null | 0.26.0 | +| [this](#module\_this) | justtrackio/label/null | 0.26.0 | ## Resources @@ -36,7 +36,8 @@ |------|-------------|------|---------|:--------:| | [additional\_tag\_map](#input\_additional\_tag\_map) | Additional key-value pairs to add to each map in `tags_as_list_of_maps`. Not added to `tags` or `id`.
This is for some rare cases where resources want additional configuration of tags
and therefore take a list of maps with tag key, value, and additional configuration. | `map(string)` | `{}` | no | | [attributes](#input\_attributes) | ID element. Additional attributes (e.g. `workers` or `cluster`) to add to `id`,
in the order they appear in the list. New attributes are appended to the
end of the list. The elements of the list are joined by the `delimiter`
and treated as a single ID element. | `list(string)` | `[]` | no | -| [aws\_region](#input\_aws\_region) | AWS Region | `string` | `null` | no | +| [aws\_account\_id](#input\_aws\_account\_id) | AWS account id | `string` | `null` | no | +| [aws\_region](#input\_aws\_region) | AWS region | `string` | `null` | no | | [cadvisor\_cpu](#input\_cadvisor\_cpu) | Number of CPU units to reserve for the container | `number` | `100` | no | | [cadvisor\_version](#input\_cadvisor\_version) | cAdvisor version to be deployed | `string` | `"v0.47.0"` | no | | [container\_memory\_reservation](#input\_container\_memory\_reservation) | The amount of memory (in MiB) to reserve for the container. If container needs to exceed this threshold, it can do so up to the set container\_memory hard limit | `number` | `128` | no | @@ -58,6 +59,7 @@ | [namespace](#input\_namespace) | ID element. Usually an abbreviation of your organization name, e.g. 'eg' or 'cp', to help ensure generated IDs are globally unique | `string` | `null` | no | | [node\_exporter\_cpu](#input\_node\_exporter\_cpu) | Number of CPU units to reserve for the container | `number` | `100` | no | | [node\_exporter\_version](#input\_node\_exporter\_version) | Node exporter version to be deployed | `string` | `"v1.5.0"` | no | +| [organizational\_unit](#input\_organizational\_unit) | Usually used to indicate the AWS organizational unit, e.g. 'prod', 'sdlc' | `string` | `null` | no | | [regex\_replace\_chars](#input\_regex\_replace\_chars) | Terraform regular expression (regex) string.
Characters matching the regex will be removed from the ID elements.
If not set, `"/[^a-zA-Z0-9-]/"` is used to remove all characters other than hyphens, letters and digits. | `string` | `null` | no | | [stage](#input\_stage) | ID element. Usually used to indicate role, e.g. 'prod', 'staging', 'source', 'build', 'test', 'deploy', 'release' | `string` | `null` | no | | [tags](#input\_tags) | Additional tags (e.g. `{'BusinessUnit': 'XYZ'}`).
Neither the tag keys nor the tag values will be modified by this module. | `map(string)` | `{}` | no | diff --git a/examples/basic/versions.tf b/examples/basic/versions.tf index adb425a..d20b84c 100644 --- a/examples/basic/versions.tf +++ b/examples/basic/versions.tf @@ -2,7 +2,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = "4.30.0" + version = ">= 4.67" } } required_version = ">= 1.3.0" diff --git a/main.tf b/main.tf index bc189de..dd4067d 100644 --- a/main.tf +++ b/main.tf @@ -1,6 +1,6 @@ module "cadvisor_label" { - source = "cloudposse/label/null" - version = "0.25.0" + source = "justtrackio/label/null" + version = "0.26.0" attributes = ["cadvisor"] label_order = var.label_orders.cloudwatch @@ -9,8 +9,8 @@ module "cadvisor_label" { } module "node_exporter_label" { - source = "cloudposse/label/null" - version = "0.25.0" + source = "justtrackio/label/null" + version = "0.26.0" attributes = ["node-exporter"] label_order = var.label_orders.cloudwatch @@ -55,7 +55,7 @@ module "node_exporter_definition" { logDriver = "awslogs" options = { awslogs-group = aws_cloudwatch_log_group.node_exporter.name - awslogs-region = var.aws_region + awslogs-region = module.this.aws_region awslogs-stream-prefix = "ecs" } } @@ -141,7 +141,7 @@ module "cadvisor_definition" { logDriver = "awslogs" options = { awslogs-group = aws_cloudwatch_log_group.cadvisor.name - awslogs-region = var.aws_region + awslogs-region = module.this.aws_region awslogs-stream-prefix = "ecs" } } diff --git a/variables.tf b/variables.tf index 95fff74..433038b 100644 --- a/variables.tf +++ b/variables.tf @@ -1,13 +1,7 @@ -variable "aws_region" { - type = string - description = "AWS Region" - default = null -} - -variable "node_exporter_version" { - type = string - description = "Node exporter version to be deployed" - default = "v1.5.0" +variable "cadvisor_cpu" { + type = number + description = "Number of CPU units to reserve for the container" + default = 100 } variable "cadvisor_version" { @@ -22,28 +16,44 @@ variable "container_memory_reservation" { default = 128 } +variable "ecs_cluster_arn" { + type = string + description = "ECS cluster ARN where this service will be deployed" +} + variable "environment_variables" { type = map(string) description = "The environment variables to pass to the container. This is a map of string: {key: value}. map_environment overrides environment" default = null } -variable "node_exporter_cpu" { +variable "label_orders" { + type = object({ + cloudwatch = optional(list(string)), + ecs = optional(list(string)), + iam = optional(list(string)), + vpc = optional(list(string)) + }) + default = {} + description = "Overrides the `labels_order` for the different labels to modify ID elements appear in the `id`" +} + +variable "log_retention_in_days" { type = number - description = "Number of CPU units to reserve for the container" - default = 100 + description = "Specifies the number of days you want to retain log events in the specified log group." + default = 1 } -variable "cadvisor_cpu" { +variable "node_exporter_cpu" { type = number description = "Number of CPU units to reserve for the container" default = 100 } -variable "log_retention_in_days" { - type = number - description = "Specifies the number of days you want to retain log events in the specified log group." - default = 1 +variable "node_exporter_version" { + type = string + description = "Node exporter version to be deployed" + default = "v1.5.0" } variable "task_cpu" { @@ -58,23 +68,7 @@ variable "task_memory" { default = 512 } -variable "ecs_cluster_arn" { - type = string - description = "ECS cluster ARN where this service will be deployed" -} - variable "vpc_id" { type = string description = "The VPC ID where resources are created" } - -variable "label_orders" { - type = object({ - cloudwatch = optional(list(string)), - ecs = optional(list(string)), - iam = optional(list(string)), - vpc = optional(list(string)) - }) - default = {} - description = "Overrides the `labels_order` for the different labels to modify ID elements appear in the `id`" -} diff --git a/versions.tf b/versions.tf index b834f74..d20b84c 100644 --- a/versions.tf +++ b/versions.tf @@ -2,7 +2,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 4.30.0" + version = ">= 4.67" } } required_version = ">= 1.3.0"