Skip to content

Question: How to Use Private Key in Semaphore Terraform Without Storing It in Git? #2808

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

Open
kovalroma opened this issue Mar 18, 2025 · 2 comments
Labels

Comments

@kovalroma
Copy link

kovalroma commented Mar 18, 2025

Question

Hi everyone,

I'm integrating my Terraform script with Semaphore (Docker). My Terraform code provisions a VM in Oracle Cloud, and according to the documentation, I need to pass the private key path.

However, I don't want to store my private key in the Git repository. Since Terraform requires a path to the key, I’m unsure how to securely pass it in Semaphore.

Does anyone have a workaround for this?

Here is an example from my *.tfvars file

private_key_path    = "access_key.pem"

Thanks in advance!

@ramorous
Copy link

I've accomplished this by using our cloud secret/password server's API to pull the secrets I need per project including the ssh key for our local VCS. I first stored the username/password and used external to retrieve a token, then curl with said token to fetch all the secrets I need dynamically.

@kovalroma
Copy link
Author

Ok, I mount host folder to the container with key. And then use it. Not sure is it correct solution but it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants
@ramorous @kovalroma and others