Getting Started
Install Terraform
Depending on the operating system, terraform can be installed in different ways. Please follow Hashicorp's installation documentation for in-depth installation for all OS. Once Terraform has been installed, Terraform will need to access the cloud provider's credential create, modify, and destroy resources within the account.
Setup Terraform Environment
During this setup process, the cloud provider CLI will need to be installed in order to gain access safely to your account. This guide will provide instruction on how to setup SSO to each cloud provider so Terraform has access to the account without exporting an sensitive information hard coded within the environment.
AWS
After install AWS CLI, enter the command terminal and input aws configure sso --profile PROFILE_NAME
that will ask the following prompts:
1. SSO start URL (https://aggie-innovation-platform.awsapps.com/start#/)
2. SSO Region (us-east-2)
3. Redirect to a SSO Authorization page to allow access
4. Select an available account
5. Select an IAM role
After successfully configuring the SSO, it will created a configure file in the directory ~/.aws.config
[profile PROFILE_NAME]
sso_start_url = https://aggie-innovation-platform.awsapps.com/start#/
sso_region = us-east-2
sso_account_id = # INPUT SSO ACCOUNT ID HERE
sso_role_name = AdministratorAccess
region = us-east-1
output = json
Azure
After installing Azure CLI, enter the following command in the terminal az login
. This will grant access to the account locally in the environment for Terraform. Once you have logged in, it will output information about the account that was logged on:
[
{
"cloudName": "AzureCloud",
"homeTenantId": "0envbwi39-home-Tenant-Id",
"id": "35akss-subscription-id",
"isDefault": true,
"managedByTenants": [],
"name": "Subscription-Name",
"state": "Enabled",
"tenantId": "0envbwi39-TenantId",
"user": {
"name": "your-username@domain.com",
"type": "user"
}
}
]
Find the id
or the subscription id and enter az account set --subscription "35akss-subscription-id"
to set the account with Azure CLI. This will complete the setup to grant account access to Terraform.