Skip to content

Commit

Permalink
fix: enhance terraform
Browse files Browse the repository at this point in the history
  • Loading branch information
woowahan-neo committed Jan 8, 2025
1 parent 95d8c1b commit 9b32967
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 32 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/terraform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,8 @@ jobs:
with:
terraform_version: 1.5.3

- name: Select workspace
run: |
ENVIRONMENT=${{ github.event.inputs.environment }}
terraform workspace select "$ENVIRONMENT" || terraform workspace new "$ENVIRONMENT"
- name: Terraform Init and Apply
working-directory: terraform/environments/${{ github.event.inputs.environment }}
run: |
terraform init
terraform plan -out=tfplan
Expand Down
9 changes: 0 additions & 9 deletions terraform/backend.tf

This file was deleted.

28 changes: 28 additions & 0 deletions terraform/environments/dev/main.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "5.54.1"
}
}

cloud {
organization = "cholog"

workspaces {
name = "cholog-dev"
}
}
}

provider "aws" {
region = var.region

/** Note: access_key와 secret_key는 환경변수를 통해 설정하면 된다.
export AWS_ACCESS_KEY_ID="your-access-key"
export AWS_SECRET_ACCESS_KEY="your-secret-key"
*/
}

module "tags" {
source = "../../modules/tags"

Expand Down Expand Up @@ -83,3 +109,5 @@ module "database" {
server_tags = module.tags.server_tags
database_tags = module.tags.database_tags
}


17 changes: 0 additions & 17 deletions terraform/provider.tf

This file was deleted.

1 change: 0 additions & 1 deletion terraform/variables.tf

This file was deleted.

0 comments on commit 9b32967

Please sign in to comment.