Slide 1

Slide 1 text

Citizen 개발기 (A Private Terraform Module/Provider Registry) Outsider@당근마켓 2022. 6. 22 HashiCorp User Group

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

HashiCorp Brand Gudie: https://www.hashicorp.com/brand

Slide 4

Slide 4 text

https://www.hashicorp.com/blog/hashicorp-terraform-module-registry

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

https://registry.terraform.io/

Slide 7

Slide 7 text

Public registry는 오픈소스 private 레지스트리가 있다 verdaccio

Slide 8

Slide 8 text

Public registry는 오픈소스 private 레지스트리가 있다 verdaccio

Slide 9

Slide 9 text

Public registry는 오픈소스 private 레지스트리가 있다 verdaccio

Slide 10

Slide 10 text

Public Registry

Slide 11

Slide 11 text

Public Registry 과금 Private Registry

Slide 12

Slide 12 text

Public Registry 과금 Private Registry 오픈소스 Private Registry

Slide 13

Slide 13 text

| Registry https://unsplash.com/photos/oZuBNC-6E2s

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

https://www.terraform.io/registry/api-docs

Slide 16

Slide 16 text

API Spec 구현체(Terraform Registry) 클라이언트(Terraform CLI) + +

Slide 17

Slide 17 text

https://github.com/apparentlymart/terraform-simple-registry

Slide 18

Slide 18 text

타동사 (행성을 사람들이 살 수 있도록) 지구처럼 만들다 terra·form

Slide 19

Slide 19 text

타동사 (행성을 사람들이 살 수 있도록) 지구처럼 만들다 명사 (특정 지역의) 주민, 시민 terra·form citi·zen

Slide 20

Slide 20 text

No content

Slide 21

Slide 21 text

파일 데이터베이스 지원 파일/S3 스토리지 지원

Slide 22

Slide 22 text

Usage: citizen [command] [options] Options: -V, -- version output the version number -h, -- help output usage information Commands: publish [options] publish the terraform module Environment variables below need to set * CITIZEN_ADDR : citizen registry server address to pubilsh a module server [options] run a terraform registry Environment variables below need to set * CITIZEN_STORAGE : storage type, file or s3 * CITIZEN_STORAGE_PATH : directory to save module files if CITIZEN_STORAGE is file (absolute/relative path can be used). * CITIZEN_AWS_S3_BUCKET : s3 bucket to save module files if CITIZEN_STORAGE is s3 * AWS_ACCESS_KEY_ID : your AWS access key if CITIZEN_STORAGE is s3 * AWS_SECRET_ACCESS_KEY : your AWS secret access key if CITIZEN_STORAGE is s3 Citizen CLI

Slide 23

Slide 23 text

it('cli should connect the registry server with terraform-cli', (done) = > { const cwd = join( __ dirname, 'fixture'); execFile(terraform, ['get'], { cwd }, (err, stdout, stderr) => { expect(stdout).to.include('- module.vpc'); expect(stderr).to.include('no versions found'); done(); }); }); Terraform CLI를 통한 E2E 테스트

Slide 24

Slide 24 text

No content

Slide 25

Slide 25 text

https://blog.outsider.ne.kr/1384

Slide 26

Slide 26 text

https://mobile.twitter.com/Outsideris/status/1004813169577975808

Slide 27

Slide 27 text

0.2 0.3 블로그 포스팅

Slide 28

Slide 28 text

나조차도 고객이 아니었다.

Slide 29

Slide 29 text

7 months later …

Slide 30

Slide 30 text

No content

Slide 31

Slide 31 text

0.2 0.3 블로그 포스팅 0.3.2

Slide 32

Slide 32 text

No content

Slide 33

Slide 33 text

No content

Slide 34

Slide 34 text

0.2 0.3 블로그 포스팅 0.3.2 0.3.3

Slide 35

Slide 35 text

1년 4개월

Slide 36

Slide 36 text

https://www.hashicorp.com/blog/providers-in-the-hashicorp-terraform-registry-now-live

Slide 37

Slide 37 text

https://www.hashicorp.com/blog/announcing-terraform-0-12

Slide 38

Slide 38 text

// terraform 0.11 resource "google_compute_subnetwork" "example" { count = 4 name = "test-subnetwork" ip_cidr_range = "${cidrsubnet(var.base_network_cidr, 4, count.index)}" region = "us-central1" network = "${google_compute_network.custom-test.self_link}" } // terraform 0.12+ resource "google_compute_subnetwork" "example" { count = 4 name = "test-subnetwork" ip_cidr_range = cidrsubnet(var.base_network_cidr, 4, count.index) region = "us-central1" network = google_compute_network.custom-test.self_link }

Slide 39

Slide 39 text

https://github.com/outsideris/citizen/pull/50

Slide 40

Slide 40 text

https://github.com/outsideris/citizen/pull/51

Slide 41

Slide 41 text

https://github.com/outsideris/citizen/pull/39

Slide 42

Slide 42 text

https://github.com/outsideris/citizen/issues/48

Slide 43

Slide 43 text

0.2 0.3 블로그 포스팅 0.3.2 0.3.3 0.4.0

Slide 44

Slide 44 text

Usage: citizen [command] [options] Options: -V, -- version output the version number -h, -- help display help for command Commands: module [options] Publish the terraform module provider [options] [protocols] Publish the terraform provider server [options] Run a terraform registry Citizen CLI

Slide 45

Slide 45 text

https://discuss.hashicorp.com/t/citizen-a-private-terraform-registry/21897

Slide 46

Slide 46 text

4개월 다시 찾아온 공백

Slide 47

Slide 47 text

https://cloudseclist.com/issues/issue-121/

Slide 48

Slide 48 text

No content

Slide 49

Slide 49 text

https://mobile.twitter.com/Outsideris/status/1492007882589564929

Slide 50

Slide 50 text

https://project-awesome.org/shuaibiyy/awesome-terraform

Slide 51

Slide 51 text

https://star-history.com/#outsideris/citizen&Date

Slide 52

Slide 52 text

0.2 0.3 블로그 포스팅 0.3.2 0.3.3 0.4.0 0.5.0

Slide 53

Slide 53 text

0.2 0.3 블로그 포스팅 0.3.2 0.3.3 0.4.0 0.5.0 0.5.1 0.5.2

Slide 54

Slide 54 text

https://www.cloud4engineers.com/posts/2022/02/using-citizen-as-a-private-registry-to-store-and-retrieve-terraform-modules/

Slide 55

Slide 55 text

https://www.cloud4engineers.com/posts/2022/02/using-citizen-as-a-private-registry-to-store-and-retrieve-terraform-modules/ With Citizen, I just had the feeling that it was a bit more mature than Anthology due to better documentation - although Citizen is far from mature either.

Slide 56

Slide 56 text

https://burger.devops.vectra-svc.ai/

Slide 57

Slide 57 text

https://burger.devops.vectra-svc.ai/

Slide 58

Slide 58 text

로드맵

Slide 59

Slide 59 text

No content

Slide 60

Slide 60 text

No content

Slide 61

Slide 61 text

No content

Slide 62

Slide 62 text

EOL t Outsideris g outsideris envelope [email protected]