- Terraform Cloud and Enterprise
- Bitbucket Datacenter and Server
- Terminal with access to openssl and ssh-keygen commands
- Generate your own consumer and PEM key pair to setup your VCS provider connection to Bitbucket Datacenter and Server. This applies to Step 1 item 5 of the official documentation
- Toggle Use Custom Keys, it will display three empty fields for: Consumer key, Public key and Private key
- Open your terminal and generate your consumer key and paste it in TFC/TFE
❯ openssl rand -base64 32|pbcopy
- Generate your custom SSH key first (adjust your path and key name appropriately). Only hit enter when prompted for a passphrase.
❯ ssh-keygen -t rsa -m PEM -f "/Users/jsorondo/.ssh/custom_terraform" -C "custom_terraform_enterprise"
Generating public/private rsa key pair.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /Users/jsorondo/.ssh/custom_terraform
Your public key has been saved in /Users/jsorondo/.ssh/custom_terraform.pub
The key fingerprint is:
The key's randomart image is:
| .. |
| + .. |
|.+ =.. |
|O = +o |
| Xo...o=S |
|+*o.. o+. |
|=o++.. o+. |
|.o.+=oo .o. |
- Using openssl retrieve the public key in PEM format, copy to your clipbload and paste it in the Public key field.
❯ openssl rsa -in ~/.ssh/custom_terraform -outform PEM -pubout -out ~/.ssh/pubkey.pem
writing RSA key
❯ cat ~/.ssh/pubkey.pem|pbcopy
- Copy the private key to your clipboard and paste it in the Private key field
- Continue from Step 2 of the official documentation to complete the setup