mirror of
https://github.com/nmasur/dotfiles
synced 2024-11-25 13:45:37 +00:00
fix: tf backend can't be a variable
This commit is contained in:
parent
5bd81813cb
commit
9ebdfa1071
7
.github/workflows/arrow-aws.yml
vendored
7
.github/workflows/arrow-aws.yml
vendored
@ -91,15 +91,16 @@ jobs:
|
|||||||
# Connects to remote state backend and download providers.
|
# Connects to remote state backend and download providers.
|
||||||
- name: Terraform Init
|
- name: Terraform Init
|
||||||
working-directory: ${{ env.TERRAFORM_DIRECTORY }}
|
working-directory: ${{ env.TERRAFORM_DIRECTORY }}
|
||||||
run: terraform init
|
run: |
|
||||||
|
terraform init \
|
||||||
|
-backend-config="bucket=${{ secrets.TERRAFORM_STATE_BUCKET }}" \
|
||||||
|
-backend-config="key=arrow.tfstate"
|
||||||
|
|
||||||
# Deploys infrastructure or changes to infrastructure.
|
# Deploys infrastructure or changes to infrastructure.
|
||||||
- name: Terraform Apply
|
- name: Terraform Apply
|
||||||
if: inputs.action == 'create'
|
if: inputs.action == 'create'
|
||||||
working-directory: ${{ env.TERRAFORM_DIRECTORY }}
|
working-directory: ${{ env.TERRAFORM_DIRECTORY }}
|
||||||
env:
|
env:
|
||||||
TF_VAR_terraform_state_bucket: ${{ secrets.TERRAFORM_STATE_BUCKET }}
|
|
||||||
TF_VAR_terraform_state_key: arrow.tfstate
|
|
||||||
TF_VAR_ec2_size: ${{ inputs.size }}
|
TF_VAR_ec2_size: ${{ inputs.size }}
|
||||||
run: |
|
run: |
|
||||||
terraform apply \
|
terraform apply \
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
terraform {
|
terraform {
|
||||||
backend "s3" {
|
backend "s3" {
|
||||||
bucket = var.terraform_state_bucket
|
|
||||||
key = var.terraform_state_key
|
|
||||||
region = "us-east-1"
|
region = "us-east-1"
|
||||||
dynamodb_table = "terraform-state-lock"
|
dynamodb_table = "terraform-state-lock"
|
||||||
}
|
}
|
||||||
|
@ -8,13 +8,3 @@ variable "images_bucket" {
|
|||||||
description = "Name of the bucket in which to store the NixOS VM images."
|
description = "Name of the bucket in which to store the NixOS VM images."
|
||||||
type = string
|
type = string
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "terraform_state_bucket" {
|
|
||||||
description = "Name of the bucket in which to store the Terraform state information."
|
|
||||||
type = string
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "terraform_state_key" {
|
|
||||||
description = "Path of the file in which to store the Terraform state information."
|
|
||||||
type = string
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user