diff --git a/README.md b/README.md index 7174037dd90..32227f61295 100644 --- a/README.md +++ b/README.md @@ -191,7 +191,7 @@ MIT Licensed. See [LICENSE](https://github.com/terraform-aws-modules/terraform-a | eks\_oidc\_root\_ca\_thumbprint | Thumbprint of Root CA for EKS OIDC, Valid until 2037 | `string` | `"9e99a48a9960b14926bb7f3b02e22da2b0ab7280"` | no | | enable\_irsa | Whether to create OpenID Connect Provider for EKS to enable IRSA | `bool` | `false` | no | | fargate\_pod\_execution\_role\_name | The IAM Role that provides permissions for the EKS Fargate Profile. | `string` | `null` | no | -| fargate\_profiles | Fargate profiles |
map(object({| `{}` | no | +| fargate\_profiles | Fargate profiles to create. See `fargate_profile` keys section in README.md for more details | `any` | `{}` | no | | iam\_path | If provided, all IAM roles will be created on this path. | `string` | `"/"` | no | | kubeconfig\_aws\_authenticator\_additional\_args | Any additional arguments to pass to the authenticator such as the role to assume. e.g. ["-r", "MyEksRole"]. | `list(string)` | `[]` | no | | kubeconfig\_aws\_authenticator\_command | Command to use to fetch AWS EKS credentials. | `string` | `"aws-iam-authenticator"` | no | diff --git a/modules/fargate/README.md b/modules/fargate/README.md index b0326e29fa2..1f329665b60 100644 --- a/modules/fargate/README.md +++ b/modules/fargate/README.md @@ -5,6 +5,15 @@ Helper submodule to create and manage resources related to `aws_eks_fargate_prof ## Assumptions * Designed for use by the parent module and not directly by end users +## `fargate_profile` keys +`fargate_profile` is a map of maps. Key of first level will be used as unique value for `for_each` resources and in the `aws_eks_fargate_profile` name. Inner map can take the below values. + +| Name | Description | Type | Default | Required | +|------|-------------|------|---------|:--------:| +| name | Fargate profile name | `string` | Auto generated in the following format `[cluster_name]-fargate-[fargate_profile_map_key]`| no | +| namespace | Kubernetes namespace for selection | `string` | n/a | yes | +| labels | Key-value map of Kubernetes labels for selection | `map(string)` | `{}` | no | + ## Requirements @@ -25,7 +34,7 @@ No requirements. | create\_fargate\_pod\_execution\_role | Controls if the the IAM Role that provides permissions for the EKS Fargate Profile should be created. | `bool` | `true` | no | | eks\_depends\_on | List of references to other resources this submodule depends on. | `any` | `null` | no | | fargate\_pod\_execution\_role\_name | The IAM Role that provides permissions for the EKS Fargate Profile. | `string` | `null` | no | -| fargate\_profiles | Fargate profiles to create. |
namespace = string
labels = map(string)
}))
map(object({| `{}` | no | +| fargate\_profiles | Fargate profiles to create. See `fargate_profile` keys section in README.md for more details | `any` | `{}` | no | | iam\_path | IAM roles will be created on this path. | `string` | n/a | yes | | iam\_policy\_arn\_prefix | IAM policy prefix with the correct AWS partition. | `string` | n/a | yes | | subnets | A list of subnets for the EKS Fargate profiles. | `list(string)` | n/a | yes | diff --git a/modules/fargate/variables.tf b/modules/fargate/variables.tf index 5953a55e065..4c8922747ab 100644 --- a/modules/fargate/variables.tf +++ b/modules/fargate/variables.tf @@ -32,12 +32,9 @@ variable "fargate_pod_execution_role_name" { } variable "fargate_profiles" { - description = "Fargate profiles to create." - type = map(object({ - namespace = string - labels = map(string) - })) - default = {} + description = "Fargate profiles to create. See `fargate_profile` keys section in README.md for more details" + type = any + default = {} } variable "subnets" { diff --git a/variables.tf b/variables.tf index 0e06dd0a1d9..639af7790e3 100644 --- a/variables.tf +++ b/variables.tf @@ -351,12 +351,9 @@ variable "cluster_encryption_config" { } variable "fargate_profiles" { - description = "Fargate profiles" - type = map(object({ - namespace = string - labels = map(string) - })) - default = {} + description = "Fargate profiles to create. See `fargate_profile` keys section in README.md for more details" + type = any + default = {} } variable "create_fargate_pod_execution_role" {
namespace = string
labels = map(string)
}))