From 50e4ff6aec7c2b0f7903516264ee58411edd4bcd Mon Sep 17 00:00:00 2001 From: John Titus Date: Tue, 30 Mar 2021 16:17:11 -0500 Subject: [PATCH] Update kubernetes provider configuration based on hashicorp/terraform-provider-kubernetes#1167 --- modules/cluster/README.md | 35 +++++++++++++++++++++++-- modules/kubernetes_components/README.md | 26 ++++++++++++++++-- tests/cluster/main.tf | 8 ++++-- 3 files changed, 63 insertions(+), 6 deletions(-) diff --git a/modules/cluster/README.md b/modules/cluster/README.md index e6aa7e6..cbfd463 100644 --- a/modules/cluster/README.md +++ b/modules/cluster/README.md @@ -24,6 +24,13 @@ Full working references are available at [examples](examples) There should be no changes required to move from previous versions of this module to version 0.12.0 or higher. +## Requirements + +| Name | Version | +|------|---------| +| terraform | >= 0.12 | +| aws | >= 2.7.0 | + ## Providers | Name | Version | @@ -32,14 +39,39 @@ There should be no changes required to move from previous versions of this modul | null | n/a | | template | n/a | +## Modules + +No Modules. + +## Resources + +| Name | +|------| +| [aws_ami](https://registry.terraform.io/providers/hashicorp/aws/2.7.0/docs/data-sources/ami) | +| [aws_cloudwatch_log_group](https://registry.terraform.io/providers/hashicorp/aws/2.7.0/docs/resources/cloudwatch_log_group) | +| [aws_eks_cluster](https://registry.terraform.io/providers/hashicorp/aws/2.7.0/docs/resources/eks_cluster) | +| [aws_iam_instance_profile](https://registry.terraform.io/providers/hashicorp/aws/2.7.0/docs/resources/iam_instance_profile) | +| [aws_iam_policy](https://registry.terraform.io/providers/hashicorp/aws/2.7.0/docs/resources/iam_policy) | +| [aws_iam_policy_document](https://registry.terraform.io/providers/hashicorp/aws/2.7.0/docs/data-sources/iam_policy_document) | +| [aws_iam_role](https://registry.terraform.io/providers/hashicorp/aws/2.7.0/docs/data-sources/iam_role) | +| [aws_iam_role](https://registry.terraform.io/providers/hashicorp/aws/2.7.0/docs/resources/iam_role) | +| [aws_iam_role_policy_attachment](https://registry.terraform.io/providers/hashicorp/aws/2.7.0/docs/resources/iam_role_policy_attachment) | +| [aws_instance](https://registry.terraform.io/providers/hashicorp/aws/2.7.0/docs/resources/instance) | +| [aws_security_group](https://registry.terraform.io/providers/hashicorp/aws/2.7.0/docs/resources/security_group) | +| [null_resource](https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource) | +| [template_file](https://registry.terraform.io/providers/hashicorp/template/latest/docs/data-sources/file) | + ## Inputs | Name | Description | Type | Default | Required | -|------|-------------|------|---------|:-----:| +|------|-------------|------|---------|:--------:| | alb\_ingress\_controller\_enable | A boolean value that determines if IAM policies related to ALB ingress controller should be created. | `bool` | `true` | no | +| bastion\_security\_groups | Security groups for the Amazon Linux 2 bastion | `list(string)` |
[
""
]
| no | +| bastion\_subnet | Public subnet to put the Amazon Linux 2 bastion in | `string` | `""` | no | | bootstrap\_arguments | Any optional parameters for the EKS Bootstrapping script. This is ignored for all os's except Amazon EKS | `string` | `""` | no | | bootstrap\_arguments\_windows | Any optional parameters for the EKS Bootstrapping script. This is ignored for all os's except Windows EKS | `string` | `""` | no | | cluster\_autoscaler\_enable | A boolean value that determines if IAM policies related to cluster autoscaler should be created. | `bool` | `true` | no | +| create\_bastion | Create an Amazon 2 Linux bastion to access private cluster resources with kubectl | `bool` | `false` | no | | enabled\_cluster\_log\_types | A list of the desired control plane logging to enable. All logs are enabled by default. | `list(string)` |
[
"api",
"audit",
"authenticator",
"controllerManager",
"scheduler"
]
| no | | environment | Application environment for which this network is being created. Preferred value are Development, Integration, PreProduction, Production, QA, Staging, or Test | `string` | `"Development"` | no | | kubernetes\_version | The desired Kubernetes version for your cluster. If you do not specify a value here, the latest version available in Amazon EKS is used. | `string` | `""` | no | @@ -71,4 +103,3 @@ There should be no changes required to move from previous versions of this modul | name | Assigned name of the EKS Cluster | | setup | Default EKS bootstrapping script for Linux EC2 instances | | setup\_windows | Default EKS bootstrapping script for Windows EC2 instances | - diff --git a/modules/kubernetes_components/README.md b/modules/kubernetes_components/README.md index 03ac935..3bafdc3 100644 --- a/modules/kubernetes_components/README.md +++ b/modules/kubernetes_components/README.md @@ -20,16 +20,39 @@ Full working references are available at [examples](examples) There should be no changes required to move from previous versions of this module to version 0.12.0 or higher. +## Requirements + +| Name | Version | +|------|---------| +| terraform | >= 0.12 | +| kubernetes | >= 1.1.0 | + ## Providers | Name | Version | |------|---------| | kubernetes | >= 1.1.0 | +## Modules + +No Modules. + +## Resources + +| Name | +|------| +| [kubernetes_cluster_role](https://registry.terraform.io/providers/hashicorp/kubernetes/1.1.0/docs/resources/cluster_role) | +| [kubernetes_cluster_role_binding](https://registry.terraform.io/providers/hashicorp/kubernetes/1.1.0/docs/resources/cluster_role_binding) | +| [kubernetes_config_map](https://registry.terraform.io/providers/hashicorp/kubernetes/1.1.0/docs/resources/config_map) | +| [kubernetes_deployment](https://registry.terraform.io/providers/hashicorp/kubernetes/1.1.0/docs/resources/deployment) | +| [kubernetes_role](https://registry.terraform.io/providers/hashicorp/kubernetes/1.1.0/docs/resources/role) | +| [kubernetes_role_binding](https://registry.terraform.io/providers/hashicorp/kubernetes/1.1.0/docs/resources/role_binding) | +| [kubernetes_service_account](https://registry.terraform.io/providers/hashicorp/kubernetes/1.1.0/docs/resources/service_account) | + ## Inputs | Name | Description | Type | Default | Required | -|------|-------------|------|---------|:-----:| +|------|-------------|------|---------|:--------:| | alb\_ingress\_controller\_enable | A variable to control whether or not the ALB Ingress resources are enabled | `bool` | `true` | no | | alb\_max\_api\_retries | Maximum number of times to retry the aws calls | `number` | `10` | no | | cluster\_autoscaler\_cpu\_limits | CPU Limits for the CA Pod | `string` | `"100m"` | no | @@ -49,4 +72,3 @@ There should be no changes required to move from previous versions of this modul ## Outputs No output. - diff --git a/tests/cluster/main.tf b/tests/cluster/main.tf index 0b2dd5d..a2ebb53 100644 --- a/tests/cluster/main.tf +++ b/tests/cluster/main.tf @@ -10,8 +10,8 @@ provider "aws" { provider "kubernetes" { version = "~> 1.13.0" - cluster_ca_certificate = base64decode(module.eks.certificate_authority_data) - host = module.eks.endpoint + cluster_ca_certificate = base64decode(data.aws_eks_cluster.eks.certificate_authority[0].data) + host = data.aws_eks_cluster.eks.endpoint load_config_file = false token = data.aws_eks_cluster_auth.eks.token } @@ -24,6 +24,10 @@ provider "template" { version = "~> 2.0" } +data "aws_eks_cluster" "eks" { + name = module.eks.name +} + data "aws_eks_cluster_auth" "eks" { name = module.eks.name }