From d3b68479dea49076a36e0c39e8c41407f270dcad Mon Sep 17 00:00:00 2001 From: Bryant Biggs Date: Fri, 11 Feb 2022 16:26:36 -0500 Subject: [PATCH] feat: Add additional output for OIDC provider (issuer URL without leading `https://`) (#1870) --- .pre-commit-config.yaml | 2 +- README.md | 1 + examples/complete/README.md | 1 + examples/complete/outputs.tf | 5 +++++ examples/eks_managed_node_group/README.md | 1 + examples/eks_managed_node_group/outputs.tf | 5 +++++ examples/fargate_profile/README.md | 1 + examples/fargate_profile/outputs.tf | 5 +++++ examples/irsa_autoscale_refresh/README.md | 1 + examples/irsa_autoscale_refresh/outputs.tf | 5 +++++ examples/self_managed_node_group/README.md | 1 + examples/self_managed_node_group/outputs.tf | 5 +++++ outputs.tf | 5 +++++ 13 files changed, 37 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 093121e..8a010fd 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/antonbabenko/pre-commit-terraform - rev: v1.62.3 + rev: v1.64.0 hooks: - id: terraform_fmt - id: terraform_validate diff --git a/README.md b/README.md index 0f0c566..8f7aca7 100644 --- a/README.md +++ b/README.md @@ -844,6 +844,7 @@ Full contributing [guidelines are covered here](https://github.com/terraform-aws | [fargate\_profiles](#output\_fargate\_profiles) | Map of attribute maps for all EKS Fargate Profiles created | | [node\_security\_group\_arn](#output\_node\_security\_group\_arn) | Amazon Resource Name (ARN) of the node shared security group | | [node\_security\_group\_id](#output\_node\_security\_group\_id) | ID of the node shared security group | +| [oidc\_provider](#output\_oidc\_provider) | The OpenID Connect identity provider (issuer URL without leading `https://`) | | [oidc\_provider\_arn](#output\_oidc\_provider\_arn) | The ARN of the OIDC Provider if `enable_irsa = true` | | [self\_managed\_node\_groups](#output\_self\_managed\_node\_groups) | Map of attribute maps for all self managed node groups created | diff --git a/examples/complete/README.md b/examples/complete/README.md index 6fa1f3e..e8831ad 100644 --- a/examples/complete/README.md +++ b/examples/complete/README.md @@ -94,6 +94,7 @@ No inputs. | [cluster\_status](#output\_cluster\_status) | Status of the EKS cluster. One of `CREATING`, `ACTIVE`, `DELETING`, `FAILED` | | [eks\_managed\_node\_groups](#output\_eks\_managed\_node\_groups) | Map of attribute maps for all EKS managed node groups created | | [fargate\_profiles](#output\_fargate\_profiles) | Map of attribute maps for all EKS Fargate Profiles created | +| [oidc\_provider](#output\_oidc\_provider) | The OpenID Connect identity provider (issuer URL without leading `https://`) | | [oidc\_provider\_arn](#output\_oidc\_provider\_arn) | The ARN of the OIDC Provider if `enable_irsa = true` | | [self\_managed\_node\_groups](#output\_self\_managed\_node\_groups) | Map of attribute maps for all self managed node groups created | diff --git a/examples/complete/outputs.tf b/examples/complete/outputs.tf index 8a9153c..0059b25 100644 --- a/examples/complete/outputs.tf +++ b/examples/complete/outputs.tf @@ -55,6 +55,11 @@ output "cluster_security_group_arn" { # IRSA ################################################################################ +output "oidc_provider" { + description = "The OpenID Connect identity provider (issuer URL without leading `https://`)" + value = module.eks.oidc_provider +} + output "oidc_provider_arn" { description = "The ARN of the OIDC Provider if `enable_irsa = true`" value = module.eks.oidc_provider_arn diff --git a/examples/eks_managed_node_group/README.md b/examples/eks_managed_node_group/README.md index dad516e..61e7936 100644 --- a/examples/eks_managed_node_group/README.md +++ b/examples/eks_managed_node_group/README.md @@ -127,6 +127,7 @@ No inputs. | [fargate\_profiles](#output\_fargate\_profiles) | Map of attribute maps for all EKS Fargate Profiles created | | [node\_security\_group\_arn](#output\_node\_security\_group\_arn) | Amazon Resource Name (ARN) of the node shared security group | | [node\_security\_group\_id](#output\_node\_security\_group\_id) | ID of the node shared security group | +| [oidc\_provider](#output\_oidc\_provider) | The OpenID Connect identity provider (issuer URL without leading `https://`) | | [oidc\_provider\_arn](#output\_oidc\_provider\_arn) | The ARN of the OIDC Provider if `enable_irsa = true` | | [self\_managed\_node\_groups](#output\_self\_managed\_node\_groups) | Map of attribute maps for all self managed node groups created | diff --git a/examples/eks_managed_node_group/outputs.tf b/examples/eks_managed_node_group/outputs.tf index 3e96201..c6d9be3 100644 --- a/examples/eks_managed_node_group/outputs.tf +++ b/examples/eks_managed_node_group/outputs.tf @@ -74,6 +74,11 @@ output "node_security_group_id" { # IRSA ################################################################################ +output "oidc_provider" { + description = "The OpenID Connect identity provider (issuer URL without leading `https://`)" + value = module.eks.oidc_provider +} + output "oidc_provider_arn" { description = "The ARN of the OIDC Provider if `enable_irsa = true`" value = module.eks.oidc_provider_arn diff --git a/examples/fargate_profile/README.md b/examples/fargate_profile/README.md index 85bce85..3d58e3a 100644 --- a/examples/fargate_profile/README.md +++ b/examples/fargate_profile/README.md @@ -71,6 +71,7 @@ No inputs. | [fargate\_profiles](#output\_fargate\_profiles) | Map of attribute maps for all EKS Fargate Profiles created | | [node\_security\_group\_arn](#output\_node\_security\_group\_arn) | Amazon Resource Name (ARN) of the node shared security group | | [node\_security\_group\_id](#output\_node\_security\_group\_id) | ID of the node shared security group | +| [oidc\_provider](#output\_oidc\_provider) | The OpenID Connect identity provider (issuer URL without leading `https://`) | | [oidc\_provider\_arn](#output\_oidc\_provider\_arn) | The ARN of the OIDC Provider if `enable_irsa = true` | | [self\_managed\_node\_groups](#output\_self\_managed\_node\_groups) | Map of attribute maps for all self managed node groups created | diff --git a/examples/fargate_profile/outputs.tf b/examples/fargate_profile/outputs.tf index 3e96201..c6d9be3 100644 --- a/examples/fargate_profile/outputs.tf +++ b/examples/fargate_profile/outputs.tf @@ -74,6 +74,11 @@ output "node_security_group_id" { # IRSA ################################################################################ +output "oidc_provider" { + description = "The OpenID Connect identity provider (issuer URL without leading `https://`)" + value = module.eks.oidc_provider +} + output "oidc_provider_arn" { description = "The ARN of the OIDC Provider if `enable_irsa = true`" value = module.eks.oidc_provider_arn diff --git a/examples/irsa_autoscale_refresh/README.md b/examples/irsa_autoscale_refresh/README.md index d48a2a8..ac65d52 100644 --- a/examples/irsa_autoscale_refresh/README.md +++ b/examples/irsa_autoscale_refresh/README.md @@ -97,6 +97,7 @@ No inputs. | [fargate\_profiles](#output\_fargate\_profiles) | Map of attribute maps for all EKS Fargate Profiles created | | [node\_security\_group\_arn](#output\_node\_security\_group\_arn) | Amazon Resource Name (ARN) of the node shared security group | | [node\_security\_group\_id](#output\_node\_security\_group\_id) | ID of the node shared security group | +| [oidc\_provider](#output\_oidc\_provider) | The OpenID Connect identity provider (issuer URL without leading `https://`) | | [oidc\_provider\_arn](#output\_oidc\_provider\_arn) | The ARN of the OIDC Provider if `enable_irsa = true` | | [self\_managed\_node\_groups](#output\_self\_managed\_node\_groups) | Map of attribute maps for all self managed node groups created | diff --git a/examples/irsa_autoscale_refresh/outputs.tf b/examples/irsa_autoscale_refresh/outputs.tf index 3e96201..c6d9be3 100644 --- a/examples/irsa_autoscale_refresh/outputs.tf +++ b/examples/irsa_autoscale_refresh/outputs.tf @@ -74,6 +74,11 @@ output "node_security_group_id" { # IRSA ################################################################################ +output "oidc_provider" { + description = "The OpenID Connect identity provider (issuer URL without leading `https://`)" + value = module.eks.oidc_provider +} + output "oidc_provider_arn" { description = "The ARN of the OIDC Provider if `enable_irsa = true`" value = module.eks.oidc_provider_arn diff --git a/examples/self_managed_node_group/README.md b/examples/self_managed_node_group/README.md index 8356943..580854b 100644 --- a/examples/self_managed_node_group/README.md +++ b/examples/self_managed_node_group/README.md @@ -91,6 +91,7 @@ No inputs. | [fargate\_profiles](#output\_fargate\_profiles) | Map of attribute maps for all EKS Fargate Profiles created | | [node\_security\_group\_arn](#output\_node\_security\_group\_arn) | Amazon Resource Name (ARN) of the node shared security group | | [node\_security\_group\_id](#output\_node\_security\_group\_id) | ID of the node shared security group | +| [oidc\_provider](#output\_oidc\_provider) | The OpenID Connect identity provider (issuer URL without leading `https://`) | | [oidc\_provider\_arn](#output\_oidc\_provider\_arn) | The ARN of the OIDC Provider if `enable_irsa = true` | | [self\_managed\_node\_groups](#output\_self\_managed\_node\_groups) | Map of attribute maps for all self managed node groups created | diff --git a/examples/self_managed_node_group/outputs.tf b/examples/self_managed_node_group/outputs.tf index 3e96201..c6d9be3 100644 --- a/examples/self_managed_node_group/outputs.tf +++ b/examples/self_managed_node_group/outputs.tf @@ -74,6 +74,11 @@ output "node_security_group_id" { # IRSA ################################################################################ +output "oidc_provider" { + description = "The OpenID Connect identity provider (issuer URL without leading `https://`)" + value = module.eks.oidc_provider +} + output "oidc_provider_arn" { description = "The ARN of the OIDC Provider if `enable_irsa = true`" value = module.eks.oidc_provider_arn diff --git a/outputs.tf b/outputs.tf index 36799b2..e6867b5 100644 --- a/outputs.tf +++ b/outputs.tf @@ -74,6 +74,11 @@ output "node_security_group_id" { # IRSA ################################################################################ +output "oidc_provider" { + description = "The OpenID Connect identity provider (issuer URL without leading `https://`)" + value = try(replace(aws_eks_cluster.this[0].identity[0].oidc[0].issuer, "https://", ""), "") +} + output "oidc_provider_arn" { description = "The ARN of the OIDC Provider if `enable_irsa = true`" value = try(aws_iam_openid_connect_provider.oidc_provider[0].arn, "")