Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ BREAKING CHANGES:
* Variable `agent_disable_update` is now `agent_auto_update` which defaults to minor and must be one of *disabled*, *minor*, or *patch* (#7)

IMPROVEMENTS:
* [Example usage](examples/default/) added to the examples/default directory (#7)
* [Example usage](examples/default/) added to the examples/default directory (#7)
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ provider "kubernetes" {}

module "terraform-cloud-agent-kubernetes" {
source = "redeux/terraform-cloud-agent/kubernetes"
version = "0.1.0"
version = "~> 1.0.1"

namespace = "terraform-cloud-agent"
create_namespace = true
Expand Down Expand Up @@ -67,6 +67,8 @@ No modules.
| <a name="input_namespace"></a> [namespace](#input\_namespace) | The namespace to deploy the agent into. Unless create\_namespace is true, the namespace must already exist. | `string` | n/a | yes |
| <a name="input_requests_cpu"></a> [requests\_cpu](#input\_requests\_cpu) | CPU requests. | `string` | `"500m"` | no |
| <a name="input_requests_memory"></a> [requests\_memory](#input\_requests\_memory) | Memory requests. | `string` | `"250Mi"` | no |
| <a name="input_service_account_annotations"></a> [service\_account\_annotations](#input\_service\_account\_annotations) | Annotations to add to the Kubernetes service account. Can be used to annotate the IRSA. | `map(string)` | `{}` | no |
| <a name="input_service_account_name"></a> [service\_account\_name](#input\_service\_account\_name) | Name of the service account. | `string` | `"terraform-cloud-agent"` | no |
| <a name="input_tfc_url"></a> [tfc\_url](#input\_tfc\_url) | The Terraform Cloud endpoint. Must be changed if using Terraform Enterprise. | `string` | `"https://app.terraform.io"` | no |

## Outputs
Expand Down
2 changes: 1 addition & 1 deletion kubernetes_cluster_role_binding.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ resource "kubernetes_cluster_role_binding" "tfc_agent_cluster_role_binding" {
name = kubernetes_service_account.tfc_agent_service_account[0].metadata[0].name
namespace = var.namespace
}
}
}
2 changes: 1 addition & 1 deletion kubernetes_namespace.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ resource "kubernetes_namespace" "tfc_agent_namespace" {

name = var.namespace
}
}
}
2 changes: 1 addition & 1 deletion kubernetes_secret.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ resource "kubernetes_secret" "tfc_agent_token" {
data = {
"token" = var.agent_token
}
}
}
8 changes: 4 additions & 4 deletions kubernetes_service_account.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ resource "kubernetes_service_account" "tfc_agent_service_account" {
"app.kubernetes.io/module-version" = local.module-version
"app.kubernetes.io/managed-by" = "terraform"
}

name = "terraform-cloud-agent"
namespace = var.create_namespace ? kubernetes_namespace.tfc_agent_namespace[0].metadata[0].name : var.namespace
name = var.service_account_name
namespace = var.create_namespace ? kubernetes_namespace.tfc_agent_namespace[0].metadata[0].name : var.namespace
annotations = var.service_account_annotations
}
}
}
11 changes: 11 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,14 @@ variable "tfc_url" {
description = "The Terraform Cloud endpoint. Must be changed if using Terraform Enterprise."
}

variable "service_account_name" {
type = string
default = "terraform-cloud-agent"
description = "Name of the service account."
}

variable "service_account_annotations" {
type = map(string)
default = {}
description = "Annotations to add to the Kubernetes service account. Can be used to annotate the IRSA."
}