Skip to content

Commit

Permalink
Add terraform scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
katyabilokur committed Aug 19, 2024
1 parent fc56c67 commit 0bacc2c
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/infrastructure.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: infrastructure

on: push

env:
GOOGLE_BACKEND_CREDENTIALS: ${{ secrets.GOOGLE_BACKEND_CREDENTIALS }}

defaults:
run:
working-directory: ./terraform

jobs:
test-job:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: hashicorp/setup-terraform@v3
with:
terraform_version: "1.9.2"
- name: Terraform Init
run: terraform init
- name: Terraform Validate
run: terraform validate -no-color
- name: Terraform Plan
run: terraform plan -no-color
continue-on-error: false
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,13 @@ yarn-error.log*
# typescript
*.tsbuildinfo
next-env.d.ts

# Local .terraform directories
**/.terraform/*

# .tfstate files
*.tfstate
*.tfstate.*

.envrc
.terraform.lock.hcl
Empty file removed terraform/.pin
Empty file.
6 changes: 6 additions & 0 deletions terraform/backend.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
terraform {
backend "gcs" {
bucket = "katyabilokur-terraform-state"
prefix = "tfstate/nextjs-vercel-supabase-boilerplate"
}
}
5 changes: 5 additions & 0 deletions terraform/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
resource "null_resource" "default" {
provisioner "local-exec" {
command = "echo 'Hello World'"
}
}
File renamed without changes.
18 changes: 18 additions & 0 deletions terraform/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
terraform {
required_version = "1.9.2"

required_providers {
# google = {
# source = "hashicorp/google"
# version = "5.38.0"
# }
# google-beta = {
# source = "hashicorp/google-beta"
# version = "5.38.0"
# }
random = {
source = "hashicorp/random"
version = "3.6.2"
}
}
}

0 comments on commit 0bacc2c

Please sign in to comment.