microsoft / azure-pipelines-terraform

Azure Pipelines tasks for installing Terraform and running Terraform commands in a build or release pipeline.
MIT License
101 stars 62 forks source link

Feature: Support workload identity federation #164

Closed jaredfholgate closed 1 year ago

jaredfholgate commented 1 year ago

This PR is to add support for Workload Identity Federation (OIDC) in the Terraform Task.

The intention is that this will be a non-breaking change, it will simply identify the authentication scheme and setup the provider accordingly.

Testing Evidence:

In order to run this test, the following steps were followed:

  1. Compiled and packaged the extension as per the steps HERE.
  2. Removed the public extension from the organisation.
  3. Published the extension to the market place, shared it to the organisation and installed it in the organisation.
  4. Deployed the Service Connection, Managed Identity, etc using this example code: https://github.com/Azure-Samples/azure-devops-terraform-oidc-ci-cd
  5. Updated the oidc.yml pipeline to include the Terraform task steps (see below).
  6. Ran the pipeline.

Pipeline Code

image

Test Extension

image

Service Connection

image

Terraform Init

image

Terraform Apply

image

jaredfholgate commented 1 year ago

@mericstam Just as a heads up on what has been done in this PR:

In terms of what needs to happen next:

jaredfholgate commented 1 year ago

Closing this PR in favour of https://github.com/microsoft/azure-pipelines-terraform/pull/176 which uses a local branch instead of a Fork.

jaredfholgate commented 1 year ago

Closing this PR in favour of https://github.com/microsoft/azure-pipelines-terraform/pull/176 which uses a local branch instead of a Fork.