Skip to content

Commit d9d38d6

Browse files
committed
fix: terraform init before validate
1 parent e173a63 commit d9d38d6

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

.github/workflows/deploy.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ jobs:
2525
- name: Check Format
2626
run: terraform fmt -check -diff
2727

28-
- name: Validate
29-
run: terraform validate
30-
3128
- name: Bootstrap
3229
run: ./bootstrap.sh
3330

3431
- name: Init Terraform
3532
run: terraform init -input=false
3633

34+
- name: Validate
35+
run: terraform validate
36+
3737
- name: Deploy Infrastructure
3838
run: terraform apply -input=false -auto-approve
3939

infrastructure/bootstrap.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#/bin/bash
22

3-
if aws s3api head-bucket --bucket "$TF_VAR_state_bucket" 2>/dev/null;
3+
if aws s3api head-bucket --bucket "iplocate-terraform-state" 2>/dev/null;
44
then
55
echo "skiping create state bucket"
66
else
77
echo "creating bucket for terraform state"
8-
aws s3api create-bucket --acl private --bucket "$TF_VAR_state_bucket"
8+
aws s3api create-bucket --acl private --bucket "iplocate-terraform-state"
99
fi

infrastructure/main.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
terraform {
22
backend "s3" {
3-
bucket = var.state_bucket
4-
key = var.state_bucket_key
5-
region = var.aws_region
3+
bucket = "iplocate-terraform-state"
4+
key = "tfstate"
5+
region = "us-east-1"
66
}
77
}
88

0 commit comments

Comments
 (0)