mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-03-09 22:57:59 +00:00
Update cheatsheets
This commit is contained in:
41
tldr/terraform-apply
Normal file
41
tldr/terraform-apply
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
---
|
||||||
|
syntax: markdown
|
||||||
|
tags: [tldr, common]
|
||||||
|
source: https://github.com/tldr-pages/tldr.git
|
||||||
|
---
|
||||||
|
# terraform apply
|
||||||
|
|
||||||
|
> Create or update infrastructure according to Terraform configuration files.
|
||||||
|
> More information: <https://developer.hashicorp.com/terraform/cli/commands/apply>.
|
||||||
|
|
||||||
|
- Create or update infrastructure:
|
||||||
|
|
||||||
|
`terraform apply`
|
||||||
|
|
||||||
|
- Create or update infrastructure, skipping interactive approval:
|
||||||
|
|
||||||
|
`terraform apply -auto-approve`
|
||||||
|
|
||||||
|
- Apply a plan file:
|
||||||
|
|
||||||
|
`terraform apply {{path/to/file.tfplan}}`
|
||||||
|
|
||||||
|
- Specify values for input variables:
|
||||||
|
|
||||||
|
`terraform apply -var '{{name1}}={{value1}}' -var '{{name2}}={{value2}}'`
|
||||||
|
|
||||||
|
- Specify values for input variables from a file:
|
||||||
|
|
||||||
|
`terraform apply -var-file {{path/to/file.tfvars}}`
|
||||||
|
|
||||||
|
- Apply changes to a specific resource:
|
||||||
|
|
||||||
|
`terraform apply -target {{resource_type.resource_name[instance index]}}`
|
||||||
|
|
||||||
|
- Replace a specific resource:
|
||||||
|
|
||||||
|
`terraform apply -replace {{resource_type.resource_name[instance index]}}`
|
||||||
|
|
||||||
|
- Destroy Terraform-managed infrastructure:
|
||||||
|
|
||||||
|
`terraform apply -destroy`
|
||||||
41
tldr/terraform-init
Normal file
41
tldr/terraform-init
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
---
|
||||||
|
syntax: markdown
|
||||||
|
tags: [tldr, common]
|
||||||
|
source: https://github.com/tldr-pages/tldr.git
|
||||||
|
---
|
||||||
|
# terraform init
|
||||||
|
|
||||||
|
> Initialize a new or existing Terraform working directory.
|
||||||
|
> More information: <https://developer.hashicorp.com/terraform/cli/commands/init>.
|
||||||
|
|
||||||
|
- Initialize the current working directory:
|
||||||
|
|
||||||
|
`terraform init`
|
||||||
|
|
||||||
|
- Initialize and upgrade modules and providers to the latest allowed versions:
|
||||||
|
|
||||||
|
`terraform init -upgrade`
|
||||||
|
|
||||||
|
- Initialize and reconfigure the backend, ignoring any saved configuration:
|
||||||
|
|
||||||
|
`terraform init -reconfigure`
|
||||||
|
|
||||||
|
- Initialize and reconfigure the backend, attempting to migrate any existing state:
|
||||||
|
|
||||||
|
`terraform init -migrate-state`
|
||||||
|
|
||||||
|
- Initialize with additional backend configuration:
|
||||||
|
|
||||||
|
`terraform init -backend-config '{{key}}={{value}}'`
|
||||||
|
|
||||||
|
- Initialize without backend or HCP Terraform initialization:
|
||||||
|
|
||||||
|
`terraform init -backend=false`
|
||||||
|
|
||||||
|
- Initialize without interactive prompts (useful for automation):
|
||||||
|
|
||||||
|
`terraform init -input=false`
|
||||||
|
|
||||||
|
- Initialize with the dependency lockfile mode set to readonly:
|
||||||
|
|
||||||
|
`terraform init -lockfile readonly`
|
||||||
@@ -8,7 +8,7 @@ source: https://github.com/tldr-pages/tldr.git
|
|||||||
> Generate and show Terraform execution plans.
|
> Generate and show Terraform execution plans.
|
||||||
> More information: <https://developer.hashicorp.com/terraform/cli/commands/plan>.
|
> More information: <https://developer.hashicorp.com/terraform/cli/commands/plan>.
|
||||||
|
|
||||||
- Generate and show the execution plan in the currently directory:
|
- Generate and show the execution plan in the current directory:
|
||||||
|
|
||||||
`terraform plan`
|
`terraform plan`
|
||||||
|
|
||||||
|
|||||||
4
tldr/tv
4
tldr/tv
@@ -36,3 +36,7 @@ source: https://github.com/tldr-pages/tldr.git
|
|||||||
- Update and install community-maintained channels:
|
- Update and install community-maintained channels:
|
||||||
|
|
||||||
`tv update-channels`
|
`tv update-channels`
|
||||||
|
|
||||||
|
- View tldr pages (you need to update channels first and have `tldr` installed):
|
||||||
|
|
||||||
|
`tv tldr`
|
||||||
|
|||||||
Reference in New Issue
Block a user