<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Tabasum Khan</title>
    <description>The latest articles on Forem by Tabasum Khan (@tashu068).</description>
    <link>https://forem.com/tashu068</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1000477%2Fd59cd746-ae20-4c27-bf4a-ee89d8e96ee2.jpeg</url>
      <title>Forem: Tabasum Khan</title>
      <link>https://forem.com/tashu068</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/tashu068"/>
    <language>en</language>
    <item>
      <title>AWS, Vault Integration</title>
      <dc:creator>Tabasum Khan</dc:creator>
      <pubDate>Mon, 05 Jan 2026 10:39:25 +0000</pubDate>
      <link>https://forem.com/tashu068/aws-vault-integration-43d6</link>
      <guid>https://forem.com/tashu068/aws-vault-integration-43d6</guid>
      <description>&lt;p&gt;Managing secrets securely in cloud pipelines is a common challenge for DevOps teams. &lt;/p&gt;

&lt;p&gt;Recently, I worked on automating AWS resource provisioning with Terraform while fetching sensitive data from Vault via GitHub Actions. Along the way, I ran into some interesting pitfalls that are worth sharing for anyone building similar pipelines.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;AWS Credential Management&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Our workflows involved multiple AWS accounts. The pipeline used the aws-actions / configure-aws-credentials action to assume IAM roles for different accounts. &lt;br&gt;
A few best practices emerged:&lt;br&gt;
Use IAM roles instead of static keys wherever possible.&lt;br&gt;
Always reset AWS environment variables after assuming a role to avoid credential leakage across jobs.&lt;br&gt;
Validate access early with aws sts get-caller-identity to catch misconfigurations.&lt;br&gt;
This ensures Terraform operations like plan and apply run in the correct AWS context without accidentally using wrong credentials.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Vault Integration with GitHub Actions&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;We used Vault to manage sensitive secrets like API keys and database credentials. GitHub Actions provides OIDC tokens automatically, which Terraform Vault provider can use directly for authentication.&lt;/p&gt;

&lt;p&gt;Lessons learned:&lt;/p&gt;

&lt;p&gt;Avoid manual JWT fetching: Terraform can automatically fetch OIDC tokens via ACTIONS_ID_TOKEN_REQUEST_TOKEN and ACTIONS_ID_TOKEN_REQUEST_URL.&lt;br&gt;
Match Vault auth methods to CI/CD provider: For GitHub Actions, use auth/github-jwt instead of gitlab-jwt. Using the wrong method causes JWT validation errors.&lt;br&gt;
Network access matters: Even with correct credentials, the pipeline fails if the runner cannot resolve the Vault host. Ensure your GitHub Actions runner has network/DNS access to Vault endpoints.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Terraform Workflow Tips&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;When working with AWS + Vault + GitHub Actions, a few workflow adjustments make life easier:&lt;br&gt;
Use backend configs for state in S3 rather than hard coding credentials in Terraform.&lt;br&gt;
Separate jobs for validation and plan: This makes debugging easier when multiple AWS accounts and Vault secrets are involved.&lt;br&gt;
Skip Vault temporarily for validation: Useful when testing network or AWS configurations before the Vault integration is ready.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Common Pitfalls&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Some errors we ran into:&lt;br&gt;
dial tcp: lookup review.vault.internal… no such host → Runner couldn’t reach internal Vault host.&lt;br&gt;
error validating token: error verifying token signature… 404 Not Found → Vault auth method mismatched the CI/CD provider.&lt;br&gt;
Both issues are easy to overlook but critical for a smooth pipeline.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Key Takeaways&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Network first, credentials second: Ensure CI/CD runners can reach secret management endpoints.&lt;br&gt;
Use built-in OIDC wherever possible: Reduces manual token handling and failure points.&lt;br&gt;
Verify AWS role assumptions early: Misconfigured roles can silently cause Terraform to operate in the wrong account.&lt;br&gt;
Keep workflows modular: Separate validation, planning, and secret fetching to isolate issues quickly.&lt;br&gt;
Integrating AWS, Terraform, and Vault in CI/CD pipelines can be tricky, but following these practices makes it predictable, secure, and maintainable.&lt;/p&gt;

&lt;h1&gt;
  
  
  AWS #Terraform #Vault #GitHubActions #DevOps #CI_CD #SecretsManagement #OIDC #InfrastructureAsCode
&lt;/h1&gt;

</description>
      <category>aws</category>
      <category>vault</category>
    </item>
  </channel>
</rss>
