Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Default to clusters OIDC issuer URL for aws_eks_identity_provider_config #2190

Merged

Conversation

igorbrites
Copy link
Contributor

@igorbrites igorbrites commented Aug 5, 2022

Description

(I'm thinking if this should be a PR or an Issue, but I'm not too good to describe things, so here is the PR 😄).

Nowadays, to create an aws_eks_identity_provider_config using the module, we need to pass the issuer_url:

module "eks" {
  # ...
  cluster_identity_providers = {
    default = {
      client_id  = "sts.amazonaws.com"
      issuer_url = "https://oidc.eks.us-east-1.amazonaws.com/id/A1B2C3D4E5F6G7H8I9J0"
    }
  }
}

But this value is already present on the cluster, and we can't self-reference the value on the module, nor use data sources to set this value when creating a new cluster.

So, I think we could pass the cluster's OIDC issuer URL as the default parameter to the aws_eks_identity_provider_config resource.

Or I understood this wrong, which is a possibility 😬. If so, how do you guys create aws_eks_identity_provider_configs?

Motivation and Context

Removes the need to create aws_eks_identity_provider_config outside the module.

Breaking Changes

It does not break any version.

How Has This Been Tested?

  • I have updated at least one of the examples/* to demonstrate and validate my change(s)
  • I have tested and validated these changes using one or more of the provided examples/* projects
  • I have executed pre-commit run -a on my pull request

@igorbrites igorbrites force-pushed the fix/oidc-issuer-url branch from 804f893 to e05506a Compare August 5, 2022 14:42
@bryantbiggs bryantbiggs changed the title feat: setting oidc issuer as default option for aws_eks_identity_provider_config feat: Default to clusters OIDC issuer URL for aws_eks_identity_provider_config Aug 9, 2022
Copy link
Member

@bryantbiggs bryantbiggs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @igorbrites !

@bryantbiggs bryantbiggs merged commit 93065fa into terraform-aws-modules:master Aug 9, 2022
antonbabenko pushed a commit that referenced this pull request Aug 9, 2022
## [18.27.0](v18.26.6...v18.27.0) (2022-08-09)

### Features

* Default to clusters OIDC issuer URL for `aws_eks_identity_provider_config` ([#2190](#2190)) ([93065fa](93065fa))
@antonbabenko
Copy link
Member

This PR is included in version 18.27.0 🎉

@igorbrites igorbrites deleted the fix/oidc-issuer-url branch August 9, 2022 19:40
baibailiha added a commit to baibailiha/terraform-aws-eks that referenced this pull request Sep 13, 2022
## [18.27.0](terraform-aws-modules/terraform-aws-eks@v18.26.6...v18.27.0) (2022-08-09)

### Features

* Default to clusters OIDC issuer URL for `aws_eks_identity_provider_config` ([#2190](terraform-aws-modules/terraform-aws-eks#2190)) ([cc8ce41](terraform-aws-modules/terraform-aws-eks@cc8ce41))
@github-actions
Copy link

github-actions bot commented Nov 8, 2022

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 8, 2022
@bryantbiggs
Copy link
Member

FYI - this default behavior is being reverted starting in 1.30 since it is incorrect and the upstream K8s project is tightening up authentication #3055

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants