Giter Site home page Giter Site logo

tf_yd_project_cluster's Introduction

Infrastructure

Getting started

export ACCESS_KEY=<your_key>
export SECRET_KEY=<your_key>
export TOKEN=<your_token>
export FOLDER=<your_folder_id>

Install Y CLI

curl https://storage.yandexcloud.net/yandexcloud-yc/install.sh | bash -s -- -a
exec -l $SHELL

Confiure YCloud

yc config set folder-id $FOLDER
yc config set token $TOKEN

yc config profile create prod

yc iam service-account create --name sa-gc-tfstate

yc iam service-account list

yc storage bucket create \
--name gc-tfstate-backet \
--default-storage-class STANDARD \
--max-size 10485760

yc ydb database create state-lock-db --serverless

yc resource-manager folder add-access-binding --service-account-name sa-gc-tfstate --role editor $FOLDER

yc iam access-key create --service-account-name sa-gc-tfstate

Создать таблицу state-lock-table Тип таблицы Документная. Добавить колонку тип строка LockID отметить Ключ партицирования

TF

Создать файл variables.tfvars c содержимым

# YCloud
token = ""
cloud_id = ""
folder_id = ""

# PG credentials
pg_user = ""
pg_password = ""
pg_database = ""

# Kafka
kafka_cluster_user = ""
kafka_cluster_password = ""

TF

========= offline mode for Russia ===========

mkdir ${HOME}/.terraform.d/ && cp -r plugins/ ${HOME}/.terraform.d/
cp .terraformrc ${HOME}/.terraformrc
terraform init -backend-config="access_key=$ACCESS_KEY" -backend-config="secret_key=$SECRET_KEY"
terraform init -reconfigure -backend-config="access_key=$ACCESS_KEY" -backend-config="secret_key=$SECRET_KEY" -var-file=variables.tfvars
terraform plan -var-file=variables.tfvars
terraform apply -var-file=variables.tfvars -auto-approve
terraform destroy -var-file=variables.tfvars -auto-approve

tf_yd_project_cluster's People

Contributors

a1xs avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.