[stage-1] complete pre-configuration and terraform init

This commit is contained in:
2023-03-15 10:22:16 +07:00
parent dc0c700b96
commit d92c0da0e3
9 changed files with 161 additions and 1 deletions

38
terraform/.gitignore vendored Normal file
View File

@@ -0,0 +1,38 @@
# Local .terraform directories
**/.terraform/*
# .tfstate files
*.tfstate
*.tfstate.*
# Crash log files
crash.log
crash.*.log
# Exclude all .tfvars files, which are likely to contain sentitive data, such as
# password, private keys, and other secrets. These should not be part of version
# control as they are data points which are potentially sensitive and subject
# to change depending on the environment.
#
*.tfvars
# Ignore override files as they are usually used to override resources locally and so
# are not checked in
override.tf
override.tf.json
*_override.tf
*_override.tf.json
# Include override files you do wish to add to version control using negated pattern
#
# !example_override.tf
# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan
# example: *tfplan*
# Ignore CLI configuration files
.terraformrc
terraform.rc
.terraform.lock.hcl
variables.tf

28
terraform/provider.tf Normal file
View File

@@ -0,0 +1,28 @@
terraform {
required_providers {
yandex = {
source = "yandex-cloud/yandex"
}
}
required_version = ">= 0.13"
backend "s3" {
endpoint = "storage.yandexcloud.net"
bucket = "bucket"
region = "ru-central1"
key = "tf/state.tfstate"
access_key = "access_key"
secret_key = "secret_key"
skip_region_validation = true
skip_credentials_validation = true
}
}
provider "yandex" {
token = var.yandex_cloud_token
cloud_id = var.yandex_cloud_id
folder_id = var.yandex_folder_id
zone = "ru-central1-a"
}