Skip to content

Commit

Permalink
feat: update_context_versions_variables_outputs (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
mfroembgen authored May 15, 2023
1 parent 7a1ff58 commit 79e939b
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 48 deletions.
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,24 @@
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.30.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.67 |

## Providers

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

## Modules

| Name | Source | Version |
|------|--------|---------|
| <a name="module_cadvisor_definition"></a> [cadvisor\_definition](#module\_cadvisor\_definition) | cloudposse/ecs-container-definition/aws | 0.58.1 |
| <a name="module_cadvisor_label"></a> [cadvisor\_label](#module\_cadvisor\_label) | cloudposse/label/null | 0.25.0 |
| <a name="module_cadvisor_label"></a> [cadvisor\_label](#module\_cadvisor\_label) | justtrackio/label/null | 0.26.0 |
| <a name="module_ecs_service_task"></a> [ecs\_service\_task](#module\_ecs\_service\_task) | justtrackio/ecs-alb-service-task/aws | 1.0.0 |
| <a name="module_node_exporter_definition"></a> [node\_exporter\_definition](#module\_node\_exporter\_definition) | cloudposse/ecs-container-definition/aws | 0.58.1 |
| <a name="module_node_exporter_label"></a> [node\_exporter\_label](#module\_node\_exporter\_label) | cloudposse/label/null | 0.25.0 |
| <a name="module_this"></a> [this](#module\_this) | cloudposse/label/null | 0.25.0 |
| <a name="module_node_exporter_label"></a> [node\_exporter\_label](#module\_node\_exporter\_label) | justtrackio/label/null | 0.26.0 |
| <a name="module_this"></a> [this](#module\_this) | justtrackio/label/null | 0.26.0 |

## Resources

Expand All @@ -36,7 +36,8 @@
|------|-------------|------|---------|:--------:|
| <a name="input_additional_tag_map"></a> [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`.<br>This is for some rare cases where resources want additional configuration of tags<br>and therefore take a list of maps with tag key, value, and additional configuration. | `map(string)` | `{}` | no |
| <a name="input_attributes"></a> [attributes](#input\_attributes) | ID element. Additional attributes (e.g. `workers` or `cluster`) to add to `id`,<br>in the order they appear in the list. New attributes are appended to the<br>end of the list. The elements of the list are joined by the `delimiter`<br>and treated as a single ID element. | `list(string)` | `[]` | no |
| <a name="input_aws_region"></a> [aws\_region](#input\_aws\_region) | AWS Region | `string` | `null` | no |
| <a name="input_aws_account_id"></a> [aws\_account\_id](#input\_aws\_account\_id) | AWS account id | `string` | `null` | no |
| <a name="input_aws_region"></a> [aws\_region](#input\_aws\_region) | AWS region | `string` | `null` | no |
| <a name="input_cadvisor_cpu"></a> [cadvisor\_cpu](#input\_cadvisor\_cpu) | Number of CPU units to reserve for the container | `number` | `100` | no |
| <a name="input_cadvisor_version"></a> [cadvisor\_version](#input\_cadvisor\_version) | cAdvisor version to be deployed | `string` | `"v0.47.0"` | no |
| <a name="input_container_memory_reservation"></a> [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 |
Expand All @@ -58,6 +59,7 @@
| <a name="input_namespace"></a> [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 |
| <a name="input_node_exporter_cpu"></a> [node\_exporter\_cpu](#input\_node\_exporter\_cpu) | Number of CPU units to reserve for the container | `number` | `100` | no |
| <a name="input_node_exporter_version"></a> [node\_exporter\_version](#input\_node\_exporter\_version) | Node exporter version to be deployed | `string` | `"v1.5.0"` | no |
| <a name="input_organizational_unit"></a> [organizational\_unit](#input\_organizational\_unit) | Usually used to indicate the AWS organizational unit, e.g. 'prod', 'sdlc' | `string` | `null` | no |
| <a name="input_regex_replace_chars"></a> [regex\_replace\_chars](#input\_regex\_replace\_chars) | Terraform regular expression (regex) string.<br>Characters matching the regex will be removed from the ID elements.<br>If not set, `"/[^a-zA-Z0-9-]/"` is used to remove all characters other than hyphens, letters and digits. | `string` | `null` | no |
| <a name="input_stage"></a> [stage](#input\_stage) | ID element. Usually used to indicate role, e.g. 'prod', 'staging', 'source', 'build', 'test', 'deploy', 'release' | `string` | `null` | no |
| <a name="input_tags"></a> [tags](#input\_tags) | Additional tags (e.g. `{'BusinessUnit': 'XYZ'}`).<br>Neither the tag keys nor the tag values will be modified by this module. | `map(string)` | `{}` | no |
Expand Down
2 changes: 1 addition & 1 deletion examples/basic/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "4.30.0"
version = ">= 4.67"
}
}
required_version = ">= 1.3.0"
Expand Down
12 changes: 6 additions & 6 deletions main.tf
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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"
}
}
Expand Down Expand Up @@ -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"
}
}
Expand Down
62 changes: 28 additions & 34 deletions variables.tf
Original file line number Diff line number Diff line change
@@ -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" {
Expand All @@ -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" {
Expand All @@ -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`"
}
2 changes: 1 addition & 1 deletion versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 4.30.0"
version = ">= 4.67"
}
}
required_version = ">= 1.3.0"
Expand Down

0 comments on commit 79e939b

Please sign in to comment.