Skip to content

Commit 78f5d1b

Browse files
authored
Merge pull request #32 from appvia/aws-auth-configmap
Allow passing in IAM Roles to add to the AWS Auth ConfigMap.
2 parents d9cd757 + 60b100a commit 78f5d1b

File tree

7 files changed

+29
-0
lines changed

7 files changed

+29
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ The `terraform-docs` utility is used to generate this README. Follow the below s
7575
| <a name="input_disable_local_login"></a> [disable\_local\_login](#input\_disable\_local\_login) | Whether to disable local login for Wayfinder. Note: An IDP must be configured within Wayfinder, otherwise you will not be able to log in. | `bool` | `false` | no |
7676
| <a name="input_dns_zone_arn"></a> [dns\_zone\_arn](#input\_dns\_zone\_arn) | The AWS Route53 DNS Zone ARN to use (e.g. arn:aws:route53:::hostedzone/ABCDEFG1234567). | `string` | n/a | yes |
7777
| <a name="input_ebs_csi_kms_cmk_ids"></a> [ebs\_csi\_kms\_cmk\_ids](#input\_ebs\_csi\_kms\_cmk\_ids) | List of KMS CMKs to allow EBS CSI to manage encrypted volumes. This is required if EBS encryption is set at the account level with a default KMS CMK. | `list(string)` | `[]` | no |
78+
| <a name="input_eks_aws_auth_roles"></a> [eks\_aws\_auth\_roles](#input\_eks\_aws\_auth\_roles) | List of IAM Role maps to add to the aws-auth configmap. This is required if you use a different IAM Role for Terraform Plan actions. | <pre>list(object({<br> rolearn = string<br> username = string<br> groups = list(string)<br> }))</pre> | `[]` | no |
7879
| <a name="input_eks_ng_capacity_type"></a> [eks\_ng\_capacity\_type](#input\_eks\_ng\_capacity\_type) | The capacity type to use for the EKS managed node group. | `string` | `"ON_DEMAND"` | no |
7980
| <a name="input_eks_ng_desired_size"></a> [eks\_ng\_desired\_size](#input\_eks\_ng\_desired\_size) | The desired size to use for the EKS managed node group. | `number` | `2` | no |
8081
| <a name="input_eks_ng_instance_types"></a> [eks\_ng\_instance\_types](#input\_eks\_ng\_instance\_types) | The instance types to use for the EKS managed node group. | `list(string)` | <pre>[<br> "t3.xlarge"<br>]</pre> | no |

eks.tf

+3
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@ module "eks" {
115115
ipv6_cidr_blocks = ["::/0"]
116116
}
117117
}, var.node_security_group_additional_rules)
118+
119+
manage_aws_auth_configmap = true
120+
aws_auth_roles = var.eks_aws_auth_roles
118121
}
119122

120123
module "irsa-ebs-csi-driver" {

examples/complete/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ The `terraform-docs` utility is used to generate this README. Follow the below s
4444
| <a name="input_environment"></a> [environment](#input\_environment) | The environment name we are provisioning. | `string` | `"production"` | no |
4545
| <a name="input_idp_provider"></a> [idp\_provider](#input\_idp\_provider) | The Identity Provider type to configure for Wayfinder (supported: generic, aad). | `string` | `"generic"` | no |
4646
| <a name="input_tags"></a> [tags](#input\_tags) | Tags to apply to all resources. | `map(any)` | `{}` | no |
47+
| <a name="input_terraform_plan_role_arn"></a> [terraform\_plan\_role\_arn](#input\_terraform\_plan\_role\_arn) | The ARN of the IAM role used for Terraform plan operations. | `string` | n/a | yes |
4748
| <a name="input_vpc_cidr"></a> [vpc\_cidr](#input\_vpc\_cidr) | CIDR block for the Wayfinder VPC. | `string` | `"10.0.0.0/21"` | no |
4849
| <a name="input_vpc_private_subnets"></a> [vpc\_private\_subnets](#input\_vpc\_private\_subnets) | List of private subnets in the Wayfinder VPC. | `list(string)` | <pre>[<br> "10.0.0.0/24",<br> "10.0.1.0/24",<br> "10.0.2.0/24"<br>]</pre> | no |
4950
| <a name="input_vpc_public_subnets"></a> [vpc\_public\_subnets](#input\_vpc\_public\_subnets) | List of public subnets in the Wayfinder VPC. | `list(string)` | <pre>[<br> "10.0.3.0/24",<br> "10.0.4.0/24",<br> "10.0.5.0/24"<br>]</pre> | no |

examples/complete/main.tf

+8
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ module "wayfinder" {
2424
azureTenantId = var.idp_provider == "aad" ? jsondecode(data.aws_secretsmanager_secret_version.wayfinder.secret_string)["idpAzureTenantId"] : ""
2525
}
2626

27+
eks_aws_auth_roles = [
28+
{
29+
rolearn = var.terraform_plan_role_arn
30+
username = "terraform-identity-plan"
31+
groups = ["system:masters"]
32+
}
33+
]
34+
2735
# cluster_security_group_additional_rules = {
2836
# allow_access_from_vpn = {
2937
# description = "Allow access to the Wayfinder API from within My Organisation's internal network"

examples/complete/terraform.tfvars.sample

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ disable_local_login = true
33
dns_zone_name = "wf.example.com"
44
idp_provider = "generic"
55
wayfinder_instance_id = "your-wayfinder-instance-id"
6+
terraform_plan_role_arn = "arn:aws:iam::123456789012:role/terraform-plan-role"
67
tags = {
78
Repository = "Your Repository URL"
89
Provisioner = "Terraform"

examples/complete/variables.tf

+5
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@ variable "tags" {
6666
default = {}
6767
}
6868

69+
variable "terraform_plan_role_arn" {
70+
description = "The ARN of the IAM role used for Terraform plan operations."
71+
type = string
72+
}
73+
6974
variable "vpc_cidr" {
7075
description = "CIDR block for the Wayfinder VPC."
7176
type = string

variables.tf

+10
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,16 @@ variable "ebs_csi_kms_cmk_ids" {
5050
default = []
5151
}
5252

53+
variable "eks_aws_auth_roles" {
54+
description = "List of IAM Role maps to add to the aws-auth configmap. This is required if you use a different IAM Role for Terraform Plan actions."
55+
default = []
56+
type = list(object({
57+
rolearn = string
58+
username = string
59+
groups = list(string)
60+
}))
61+
}
62+
5363
variable "eks_ng_capacity_type" {
5464
description = "The capacity type to use for the EKS managed node group."
5565
type = string

0 commit comments

Comments
 (0)