Skip to content

Getting Started

Set Up the Development Environment

Clone the Repo

git clone https://github.com/Sapphire-Health/Terraform-Github-AWS.git

Set Secret Environment Variables

$env:TF_VAR_ad_password = "Loc@lPassw0rd"
$env:TF_VAR_tunnel1_key = "hDxNGZfR1xVV2HNd94x0cNw2fzE8xl51"
$env:TF_VAR_tunnel2_key = "7goOfWE4gjFqiBZlh8v8z4CWs0B3bwuy"

S3 Backend (Local Deployment)

Use the code block below in src/main.tf when using the S3 backend

backend "s3" {}

Set AWS Auth Environment Variables

$env:AWS_ACCESS_KEY_ID = "*"
$env:AWS_SECRET_ACCESS_KEY = "*"
$env:AWS_SESSION_TOKEN = "*"

Terraform Init

terraform -chdir=src init -backend-config=bucket=sapphireterraform -backend-config=key="tfstate/lyas.tfstate" -backend-config=region=us-east-1

Terraform Cloud Backend (Remote Deployment)

Use the code block below in src/main.tf when using the Terraform Cloud backend

cloud {}

Set Terraform Cloud Environment Variables

$env:TF_CLOUD_ORGANIZATION = "SapphireHealth"
$env:TF_CLOUD_PROJECT = "Terraform-Github-AWS"
$env:TF_WORKSPACE = "Terraform-Github-AWS_nonprod"

Terraform Init

terraform -chdir=src init