Skip to content

Commit

Permalink
action
Browse files Browse the repository at this point in the history
  • Loading branch information
mostafa6765 committed Jun 30, 2024
1 parent 4d96ee2 commit 6da24ad
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/terraform-terragrunt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,12 @@ jobs:
- name: Terragrunt init
run: |
cd ./environment/stage
terragrunt workspace select terragrunt
terragrunt init
echo "🔧 Terragrunt init completed!"
- name: Terragrunt plan
run: |
cd ./environment/stage
terragrunt plan
cd ./environment/stage terragrunt plan
echo "📝 Terragrunt plan completed!"
- name: Display success message
Expand Down
4 changes: 4 additions & 0 deletions terraform/stage/main.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
provider "aws" {
region = "us-east-1"
}

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

Expand Down
11 changes: 9 additions & 2 deletions terragrunt.hcl
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
# Define the Terraform backend configuration to use Terraform Cloud
locals {
organization = "kintaro"
workspace_tags = "terragrunt"
workspace_tags = "kintaro_devops"
}

terraform {
before_hook "workspace" {
commands = ["plan", "state", "apply", "destroy", "init"]
execute = ["terraform", "workspace", "select", "terragrunt"]
}
}

generate "backend" {
Expand All @@ -12,7 +19,7 @@ terraform {
cloud {
organization = "${local.organization}"
workspaces {
name = "${local.workspace_tags}"
tags = ["${local.workspace_tags}"]
}
}
required_providers {
Expand Down

0 comments on commit 6da24ad

Please sign in to comment.