diff --git a/README.md b/README.md index 058c491..a921c41 100644 --- a/README.md +++ b/README.md @@ -147,42 +147,42 @@ Available targets: | Name | Version | |------|---------| -| [terraform](#requirement\_terraform) | >= 0.12.0, < 0.14.0 | -| [kubernetes](#requirement\_kubernetes) | >= 1.12.0 | +| [terraform](#requirement\_terraform) | >= 0.14.0 | +| [kubernetes](#requirement\_kubernetes) | 2.7.1 | ## Providers | Name | Version | |------|---------| -| [kubernetes](#provider\_kubernetes) | >= 1.12.0 | +| [kubernetes](#provider\_kubernetes) | 2.7.1 | ## Modules | Name | Source | Version | |------|--------|---------| -| [this](#module\_this) | git::https://github.com/cloudposse/terraform-null-label.git | tags/0.19.2 | +| [this](#module\_this) | git::https://github.com/cloudposse/terraform-null-label.git | tags/0.25.0 | ## Resources | Name | Type | |------|------| -| [kubernetes_deployment.tfc_cloud_agent](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/deployment) | resource | -| [kubernetes_namespace.namespace](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/namespace) | resource | -| [kubernetes_secret.secret](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/secret) | resource | -| [kubernetes_service_account.service_account](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/service_account) | resource | +| [kubernetes_deployment.tfc_cloud_agent](https://registry.terraform.io/providers/hashicorp/kubernetes/2.7.1/docs/resources/deployment) | resource | +| [kubernetes_namespace.namespace](https://registry.terraform.io/providers/hashicorp/kubernetes/2.7.1/docs/resources/namespace) | resource | +| [kubernetes_secret.secret](https://registry.terraform.io/providers/hashicorp/kubernetes/2.7.1/docs/resources/secret) | resource | +| [kubernetes_service_account.service_account](https://registry.terraform.io/providers/hashicorp/kubernetes/2.7.1/docs/resources/service_account) | resource | ## Inputs | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| | [additional\_tag\_map](#input\_additional\_tag\_map) | Additional tags for appending to tags\_as\_list\_of\_maps. Not added to `tags`. | `map(string)` | `{}` | no | -| [agent\_cli\_args](#input\_agent\_cli\_args) | Extra command line arguments to pass to tfc-agent | `list` | `[]` | no | -| [agent\_envs](#input\_agent\_envs) | A map of any extra environment variables to pass to the TFC agent | `map` | `{}` | no | +| [agent\_cli\_args](#input\_agent\_cli\_args) | Extra command line arguments to pass to tfc-agent | `list(any)` | `[]` | no | +| [agent\_envs](#input\_agent\_envs) | A map of any extra environment variables to pass to the TFC agent | `map(any)` | `{}` | no | | [agent\_image](#input\_agent\_image) | Name and tag of Terraform Cloud Agent docker image | `string` | `"hashicorp/tfc-agent:latest"` | no | | [attributes](#input\_attributes) | Additional attributes (e.g. `1`) | `list(string)` | `[]` | no | | [context](#input\_context) | Single object for setting entire context at once.
See description of individual variables for details.
Leave string and numeric variables as `null` to use default value.
Individual variable settings (non-null) override settings in context object,
except for attributes, tags, and additional\_tag\_map, which are merged. |
object({
enabled = bool
namespace = string
environment = string
stage = string
name = string
delimiter = string
attributes = list(string)
tags = map(string)
additional_tag_map = map(string)
regex_replace_chars = string
label_order = list(string)
id_length_limit = number
})
|
{
"additional_tag_map": {},
"attributes": [],
"delimiter": null,
"enabled": true,
"environment": null,
"id_length_limit": null,
"label_order": [],
"name": null,
"namespace": null,
"regex_replace_chars": null,
"stage": null,
"tags": {}
}
| no | | [delimiter](#input\_delimiter) | Delimiter to be used between `namespace`, `environment`, `stage`, `name` and `attributes`.
Defaults to `-` (hyphen). Set to `""` to use no delimiter at all. | `string` | `null` | no | -| [deployment\_annotations](#input\_deployment\_annotations) | Annotations to add to the Kubernetes deployment | `map` | `{}` | no | +| [deployment\_annotations](#input\_deployment\_annotations) | Annotations to add to the Kubernetes deployment | `map(any)` | `{}` | no | | [deployment\_name](#input\_deployment\_name) | Override the deployment name in Kubernetes | `string` | `null` | no | | [enabled](#input\_enabled) | Set to false to prevent the module from creating any resources | `bool` | `null` | no | | [environment](#input\_environment) | Environment, e.g. 'uw2', 'us-west-2', OR 'prod', 'staging', 'dev', 'UAT' | `string` | `null` | no | @@ -198,12 +198,12 @@ Available targets: | [resource\_limits\_memory](#input\_resource\_limits\_memory) | Kubernetes deployment resource hard memory limit | `string` | `"512Mi"` | no | | [resource\_requests\_cpu](#input\_resource\_requests\_cpu) | Kubernetes deployment resource CPU requests | `string` | `"250m"` | no | | [resource\_requests\_memory](#input\_resource\_requests\_memory) | Kubernetes deployment resource memory requests | `string` | `"50Mi"` | no | -| [service\_account\_annotations](#input\_service\_account\_annotations) | Annotations to add to the Kubernetes service account | `map` | `{}` | no | +| [service\_account\_annotations](#input\_service\_account\_annotations) | Annotations to add to the Kubernetes service account | `map(any)` | `{}` | no | | [stage](#input\_stage) | Stage, e.g. 'prod', 'staging', 'dev', OR 'source', 'build', 'test', 'deploy', 'release' | `string` | `null` | no | | [tags](#input\_tags) | Additional tags (e.g. `map('BusinessUnit','XYZ')` | `map(string)` | `{}` | no | | [tfc\_address](#input\_tfc\_address) | The HTTP or HTTPS address of the Terraform Cloud API. | `string` | `"https://app.terraform.io"` | no | +| [tfc\_agent\_auto\_update](#input\_tfc\_agent\_auto\_update) | Disable automatic core updates. ['minor','patch','disabled'] | `string` | `"disabled"` | no | | [tfc\_agent\_data\_dir](#input\_tfc\_agent\_data\_dir) | The path to a directory to store all agent-related data, including
Terraform configurations, cached Terraform release archives, etc. It is
important to ensure that the given directory is backed by plentiful
storage. | `string` | `null` | no | -| [tfc\_agent\_disable\_update](#input\_tfc\_agent\_disable\_update) | Disable automatic core updates. | `bool` | `false` | no | | [tfc\_agent\_log\_level](#input\_tfc\_agent\_log\_level) | The log verbosity expressed as a level string. Level options include
"trace", "debug", "info", "warn", and "error" | `string` | `"info"` | no | | [tfc\_agent\_single](#input\_tfc\_agent\_single) | Enable single mode. This causes the agent to handle at most one job and
immediately exit thereafter. Useful for running agents as ephemeral
containers, VMs, or other isolated contexts with a higher-level scheduler
or process supervisor. | `bool` | `false` | no | | [tfc\_agent\_token](#input\_tfc\_agent\_token) | The agent token to use when making requests to the Terraform Cloud API.
This token must be obtained from the API or UI. It is recommended to use
the environment variable whenever possible for configuring this setting due
to the sensitive nature of API tokens. | `string` | `""` | no | @@ -317,7 +317,7 @@ In general, PRs are welcome. We follow the typical "fork-and-pull" Git workflow. ## Copyrights -Copyright © 2020-2021 [Cloud Posse, LLC](https://cloudposse.com) +Copyright © 2020-2022 [Cloud Posse, LLC](https://cloudposse.com) diff --git a/context.tf b/context.tf index bae0cf1..d7a2cee 100644 --- a/context.tf +++ b/context.tf @@ -19,7 +19,7 @@ # module "this" { - source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.19.2" + source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.25.0" enabled = var.enabled namespace = var.namespace diff --git a/docs/terraform.md b/docs/terraform.md index 4a9afea..8a927b9 100644 --- a/docs/terraform.md +++ b/docs/terraform.md @@ -3,42 +3,42 @@ | Name | Version | |------|---------| -| [terraform](#requirement\_terraform) | >= 0.12.0, < 0.14.0 | -| [kubernetes](#requirement\_kubernetes) | >= 1.12.0 | +| [terraform](#requirement\_terraform) | >= 0.14.0 | +| [kubernetes](#requirement\_kubernetes) | 2.7.1 | ## Providers | Name | Version | |------|---------| -| [kubernetes](#provider\_kubernetes) | >= 1.12.0 | +| [kubernetes](#provider\_kubernetes) | 2.7.1 | ## Modules | Name | Source | Version | |------|--------|---------| -| [this](#module\_this) | git::https://github.com/cloudposse/terraform-null-label.git | tags/0.19.2 | +| [this](#module\_this) | git::https://github.com/cloudposse/terraform-null-label.git | tags/0.25.0 | ## Resources | Name | Type | |------|------| -| [kubernetes_deployment.tfc_cloud_agent](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/deployment) | resource | -| [kubernetes_namespace.namespace](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/namespace) | resource | -| [kubernetes_secret.secret](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/secret) | resource | -| [kubernetes_service_account.service_account](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/service_account) | resource | +| [kubernetes_deployment.tfc_cloud_agent](https://registry.terraform.io/providers/hashicorp/kubernetes/2.7.1/docs/resources/deployment) | resource | +| [kubernetes_namespace.namespace](https://registry.terraform.io/providers/hashicorp/kubernetes/2.7.1/docs/resources/namespace) | resource | +| [kubernetes_secret.secret](https://registry.terraform.io/providers/hashicorp/kubernetes/2.7.1/docs/resources/secret) | resource | +| [kubernetes_service_account.service_account](https://registry.terraform.io/providers/hashicorp/kubernetes/2.7.1/docs/resources/service_account) | resource | ## Inputs | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| | [additional\_tag\_map](#input\_additional\_tag\_map) | Additional tags for appending to tags\_as\_list\_of\_maps. Not added to `tags`. | `map(string)` | `{}` | no | -| [agent\_cli\_args](#input\_agent\_cli\_args) | Extra command line arguments to pass to tfc-agent | `list` | `[]` | no | -| [agent\_envs](#input\_agent\_envs) | A map of any extra environment variables to pass to the TFC agent | `map` | `{}` | no | +| [agent\_cli\_args](#input\_agent\_cli\_args) | Extra command line arguments to pass to tfc-agent | `list(any)` | `[]` | no | +| [agent\_envs](#input\_agent\_envs) | A map of any extra environment variables to pass to the TFC agent | `map(any)` | `{}` | no | | [agent\_image](#input\_agent\_image) | Name and tag of Terraform Cloud Agent docker image | `string` | `"hashicorp/tfc-agent:latest"` | no | | [attributes](#input\_attributes) | Additional attributes (e.g. `1`) | `list(string)` | `[]` | no | | [context](#input\_context) | Single object for setting entire context at once.
See description of individual variables for details.
Leave string and numeric variables as `null` to use default value.
Individual variable settings (non-null) override settings in context object,
except for attributes, tags, and additional\_tag\_map, which are merged. |
object({
enabled = bool
namespace = string
environment = string
stage = string
name = string
delimiter = string
attributes = list(string)
tags = map(string)
additional_tag_map = map(string)
regex_replace_chars = string
label_order = list(string)
id_length_limit = number
})
|
{
"additional_tag_map": {},
"attributes": [],
"delimiter": null,
"enabled": true,
"environment": null,
"id_length_limit": null,
"label_order": [],
"name": null,
"namespace": null,
"regex_replace_chars": null,
"stage": null,
"tags": {}
}
| no | | [delimiter](#input\_delimiter) | Delimiter to be used between `namespace`, `environment`, `stage`, `name` and `attributes`.
Defaults to `-` (hyphen). Set to `""` to use no delimiter at all. | `string` | `null` | no | -| [deployment\_annotations](#input\_deployment\_annotations) | Annotations to add to the Kubernetes deployment | `map` | `{}` | no | +| [deployment\_annotations](#input\_deployment\_annotations) | Annotations to add to the Kubernetes deployment | `map(any)` | `{}` | no | | [deployment\_name](#input\_deployment\_name) | Override the deployment name in Kubernetes | `string` | `null` | no | | [enabled](#input\_enabled) | Set to false to prevent the module from creating any resources | `bool` | `null` | no | | [environment](#input\_environment) | Environment, e.g. 'uw2', 'us-west-2', OR 'prod', 'staging', 'dev', 'UAT' | `string` | `null` | no | @@ -54,12 +54,12 @@ | [resource\_limits\_memory](#input\_resource\_limits\_memory) | Kubernetes deployment resource hard memory limit | `string` | `"512Mi"` | no | | [resource\_requests\_cpu](#input\_resource\_requests\_cpu) | Kubernetes deployment resource CPU requests | `string` | `"250m"` | no | | [resource\_requests\_memory](#input\_resource\_requests\_memory) | Kubernetes deployment resource memory requests | `string` | `"50Mi"` | no | -| [service\_account\_annotations](#input\_service\_account\_annotations) | Annotations to add to the Kubernetes service account | `map` | `{}` | no | +| [service\_account\_annotations](#input\_service\_account\_annotations) | Annotations to add to the Kubernetes service account | `map(any)` | `{}` | no | | [stage](#input\_stage) | Stage, e.g. 'prod', 'staging', 'dev', OR 'source', 'build', 'test', 'deploy', 'release' | `string` | `null` | no | | [tags](#input\_tags) | Additional tags (e.g. `map('BusinessUnit','XYZ')` | `map(string)` | `{}` | no | | [tfc\_address](#input\_tfc\_address) | The HTTP or HTTPS address of the Terraform Cloud API. | `string` | `"https://app.terraform.io"` | no | +| [tfc\_agent\_auto\_update](#input\_tfc\_agent\_auto\_update) | Disable automatic core updates. ['minor','patch','disabled'] | `string` | `"disabled"` | no | | [tfc\_agent\_data\_dir](#input\_tfc\_agent\_data\_dir) | The path to a directory to store all agent-related data, including
Terraform configurations, cached Terraform release archives, etc. It is
important to ensure that the given directory is backed by plentiful
storage. | `string` | `null` | no | -| [tfc\_agent\_disable\_update](#input\_tfc\_agent\_disable\_update) | Disable automatic core updates. | `bool` | `false` | no | | [tfc\_agent\_log\_level](#input\_tfc\_agent\_log\_level) | The log verbosity expressed as a level string. Level options include
"trace", "debug", "info", "warn", and "error" | `string` | `"info"` | no | | [tfc\_agent\_single](#input\_tfc\_agent\_single) | Enable single mode. This causes the agent to handle at most one job and
immediately exit thereafter. Useful for running agents as ephemeral
containers, VMs, or other isolated contexts with a higher-level scheduler
or process supervisor. | `bool` | `false` | no | | [tfc\_agent\_token](#input\_tfc\_agent\_token) | The agent token to use when making requests to the Terraform Cloud API.
This token must be obtained from the API or UI. It is recommended to use
the environment variable whenever possible for configuring this setting due
to the sensitive nature of API tokens. | `string` | `""` | no | diff --git a/examples/complete/context.tf b/examples/complete/context.tf index bae0cf1..d7a2cee 100644 --- a/examples/complete/context.tf +++ b/examples/complete/context.tf @@ -19,7 +19,7 @@ # module "this" { - source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.19.2" + source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.25.0" enabled = var.enabled namespace = var.namespace diff --git a/examples/complete/fixtures.tfvars b/examples/complete/fixtures.tfvars index 4fa9294..1f8f408 100644 --- a/examples/complete/fixtures.tfvars +++ b/examples/complete/fixtures.tfvars @@ -5,3 +5,6 @@ environment = "ue2" stage = "test" name = "example" + +tags = { test = "test"} + diff --git a/examples/complete/main.tf b/examples/complete/main.tf index e6420f9..cfb8a03 100644 --- a/examples/complete/main.tf +++ b/examples/complete/main.tf @@ -1,6 +1,4 @@ -provider "kubernetes" { - version = "~> 1.12" -} + module "tfc_agent" { source = "../.." diff --git a/examples/complete/versions.tf b/examples/complete/versions.tf index 4a34796..2509bbf 100644 --- a/examples/complete/versions.tf +++ b/examples/complete/versions.tf @@ -1,7 +1,17 @@ terraform { - required_version = ">= 0.12.0, < 0.14" + // required_version = ">= 0.12.0, < 0.14" + required_version = ">= 0.14" required_providers { - kubernetes = "~> 1.12" + kubernetes = { + source = "hashicorp/kubernetes" + version = "2.7.1" + } } } + +provider "kubernetes" { + # Configuration options + +config_path = "~/.kube/config" +} diff --git a/main.tf b/main.tf index c33cafd..c153866 100644 --- a/main.tf +++ b/main.tf @@ -82,8 +82,8 @@ resource "kubernetes_deployment" "tfc_cloud_agent" { value = var.tfc_agent_single } env { - name = "TFC_AGENT_DISABLE_UPDATE" - value = var.tfc_agent_disable_update + name = "TFC_AGENT_AUTO_UPDATE" + value = var.tfc_agent_auto_update } env { name = "TFC_ADDRESS" @@ -104,11 +104,11 @@ resource "kubernetes_deployment" "tfc_cloud_agent" { } } resources { - limits { + limits = { cpu = var.resource_limits_cpu memory = var.resource_limits_memory } - requests { + requests = { cpu = var.resource_requests_cpu memory = var.resource_requests_memory } diff --git a/variables.tf b/variables.tf index 9940666..0ea6fd1 100644 --- a/variables.tf +++ b/variables.tf @@ -23,13 +23,13 @@ variable "replicas" { } variable "deployment_annotations" { - type = map + type = map(any) default = {} description = "Annotations to add to the Kubernetes deployment" } variable "service_account_annotations" { - type = map + type = map(any) default = {} description = "Annotations to add to the Kubernetes service account" } @@ -41,13 +41,13 @@ variable "agent_image" { } variable "agent_cli_args" { - type = list + type = list(any) default = [] description = "Extra command line arguments to pass to tfc-agent" } variable "agent_envs" { - type = map + type = map(any) default = {} description = "A map of any extra environment variables to pass to the TFC agent" } @@ -94,10 +94,10 @@ variable "tfc_agent_single" { EOF } -variable "tfc_agent_disable_update" { - type = bool - default = false - description = "Disable automatic core updates." +variable "tfc_agent_auto_update" { + type = string + default = "disabled" + description = "Disable automatic core updates. ['minor','patch','disabled']" } variable "tfc_address" { diff --git a/versions.tf b/versions.tf index ba071b4..4b95df8 100644 --- a/versions.tf +++ b/versions.tf @@ -1,7 +1,13 @@ terraform { - required_version = ">= 0.12.0, < 0.14.0" - + # required_version = ">= 0.12.0, < 0.14.0" + required_version = ">= 0.14.0" required_providers { - kubernetes = ">= 1.12.0" + kubernetes = { + source = "hashicorp/kubernetes" + version = "2.7.1" + } } } + + +