Sign inSign up

cenk1cenk2/pipe-terraform

By cenk1cenk2

•Updated 31 minutes ago

Terraform helper pipe.

Image
0

10K+

cenk1cenk2/pipe-terraform repository overview

⁠pipe-terraform

Terraform actions for pipelines.

pipe-terraform [GLOBAL FLAGS] [COMMAND] [FLAGS]

⁠Global Flags

CLI

Flag / EnvironmentDescriptionTypeDefault
$LOG_LEVELDefine the log level for the application.string
enum("panic", "fatal", "warn", "info", "debug", "trace")
"info"
$ENV_FILEEnvironment files to inject.string[]

⁠Commands

⁠pipe-terraform install

Install terraform project.

pipe-terraform install [FLAGS]

⁠Flags

Config

Flag / EnvironmentDescriptionTypeDefault
$TERRAFORM_LOG_LEVEL
$TF_LOG_LEVEL
$TF_LOG
Terraform log level.string
format(enum("trace", "debug", "info", "warn", "error"))

Injected Variables

Flag / EnvironmentDescriptionTypeDefault
$TERRAFORM_CI_API_URL
$TF_VAR_CI_API_V4_URL
$CI_API_V4_URL
Injected CI api-url variable to the deployment.string
$TERRAFORM_CI_PROJECT_ID
$TF_VAR_CI_PROJECT_ID
$CI_PROJECT_ID
Injected CI project-id variable to the deployment.string

Install

Flag / EnvironmentDescriptionTypeDefault
$TERRAFORM_INSTALL_RECONFIGURE
$TF_INSTALL_RECONFIGURE
Reconfigure flag for terraform init.boolfalse
$TERRAFORM_INSTALL_USE_LOCKFILE
$TF_INSTALL_USE_LOCKFILE
Use lockfile for terraform init.boolfalse
$TERRAFORM_INSTALL_ARGS
$TF_INSTALL_ARGS
Additional arguments for terraform init.string

Login

Flag / EnvironmentDescriptionTypeDefault
$TERRAFORM_LOGINTerraform registries to login to.string
format(yaml([]struct{ uri: string, token: string }))

Project

Flag / EnvironmentDescriptionTypeDefault
$TERRAFORM_CWD
$TF_ROOT
Working directory for terraform commands.string"."

State

Flag / EnvironmentDescriptionTypeDefault
$TERRAFORM_STATE_TYPE
$TF_STATE_TYPE
Terraform state type.string
format(enum("gitlab-http"))
$TERRAFORM_STATE_NAME
$TF_STATE_NAME
Terraform state name.string"default"
$TERRAFORM_STATE_STRICT
$TF_STATE_STRICT
Fail when no Terraform state type is configured.boolfalse
$TERRAFORM_STATE_GITLAB_HTTP_HTTP_ADDRESS
$TF_HTTP_ADDRESS
$TF_ADDRESS
HTTP address for the GitLab HTTP state backend.string
$TERRAFORM_STATE_GITLAB_HTTP_HTTP_LOCK_ADDRESS
$TF_HTTP_LOCK_ADDRESS
HTTP lock address for the GitLab HTTP state backend.string
$TERRAFORM_STATE_GITLAB_HTTP_HTTP_LOCK_METHOD
$TF_HTTP_LOCK_METHOD
HTTP lock method for the GitLab HTTP state backend.string"POST"
$TERRAFORM_STATE_GITLAB_HTTP_HTTP_UNLOCK_ADDRESS
$TF_HTTP_UNLOCK_ADDRESS
HTTP unlock address for the GitLab HTTP state backend.string
$TERRAFORM_STATE_GITLAB_HTTP_HTTP_UNLOCK_METHOD
$TF_HTTP_UNLOCK_METHOD
HTTP unlock method for the GitLab HTTP state backend.string"DELETE"
$TERRAFORM_STATE_GITLAB_HTTP_HTTP_USERNAME
$TF_HTTP_USERNAME
$TF_USERNAME
HTTP username for the GitLab HTTP state backend.string"gitlab-ci-token"
$TERRAFORM_STATE_GITLAB_HTTP_HTTP_PASSWORD
$TF_HTTP_PASSWORD
$TF_PASSWORD
$CI_JOB_TOKEN
HTTP password for the GitLab HTTP state backend.string
$TERRAFORM_STATE_GITLAB_HTTP_HTTP_RETRY_WAIT_MIN
$TF_HTTP_RETRY_WAIT_MIN
Minimum time to wait between HTTP retries for the GitLab HTTP state backend, in seconds.string"5"
⁠pipe-terraform lint

Lint terraform project with terraform.

pipe-terraform lint [FLAGS]

⁠Flags
Config
Flag / EnvironmentDescriptionTypeDefault
$TERRAFORM_LOG_LEVEL
$TF_LOG_LEVEL
$TF_LOG
Terraform log level.string
format(enum("trace", "debug", "info", "warn", "error"))
Injected Variables
Flag / EnvironmentDescriptionTypeDefault
$TERRAFORM_CI_API_URL
$TF_VAR_CI_API_V4_URL
$CI_API_V4_URL
Injected CI api-url variable to the deployment.string
$TERRAFORM_CI_PROJECT_ID
$TF_VAR_CI_PROJECT_ID
$CI_PROJECT_ID
Injected CI project-id variable to the deployment.string

Lint

Flag / EnvironmentDescriptionTypeDefault
$TERRAFORM_LINT_FORMAT_CHECK_ENABLE
$TF_LINT_FMT_CHECK_ENABLE
Enable terraform fmt.booltrue
$TERRAFORM_LINT_FORMAT_CHECK_ARGS
$TF_LINT_FMT_CHECK_ARGS
Additional arguments for terraform fmt.string
$TERRAFORM_LINT_VALIDATE_ENABLE
$TF_LINT_VALIDATE_ENABLE
Enable terraform validate.booltrue
$TERRAFORM_LINT_VALIDATE_ARGS
$TF_LINT_VALIDATE_ARGS
Additional arguments for terraform validate.string
Project
Flag / EnvironmentDescriptionTypeDefault
$TERRAFORM_CWD
$TF_ROOT
Working directory for terraform commands.string"."
⁠pipe-terraform plan

Plan terraform project.

pipe-terraform plan [FLAGS]

⁠Flags
Config
Flag / EnvironmentDescriptionTypeDefault
$TERRAFORM_LOG_LEVEL
$TF_LOG_LEVEL
$TF_LOG
Terraform log level.string
format(enum("trace", "debug", "info", "warn", "error"))

GitLab Merge Request Report

Flag / EnvironmentDescriptionTypeDefault
$GITLAB_MR_REPORT_ENABLEDEnable GitLab merge request report note on the given merge request.boolfalse
$GL_PIPES_TOKENGitLab API token for merge request report notes.string
$CI_API_V4_URLGitLab API URL for merge request report notes.string
$CI_PROJECT_IDGitLab project id for merge request report notes.string
$CI_MERGE_REQUEST_IIDGitLab merge request iid for merge request report notes.int0
$GITLAB_MR_REPORT_IDENTIFIERHidden marker identifier for merge request report notes. Defaults to the job name combined with the stack or state under report.string
$CI_COMMIT_BRANCHBranch of the pipeline, whose merge requests merged into the commit are reported on when it is the default branch.string
$CI_DEFAULT_BRANCHDefault branch of the project, the only branch whose pipelines report on the merge requests merged into the commit.string
$GITLAB_MR_REPORT_DEPLOY_JOBName of the job in the pipeline that applies the plan, which the plan report on the merge requests merged into the commit links to run. Links the pipeline when empty or not found.string
$GITLAB_MR_REPORT_PLAN_JOBName of the job in the pipeline that planned what is applied, which the deploy report on the merge requests merged into the commit links to. Links the pipeline when empty or not found.string

GitLab Pipeline

Flag / EnvironmentDescriptionTypeDefault
$CI_JOB_NAMEGitLab CI job name to include in the plan report metadata.string
$CI_JOB_URLGitLab CI job URL to include in the plan report metadata.string
$CI_PIPELINE_IDGitLab CI pipeline id to include in the plan report metadata.string
$CI_PIPELINE_URLGitLab CI pipeline URL to include in the plan report metadata.string
$CI_COMMIT_SHAGit commit sha to include in the plan report metadata.string
$CI_COMMIT_SHORT_SHAShort git commit sha to include in the plan report metadata.string
Injected Variables
Flag / EnvironmentDescriptionTypeDefault
$TERRAFORM_CI_API_URL
$TF_VAR_CI_API_V4_URL
$CI_API_V4_URL
Injected CI api-url variable to the deployment.string
$TERRAFORM_CI_PROJECT_ID
$TF_VAR_CI_PROJECT_ID
$CI_PROJECT_ID
Injected CI project-id variable to the deployment.string
Login
Flag / EnvironmentDescriptionTypeDefault
$TERRAFORM_LOGINTerraform registries to login to.string
format(yaml([]struct{ uri: string, token: string }))

Plan

Flag / EnvironmentDescriptionTypeDefault
$TERRAFORM_PLAN_OUTPUT
$TF_PLAN_CACHE
$TF_APPLY_OUTPUT
$TF_PLAN_OUTPUT
Output file for terraform plan.string"plan"
$TERRAFORM_PLAN_ARGS
$TF_PLAN_ARGS
Additional arguments for terraform plan.string
$TERRAFORM_PLAN_PREVIEW_FOR_MERGE_REQUESTS
$TF_PLAN_PREVIEW_FOR_MRS
Run merge request terraform plans as previews without state locking.booltrue
$TERRAFORM_PLAN_PIPELINE_SOURCE
$CI_PIPELINE_SOURCE
GitLab CI pipeline source used to detect merge request pipelines.string
$TERRAFORM_PLAN_SUMMARY_OUTPUT
$TERRAFORM_SUMMARY_OUTPUT
Output file for terraform plan summary. Leave empty to skip summary generation.string"terraform-summary.json"

Plan Report

Flag / EnvironmentDescriptionTypeDefault
$PLAN_REPORT_LOG_ENABLEDWrite the plan report to the job log.booltrue
Project
Flag / EnvironmentDescriptionTypeDefault
$TERRAFORM_CWD
$TF_ROOT
Working directory for terraform commands.string"."
State
Flag / EnvironmentDescriptionTypeDefault
$TERRAFORM_STATE_TYPE
$TF_STATE_TYPE
Terraform state type.string
format(enum("gitlab-http"))
$TERRAFORM_STATE_NAME
$TF_STATE_NAME
Terraform state name.string"default"
$TERRAFORM_STATE_STRICT
$TF_STATE_STRICT
Fail when no Terraform state type is configured.boolfalse
$TERRAFORM_STATE_GITLAB_HTTP_HTTP_ADDRESS
$TF_HTTP_ADDRESS
$TF_ADDRESS
HTTP address for the GitLab HTTP state backend.string
$TERRAFORM_STATE_GITLAB_HTTP_HTTP_LOCK_ADDRESS
$TF_HTTP_LOCK_ADDRESS
HTTP lock address for the GitLab HTTP state backend.string
$TERRAFORM_STATE_GITLAB_HTTP_HTTP_LOCK_METHOD
$TF_HTTP_LOCK_METHOD
HTTP lock method for the GitLab HTTP state backend.string"POST"
$TERRAFORM_STATE_GITLAB_HTTP_HTTP_UNLOCK_ADDRESS
$TF_HTTP_UNLOCK_ADDRESS
HTTP unlock address for the GitLab HTTP state backend.string
$TERRAFORM_STATE_GITLAB_HTTP_HTTP_UNLOCK_METHOD
$TF_HTTP_UNLOCK_METHOD
HTTP unlock method for the GitLab HTTP state backend.string"DELETE"
$TERRAFORM_STATE_GITLAB_HTTP_HTTP_USERNAME
$TF_HTTP_USERNAME
$TF_USERNAME
HTTP username for the GitLab HTTP state backend.string"gitlab-ci-token"
$TERRAFORM_STATE_GITLAB_HTTP_HTTP_PASSWORD
$TF_HTTP_PASSWORD
$TF_PASSWORD
$CI_JOB_TOKEN
HTTP password for the GitLab HTTP state backend.string
$TERRAFORM_STATE_GITLAB_HTTP_HTTP_RETRY_WAIT_MIN
$TF_HTTP_RETRY_WAIT_MIN
Minimum time to wait between HTTP retries for the GitLab HTTP state backend, in seconds.string"5"
⁠pipe-terraform apply

Apply terraform project.

pipe-terraform apply [FLAGS]

⁠Flags

Apply

Flag / EnvironmentDescriptionTypeDefault
$TERRAFORM_APPLY_OUTPUT
$TF_PLAN_CACHE
$TF_APPLY_OUTPUT
$TF_PLAN_OUTPUT
Output file for terraform apply.string"plan"
$TERRAFORM_APPLY_ARGS
$TF_APPLY_ARGS
Additional arguments for terraform apply.string
Config
Flag / EnvironmentDescriptionTypeDefault
$TERRAFORM_LOG_LEVEL
$TF_LOG_LEVEL
$TF_LOG
Terraform log level.string
format(enum("trace", "debug", "info", "warn", "error"))
GitLab Merge Request Report
Flag / EnvironmentDescriptionTypeDefault
$GITLAB_MR_REPORT_ENABLEDEnable GitLab merge request report note on the given merge request.boolfalse
$GL_PIPES_TOKENGitLab API token for merge request report notes.string
$CI_API_V4_URLGitLab API URL for merge request report notes.string
$CI_PROJECT_IDGitLab project id for merge request report notes.string
$CI_MERGE_REQUEST_IIDGitLab merge request iid for merge request report notes.int0
$GITLAB_MR_REPORT_IDENTIFIERHidden marker identifier for merge request report notes. Defaults to the job name combined with the stack or state under report.string
$CI_COMMIT_BRANCHBranch of the pipeline, whose merge requests merged into the commit are reported on when it is the default branch.string
$CI_DEFAULT_BRANCHDefault branch of the project, the only branch whose pipelines report on the merge requests merged into the commit.string
$GITLAB_MR_REPORT_DEPLOY_JOBName of the job in the pipeline that applies the plan, which the plan report on the merge requests merged into the commit links to run. Links the pipeline when empty or not found.string
$GITLAB_MR_REPORT_PLAN_JOBName of the job in the pipeline that planned what is applied, which the deploy report on the merge requests merged into the commit links to. Links the pipeline when empty or not found.string
GitLab Pipeline
Flag / EnvironmentDescriptionTypeDefault
$CI_JOB_NAMEGitLab CI job name to include in the plan report metadata.string
$CI_JOB_URLGitLab CI job URL to include in the plan report metadata.string
$CI_PIPELINE_IDGitLab CI pipeline id to include in the plan report metadata.string
$CI_PIPELINE_URLGitLab CI pipeline URL to include in the plan report metadata.string
$CI_COMMIT_SHAGit commit sha to include in the plan report metadata.string
$CI_COMMIT_SHORT_SHAShort git commit sha to include in the plan report metadata.string
Injected Variables
Flag / EnvironmentDescriptionTypeDefault
$TERRAFORM_CI_API_URL
$TF_VAR_CI_API_V4_URL
$CI_API_V4_URL
Injected CI api-url variable to the deployment.string
$TERRAFORM_CI_PROJECT_ID
$TF_VAR_CI_PROJECT_ID
$CI_PROJECT_ID
Injected CI project-id variable to the deployment.string
Login
Flag / EnvironmentDescriptionTypeDefault
$TERRAFORM_LOGINTerraform registries to login to.string
format(yaml([]struct{ uri: string, token: string }))
Project
Flag / EnvironmentDescriptionTypeDefault
$TERRAFORM_CWD
$TF_ROOT
Working directory for terraform commands.string"."
State
Flag / EnvironmentDescriptionTypeDefault
$TERRAFORM_STATE_TYPE
$TF_STATE_TYPE
Terraform state type.string
format(enum("gitlab-http"))
$TERRAFORM_STATE_NAME
$TF_STATE_NAME
Terraform state name.string"default"
$TERRAFORM_STATE_STRICT
$TF_STATE_STRICT
Fail when no Terraform state type is configured.boolfalse
$TERRAFORM_STATE_GITLAB_HTTP_HTTP_ADDRESS
$TF_HTTP_ADDRESS
$TF_ADDRESS
HTTP address for the GitLab HTTP state backend.string
$TERRAFORM_STATE_GITLAB_HTTP_HTTP_LOCK_ADDRESS
$TF_HTTP_LOCK_ADDRESS
HTTP lock address for the GitLab HTTP state backend.string
$TERRAFORM_STATE_GITLAB_HTTP_HTTP_LOCK_METHOD
$TF_HTTP_LOCK_METHOD
HTTP lock method for the GitLab HTTP state backend.string"POST"
$TERRAFORM_STATE_GITLAB_HTTP_HTTP_UNLOCK_ADDRESS
$TF_HTTP_UNLOCK_ADDRESS
HTTP unlock address for the GitLab HTTP state backend.string
$TERRAFORM_STATE_GITLAB_HTTP_HTTP_UNLOCK_METHOD
$TF_HTTP_UNLOCK_METHOD
HTTP unlock method for the GitLab HTTP state backend.string"DELETE"
$TERRAFORM_STATE_GITLAB_HTTP_HTTP_USERNAME
$TF_HTTP_USERNAME
$TF_USERNAME
HTTP username for the GitLab HTTP state backend.string"gitlab-ci-token"
$TERRAFORM_STATE_GITLAB_HTTP_HTTP_PASSWORD
$TF_HTTP_PASSWORD
$TF_PASSWORD
$CI_JOB_TOKEN
HTTP password for the GitLab HTTP state backend.string
$TERRAFORM_STATE_GITLAB_HTTP_HTTP_RETRY_WAIT_MIN
$TF_HTTP_RETRY_WAIT_MIN
Minimum time to wait between HTTP retries for the GitLab HTTP state backend, in seconds.string"5"
⁠pipe-terraform publish

Publish terraform project.

pipe-terraform publish [FLAGS]

⁠Flags

Module

Flag / EnvironmentDescriptionTypeDefault
$TERRAFORM_PUBLISH_MODULE_NAME
$TF_MODULE_NAME
$CI_PROJECT_NAME*
Name for the module that will be published.string
$TERRAFORM_PUBLISH_MODULE_TAGS
$TF_MODULE_TAGS
$CI_COMMIT_TAG
Versions for the module to be published.string[]
$TERRAFORM_PUBLISH_MODULE_CWD
$TF_MODULE_CWD
$TF_ROOT
Directory for the module that will be published.string"."
$TERRAFORM_PUBLISH_MODULE_SYSTEM
$TF_MODULE_SYSTEM
Module system for the module that will be published.string"local"

* required

Registry

Flag / EnvironmentDescriptionTypeDefault
$TERRAFORM_PUBLISH_REGISTRY_NAME
$TF_MODULE_REGISTRY
Registry of the module that will be published.string
format(enum("gitlab"))
"gitlab"

Registry - GitLab

Flag / EnvironmentDescriptionTypeDefault
$TERRAFORM_PUBLISH_REGISTRY_GITLAB_API_URL
$CI_API_V4_URL
GitLab API URL for the publish call.string
$TERRAFORM_PUBLISH_REGISTRY_GITLAB_PROJECT_ID
$CI_PROJECT_ID
GitLab project id for the publish call.string
$TERRAFORM_PUBLISH_REGISTRY_GITLAB_TOKEN
$CI_JOB_TOKEN
GitLab API token for the publish call.string

Tags From Environment

Flag / EnvironmentDescriptionTypeDefault
$TAGS_FROM_ENVIRONMENTEnvironment variables to read tags from, where a name ending in "*" reads every variable under that prefix. An unset or empty variable is skipped.string[]

Tag summary

Content type

Image

Digest

sha256:149116a84…

Size

59.2 MB

Last updated

31 minutes ago

docker pull cenk1cenk2/pipe-terraform