Code Monkey home page Code Monkey logo

terraform-aks-sample's Introduction

Azure Storage에 Terraform 상태 저장하기

scipts 디렉터리 하위의 terraform-azure-strage-account.sh를 실행한다. 실행하기 전 스크립트의 변수를 자신의 환경에 맞게 설정한다. 스크립트 실행 결과 출력은 main.tf에서 terraform backend 설정에 사용되므로 출력 결과를 가지고 main.tf를 상황에 맞게 설정한다. 스크립트 실행 결과 출력 중 Storage account에 접근할 수 있는 access_key는 terraform 작업 중 필요하므로 다음과 같이 ARM_ACCESS_KEY이라는 환경변수로 저장한다.

export ARM_ACCESS_KEY=<storage access key>

Required Variables

terraform.tfvars 파일을 생성하고 아래 변수들을 복사하여 상황에 맞게 설정한다.

environment = "dev"

# Network Variables
address_space = [
  "10.0.0.0/16"
]
aks_subnet_address_prefixes = [
  "10.0.1.0/24"
]

# AKS Variables
ssh_public_key = "~/.ssh/id_rsa.pub"
aks_kubernetes_version = "1.19.9"
aks_node_count = 3
aks_vm_size = "Standard_D2_v2"
log_analytics_workspace_sku = "PerGB2018"

Terraform graph

다음 커맨드를 이용하면 terraform 설정 또는 실행 계획을 시각적으로 확인할 수 있는 출력을 얻을 수 있다.

terraform graph

위 커맨드를 이용하여 다음과 같이 시각화 도구와 연동하여 그래프가 시각적으로 표현된 이미지를 얻을 수 있다.

다음 커맨드는 그래프 시각화 도구를 사용하고 있으므로 그래프 시각화 도구의 설치가 필요하다. 해당 내용은 References의 링크를 확인한다.

terraform graph | dot -Tsvg > graph.svg

References

https://terraform.io

Tutorial: Azure Storage에 Terraform 상태 저장하기

그래프 시각화 도구 Graphviz

terraform-aks-sample's People

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.