For the complete documentation index, see llms.txt. This page is also available as Markdown.

AWS OIDC Role and Connector with OpenTofu

How to create an AWS role that leverage OIDC for authentication from Harness

AWS OIDC Role and Connector

Leveraging an OpenID Connect (OIDC) identity provider in AWS IAM let's you enable authentication to AWS from the Harness platform without having to store access keys or run a Delegate with inherited permissions.

By leveraging OpenTofu we can create the AWS and Harness components necessary to configure this authentication scheme and easily deploy it to multiple AWS Account or Harness scopes.

Provider Configuration

Refer to the AWS and Harness provider documentation for configuration details.

terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 5.0"
    }
    harness = {
      source = "harness/harness"
      version = "~> 0.37"
    }
  }
}

Data Sources

We can pull in the AWS and Harness context needed using data resources from the relivant providers:

Identity Provider

Next we create an OpenId Connector provider in your account for the Harness SaaS.

IAM Role

Then we create a role that trusts our provider, and has some level of access.

Harness Connector

Finally we create a Harness AWS connector that leverages the role we have created.

Last updated

Was this helpful?