-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
93 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
import { | ||
source = "./imports/*.tm.hcl" | ||
} | ||
|
||
import { | ||
source = "./workflows/*.tm.hcl" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
script "init" { | ||
name = "Terraform Init" | ||
description = "Download the required provider plugins and modules and set up the backend" | ||
|
||
job { | ||
commands = [ | ||
["terraform", "init", "-lock-timeout=5m"], | ||
] | ||
} | ||
} | ||
|
||
script "preview" { | ||
name = "Terraform Deployment Preview" | ||
description = "Create a preview of Terraform changes and synchronize it to Terramate Cloud" | ||
|
||
job { | ||
commands = [ | ||
["terraform", "validate"], | ||
["terraform", "plan", "-out", "out.tfplan", "-detailed-exitcode", "-lock=false", { | ||
sync_preview = true | ||
terraform_plan_file = "out.tfplan" | ||
}], | ||
] | ||
} | ||
} | ||
|
||
script "terraform" "render" { | ||
name = "Terraform Show Plan" | ||
description = "Render a Terraform plan" | ||
|
||
job { | ||
commands = [ | ||
["echo", "Stack: `${terramate.stack.path.absolute}`"], | ||
["echo", "```terraform"], | ||
["terraform", "show", "-no-color", "out.tfplan"], | ||
["echo", "```"], | ||
] | ||
} | ||
} | ||
|
||
script "deploy" { | ||
name = "Terraform Deployment" | ||
description = "Run a full Terraform deployment cycle and synchronize the result to Terramate Cloud" | ||
|
||
job { | ||
commands = [ | ||
["terraform", "validate"], | ||
["terraform", "plan", "-out", "out.tfplan", "-lock=false"], | ||
["terraform", "apply", "-input=false", "-auto-approve", "-lock-timeout=5m", "out.tfplan", { | ||
sync_deployment = true | ||
terraform_plan_file = "out.tfplan" | ||
}], | ||
] | ||
} | ||
} | ||
|
||
script "drift" "detect" { | ||
name = "Terraform Drift Check" | ||
description = "Detect drifts in Terraform configuration and synchronize it to Terramate Cloud" | ||
|
||
job { | ||
commands = [ | ||
["terraform", "plan", "-out", "out.tfplan", "-detailed-exitcode", "-lock=false", { | ||
sync_drift_status = true | ||
terraform_plan_file = "out.tfplan" | ||
}], | ||
] | ||
} | ||
} | ||
|
||
script "drift" "reconcile" { | ||
name = "Terraform Drift Reconciliation" | ||
description = "Reconcile drifts in all changed stacks" | ||
|
||
job { | ||
commands = [ | ||
["terraform", "apply", "-input=false", "-auto-approve", "-lock-timeout=5m", "drift.tfplan", { | ||
sync_deployment = true | ||
terraform_plan_file = "drift.tfplan" | ||
}], | ||
] | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.