Skip to content

Instantly share code, notes, and snippets.

@ilnikolay
ilnikolay / terraform_init_time_cache.sh
Created January 30, 2023 10:59
terraform_init_time_cache
time terraform init
Initializing the backend...
Initializing provider plugins...
- Finding hashicorp/aws versions matching "~> 4.45.0"...
- Finding hashicorp/random versions matching "~> 3.4.3"...
- Finding hashicorp/googleworkspace versions matching "~> 0.6.0"...
- Finding hashicorp/time versions matching "~> 0.7.2"...
- Finding hashicorp/google versions matching "~> 4.20.0"...
@ilnikolay
ilnikolay / terraform_init_time_nocache.sh
Last active January 30, 2023 10:59
terraform_init_time_nocache
time terraform init
Initializing the backend...
Initializing provider plugins...
- Finding hashicorp/google versions matching "~> 4.20.0"...
- Finding hashicorp/null versions matching "~> 3.1.1"...
- Finding hashicorp/googleworkspace versions matching "~> 0.6.0"...
- Finding hashicorp/local versions matching "~> 2.2.2"...
- Finding hashicorp/external versions matching "~> 2.2.2"...
@ilnikolay
ilnikolay / terraform_pipeline_output.md
Created January 12, 2023 15:31
terraform_pipeline_output
Successfully extracted cache
Executing "step_script" stage of the job script
Using docker image sha256:e15959079c8f7cc999fa2447e2af02202f4c4240626a4bf121f9cf020476db96 for hashicorp/terraform:1.3.1 with digest hashicorp/terraform@sha256:160c8cc975c35e9280ad36162df993f7dcc4d6f15f641af93ac0e2ceec9f980a ...
$ cd $CI_PROJECT_DIR/$TF_PROJECT_DIR/
$ terraform init
Initializing the backend...
Initializing provider plugins...
- Reusing previous version of hashicorp/aws from the dependency lock file
- Using hashicorp/aws v4.45.0 from the shared cache directory
@ilnikolay
ilnikolay / terraform_pipeline_caching.yaml
Created January 12, 2023 15:30
terraform_pipeline_caching
stages:
- init
image:
name: hashicorp/terraform:1.3.1
entrypoint: [ "" ]
variables:
TF_PROJECT_DIR: terraform
TF_PLUGIN_CACHE_DIR: "${CI_PROJECT_DIR}/plugin-cache"
@ilnikolay
ilnikolay / terraform_provider_symlink.md
Created January 12, 2023 15:29
terraform_provider_symlink
@ilnikolay
ilnikolay / terraform_init_cache.md
Created January 12, 2023 15:28
terraform_init_cache
▶ terraform init

Initializing the backend...

Initializing provider plugins...
- Reusing previous version of hashicorp/aws from the dependency lock file
- Using hashicorp/aws v4.45.0 from the shared cache directory
@ilnikolay
ilnikolay / terraform_hidden_files_1.md
Created January 12, 2023 15:27
terraform_hidden_files_1
▶ ls -la
-rw-r--r--. 1 niko niko  112 Dec  5 22:33 main.tf
drwxr-xr-x. 1 niko niko   18 Dec  5 22:34 .terraform
-rw-r--r--. 1 niko niko 1377 Dec  5 22:34 .terraform.lock.hcl

▶ ls -lah .terraform/providers/registry.terraform.io/hashicorp/aws/4.45.0/linux_amd64
total 296M
drwxr-xr-x. 1 niko niko   66 Dec  5 22:34 .
drwxr-xr-x. 1 niko niko 22 Dec 5 22:34 ..
@ilnikolay
ilnikolay / terraform_init.md
Created January 12, 2023 15:15
terraform_init
▶ terraform init

Initializing the backend...

Initializing provider plugins...
- Finding latest version of hashicorp/aws...
- Installing hashicorp/aws v4.45.0...
- Installed hashicorp/aws v4.45.0 (signed by HashiCorp)
@ilnikolay
ilnikolay / aws_provider.tf
Last active January 27, 2023 16:08
terraform_provider
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "4.45.0"
}
}
}
provider "aws" {