Skip to content

Commit ae26b0f

Browse files
authored
Add remote backend for terraform (#212)
1 parent cfb23ee commit ae26b0f

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

terraform/main.tf

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
1+
terraform {
2+
backend "s3" {
3+
bucket = "cadet-terraform-state"
4+
key = "cadet-frontend.tfstate"
5+
region = "ap-southeast-1"
6+
encrypt = "true"
7+
acl = "private"
8+
}
9+
}
10+
111
variable "bucket_name" {
212
default = "stg-cadet-frontend"
313
}
4-
variable "credentials-profile" {}
514

615
provider "aws" {
716
region = "ap-southeast-1"
8-
profile = "${var.credentials-profile}"
917
}
1018

1119
resource "aws_s3_bucket" "stg-site" {
@@ -33,6 +41,6 @@ resource "aws_s3_bucket" "stg-site" {
3341
}
3442
EOF
3543
provisioner "local-exec" {
36-
command = "yarn build && ./sync-build.sh ${var.credentials-profile}"
44+
command = "yarn build && ./sync-build.sh"
3745
}
3846
}

0 commit comments

Comments
 (0)