Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add support for using explicit AWS credentials #433

Merged
merged 1 commit into from
Aug 2, 2024

Conversation

bodgit
Copy link
Contributor

@bodgit bodgit commented Jul 23, 2024

This PR adds support for explicitly configuring the AWS credentials rather than relying on the implicit environment variables.

We run Terraform using Spacelift which a) is configured in our Vault as an OIDC/JWT provider so automatically generates short-lived AWS credentials and b) makes it difficult to inject the AWS environment variables without using long-lived credentials which we'd rather not do.

For example we can now do something like this:

provider "vault" {
  auth_login_jwt {
    role = "jwt-role-name"
  }
}

data "vault_aws_access_credentials" "creds" {
  backend = "aws"
  type    = "sts"
  role    = "sts-role-name"
}

provider "kafka" {
  bootstrap_servers   = ["localhost:9098"]
  tls_enabled         = true
  sasl_mechanism      = "aws-iam"
  sasl_aws_region     = "us-east-1"
  sasl_aws_access_key = data.vault_aws_access_credentials.creds.access_key
  sasl_aws_secret_key = data.vault_aws_access_credentials.creds.secret_key
  sasl_aws_token      = data.vault_aws_access_credentials.creds.security_token
}

@bodgit
Copy link
Contributor Author

bodgit commented Jul 29, 2024

@Mongey ping, WDYT?

@Mongey
Copy link
Owner

Mongey commented Aug 2, 2024

@bodgit looks good, thanks

@Mongey Mongey merged commit 6f52a92 into Mongey:main Aug 2, 2024
2 of 4 checks passed
@bodgit bodgit deleted the explicit-credentials branch August 2, 2024 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants