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

backend/azurerm: add support for generic OIDC authentication #31966

Merged
merged 4 commits into from Oct 31, 2022

Conversation

kschu91
Copy link
Contributor

@kschu91 kschu91 commented Oct 7, 2022

Support for generic OIDC authentication (eg. for Gitlab or Kubernetes) has been added to azurerm provider as well as in the go-azure-helpers already:
hashicorp/terraform-provider-azurerm#16901
https://github.com/hashicorp/go-azure-helpers/blob/main/authentication/auth_method_oidc.go#L41

Currently the remote state backend only supports Github Actions. This pull requests added the support for generic OIDC as in the provider. Also, the documentation has been updated to reflect the usage.

Info: This pull request upgrades the dependency of go-azure-helpers to the latest available version.

Fixes #31802

Target Release

1.4.x

Draft CHANGELOG entry

NEW FEATURES

  • Added support for generic OIDC authentication in azurerm remote state backend (eg. Gitlab or Kubernetes)

@kschu91 kschu91 requested a review from a team as a code owner October 7, 2022 15:55
@hashicorp-cla
Copy link

hashicorp-cla commented Oct 7, 2022

CLA assistant check
All committers have signed the CLA.

@mfortin
Copy link

mfortin commented Oct 7, 2022

Related to #31802

… documentation is more clear about it´s usage. oidc_request_url and oidc_request_token are meant to be used for Github Actions only.
@crw
Copy link
Collaborator

crw commented Oct 7, 2022

Thanks for this submission! I'll notify the AzureRM team.

Copy link
Member

@manicminer manicminer left a comment

Choose a reason for hiding this comment

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

Thanks for this contribution @kschu91, this mostly LGTM. I've added the additional properties to the docs along with a minor schema fix, so I will wait for a second contributor to review.

@kabal2010
Copy link

Can I please ask if this is still been worked on as we'll need to use this functionality in Azure Kubernetes Cluster and move away from pod-identity which will replaced soon with workload identity?

@manicminer
Copy link
Member

@kabal2010 This is more or less ready for merging but will not be released until Terraform 1.4.

@manicminer manicminer changed the title Added support for generic OIDC authentication (eg. Gitlab or Kubernetes) backend/azurerm: add support for generic OIDC authentication Oct 18, 2022
@kabal2010
Copy link

@manicminer Thanks for a prompt response on this. Just out of curiosity, is there a timeline for this?

@crw
Copy link
Collaborator

crw commented Oct 19, 2022

@kabal2010, not at this time. "Minor" numbered releases usually happen every four months or so, but it depends on what work is slated for that release. I wish I had a clearer (or sooner!) timeline for you, but I wanted to set expectations appropriately. Hope this helps!

@kabal2010
Copy link

@crw Thanks for that. I wish this can be made available sooner in the upcoming 1.3.x releases, but unfortunately, like you mentioned, we might have to be patient. In the meantime, since it works in Github Actions, we'll research that and hopefully it'll meet our requirements.

Copy link
Member

@tombuildsstuff tombuildsstuff left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@manicminer manicminer added the 1.3-backport If you add this label to a PR before merging, backport-assistant will open a new PR once merged label Oct 31, 2022
@manicminer
Copy link
Member

Thanks again for this PR @kschu91. We've chatted internally and we should be able to backport this to v1.3 so this will hopefully make it out in the next patch release.

@manicminer manicminer merged commit ff68c8d into hashicorp:main Oct 31, 2022
@github-actions
Copy link

Reminder for the merging maintainer: if this is a user-visible change, please update the changelog on the appropriate release branch.

@kabal2010
Copy link

kabal2010 commented Oct 31, 2022

@manicminer
This is wonderful news and thanks to everyone that made this possible ASAP.

@adamrushuk
Copy link

Thanks again for this PR @kschu91. We've chatted internally and we should be able to backport this to v1.3 so this will hopefully make it out in the next patch release.

Amazing news, thanks to all involved for the hard work!👍🏼

manicminer added a commit that referenced this pull request Oct 31, 2022
@kabal2010
Copy link

I can see this has now been released in 1.3.4. Thanks for everyone that made it possible once again

@adamrushuk
Copy link

Thought I'd share a blog post with example code of this working: https://adamrushuk.github.io/configure-terraform-openid-connect-oidc-authentication-from-gitlab-ci-to-azure/

@github-actions
Copy link

github-actions bot commented Dec 9, 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 contributions.
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 Dec 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
1.3-backport If you add this label to a PR before merging, backport-assistant will open a new PR once merged enhancement provider/azurerm
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support generic OIDC authentication for AzureRM backend
8 participants