terraform icon indicating copy to clipboard operation
terraform copied to clipboard

backend/azurerm: add support for generic OIDC authentication

Open kschu91 opened this issue 3 years ago • 8 comments
trafficstars

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: https://github.com/hashicorp/terraform-provider-azurerm/issues/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 avatar Oct 07 '22 15:10 kschu91

CLA assistant check
All committers have signed the CLA.

hashicorp-cla avatar Oct 07 '22 15:10 hashicorp-cla

Related to #31802

mfortin avatar Oct 07 '22 16:10 mfortin

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

crw avatar Oct 07 '22 19:10 crw

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?

kabal2010 avatar Oct 18 '22 11:10 kabal2010

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

manicminer avatar Oct 18 '22 12:10 manicminer

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

kabal2010 avatar Oct 18 '22 12:10 kabal2010

@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!

crw avatar Oct 19 '22 00:10 crw

@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.

kabal2010 avatar Oct 19 '22 06:10 kabal2010

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 avatar Oct 31 '22 11:10 manicminer

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

github-actions[bot] avatar Oct 31 '22 11:10 github-actions[bot]

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

kabal2010 avatar Oct 31 '22 11:10 kabal2010

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!👍🏼

adamrushuk avatar Oct 31 '22 11:10 adamrushuk

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

kabal2010 avatar Nov 03 '22 06:11 kabal2010

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/

adamrushuk avatar Nov 08 '22 08:11 adamrushuk

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[bot] avatar Dec 09 '22 02:12 github-actions[bot]