Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

테라폼 코드 개선 #1637

Merged
merged 2 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

13 changes: 0 additions & 13 deletions terraform/environments/dev/deploy.sh

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.

Loading