# Configuring Terraform IaC pipelines to provision cloud resources in Cloud and Kubernetes...

DevFeed: [Configuring Terraform IaC pipelines to provision cloud resources in Cloud and Kubernetes...](<https://devfeed.tech/articles/configuring-terraform-iac-pipelines-to-provision-cloud-resources-in-cloud-and-kubernetes-90782.md>)

Original publisher: [Read original article](<https://blog.devops.dev/configuring-terraform-iac-pipelines-to-provision-cloud-resources-in-cloud-and-kubernetes-3ff863fe983e?source=rss----33f8b2d9a328---4>)

Author: Oleh Adam Dubnytskyy

Published: 2026-10-20T13:25:47Z

Content type: tutorial

Language: en

Sources: [DevOps.dev](<https://devfeed.tech/sources/devops-dev.md>)

Topics: [Terraform](<https://devfeed.tech/topics/terraform.md>), [CI/CD](<https://devfeed.tech/topics/cicd.md>), [AWS IAM](<https://devfeed.tech/topics/aws-iam.md>), [Amazon Web Services](<https://devfeed.tech/topics/aws.md>), [AWS Security Token Service](<https://devfeed.tech/topics/aws-security-token-service.md>), [OpenID connect (OIDC)](<https://devfeed.tech/topics/oidc.md>), [CI/CD secrets management](<https://devfeed.tech/topics/ci-cd-secrets-management.md>), [rbac](<https://devfeed.tech/topics/rbac.md>), [Cloud](<https://devfeed.tech/topics/cloud.md>), [Amazon S3](<https://devfeed.tech/topics/amazon-s3.md>)

Tags: [actions](<https://devfeed.tech/tags/actions.md>), [amazon](<https://devfeed.tech/tags/amazon.md>), [amazon-eks](<https://devfeed.tech/tags/amazon-eks.md>), [amazon-web-services](<https://devfeed.tech/tags/amazon-web-services.md>), [amazon-web-services-aws](<https://devfeed.tech/tags/amazon-web-services-aws.md>), [aws](<https://devfeed.tech/tags/aws.md>), [aws-iam](<https://devfeed.tech/tags/aws-iam.md>), [aws-sts](<https://devfeed.tech/tags/aws-sts.md>), [ci](<https://devfeed.tech/tags/ci.md>), [ci-cd](<https://devfeed.tech/tags/ci-cd.md>), [cloud](<https://devfeed.tech/tags/cloud.md>), [credentials](<https://devfeed.tech/tags/credentials.md>), [eks](<https://devfeed.tech/tags/eks.md>), [environments](<https://devfeed.tech/tags/environments.md>), [github](<https://devfeed.tech/tags/github.md>), [iac](<https://devfeed.tech/tags/iac.md>), [kubernetes](<https://devfeed.tech/tags/kubernetes.md>), [oidc](<https://devfeed.tech/tags/oidc.md>), [pipelines](<https://devfeed.tech/tags/pipelines.md>), [resources](<https://devfeed.tech/tags/resources.md>), [terraform](<https://devfeed.tech/tags/terraform.md>)

## AI overview

The example uses GitHub Actions OIDC federation to obtain temporary AWS credentials for Terraform without storing long-lived AWS keys in GitHub. It provisions an IAM OIDC provider and a role whose trust policy restricts the audience and accepted repository refs, then grants that role AWS permissions for services including EKS, S3, DynamoDB, KMS, IAM, and Secrets Manager. For Kubernetes access, it creates an EKS access entry and shows associating cluster administrator access, with AmazonEKSAdminPolicy or namespace-scoped access as narrower alternatives. The workflow runs Terraform formatting, validation, linting, and planning on pull requests, then applies after merge to main. The author calls this a starting point and recommends separate plan/apply roles, an approval gate, isolated self-hosted runners, and least-privilege Kubernetes access; a GitOps setup with ArgoCD or FluxCD can remove the pipeline's need for cluster access.

## Source excerpt

Configuring Terraform IaC pipelines to provision cloud resources in Cloud and Kubernetes environments How do you build a GitHub Actions workflow that provisions cloud resources securely, without storing long-lived credentials? In this post I'll walk through my setup: GitHub Actions for CI, AWS (including Amazon EKS) as the cloud platform, and Terraform as the IaC tool. Security Secure interaction between CI and Cloud platform practice can be adapted with Open ID Connect in Amazon Web Services. OpenID Connect (OIDC) allows your GitHub Actions workflows to access resources in Amazon Web Services (AWS), without needing to store the AWS credentials as long-lived GitHub secrets. OIDC federation lets external workloads exchange a token from a trusted identity provider for temporary AWS credentials. Here, GitHub signs a short-lived JWT for each job, AWS STS validates it against the IAM OIDC provider and the role's trust policy, and returns credentials that expire automatically, so no AWS keys are stored in GitHub. AWS docs Follow the principle of least privilege for CI/CD. Think twice before granting broad permissions to IaC pipelines that assume roles via OIDC. Step 1. Provision GitHub OIDC provider to IAM # OIDC resource "aws_iam_openid_connect_provider" "github_actions" { url = "https://token.actions.githubusercontent.com" client_id_list = ["sts.amazonaws.com"] } Step 2. Provision IAM role -- github-actions-iac-pipeline to provision cloud resources in cloud platform. Trusted Entity The trust policy defines which principals can assume the role, and under which conditions. A trust policy is a specific type of resource-based policy for IAM roles. { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "Federated": "arn:aws:iam::aws-account-id:oidc-provider/token.actions.githubusercontent.com" }, "Action": "sts:AssumeRoleWithWebIdentity", "Condition": { "StringEquals": { "token.actions.githubusercontent.com:aud": "sts.amazonaws.com" }, "StringLike": { "