Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kolosovpetro/terraform-gameplay
Gameplay with terraform
https://github.com/kolosovpetro/terraform-gameplay
infrastructure-as-code terraform
Last synced: 19 days ago
JSON representation
Gameplay with terraform
- Host: GitHub
- URL: https://github.com/kolosovpetro/terraform-gameplay
- Owner: kolosovpetro
- License: gpl-3.0
- Created: 2022-10-12T16:05:12.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-12-15T15:14:17.000Z (about 2 years ago)
- Last Synced: 2024-11-15T17:44:33.284Z (3 months ago)
- Topics: infrastructure-as-code, terraform
- Language: HCL
- Homepage:
- Size: 40 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Terraform-Gameplay
- Install terraform
- `choco install terraform`- Update infrastructure
- `terraform init`
- `terraform plan -out main.tfplan`
- `terraform apply main.tfplan`
- Set env variables
- `$TF_VAR_postgres_admin_username = "razumovsky_r"`
- `$TF_VAR_postgres_admin_password = "4YJ544gB4VjiruhBs8fT"`# Infrastructure
## Define variables
- `$RESOURCE_GROUP_NAME="pkolosov-tstate-rg"`
- `$STORAGE_ACCOUNT_NAME="pkolosovfstate673"`
- `$CONTAINER_NAME="pkolosovtfstate"`## Create resource group
- `az group create --name $RESOURCE_GROUP_NAME --location "westus"`
## Create storage account
- `az storage account create --resource-group $RESOURCE_GROUP_NAME --name $STORAGE_ACCOUNT_NAME --sku "Standard_LRS" --encryption-services blob`
## Get storage account key
- `$ACCOUNT_KEY=$(az storage account keys list --resource-group $RESOURCE_GROUP_NAME --account-name $STORAGE_ACCOUNT_NAME --query [0].value -o tsv)`
## Create blob container
- `az storage container create --name $CONTAINER_NAME --account-name $STORAGE_ACCOUNT_NAME --account-key $ACCOUNT_KEY`
- `echo "storage_account_name: $STORAGE_ACCOUNT_NAME"`
- `echo "container_name: $CONTAINER_NAME"`
- `echo "access_key: $ACCOUNT_KEY"`## Create Service Principal
- `az ad sp create-for-rbac --role="Contributor" --scopes="/subscriptions/f32f6566-8fa0-4198-9c91-a3b8ac69e89a" --name="GithubActions-Terraform"`