Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Citizen 개발기

Citizen 개발기

Terraform private module/provider registry를 개인 프로젝트로 만든 citizen의 개발기

748a6dc8b4eaba0fde62909e39be7987?s=128

Outsider

June 29, 2022
Tweet

More Decks by Outsider

Other Decks in Technology

Transcript

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

    22 HashiCorp User Group
  2. None
  3. HashiCorp Brand Gudie: https://www.hashicorp.com/brand

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

  5. None
  6. https://registry.terraform.io/

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

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

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

  10. Public Registry

  11. Public Registry 과금 Private Registry

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

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

  14. None
  15. https://www.terraform.io/registry/api-docs

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

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

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

  19. 타동사 (행성을 사람들이 살 수 있도록) 지구처럼 만들다 명사 (특정

    지역의) 주민, 시민 terra·form citi·zen
  20. None
  21. 파일 데이터베이스 지원 파일/S3 스토리지 지원

  22. Usage: citizen [command] [options] Options: -V, -- version output the

    version number -h, -- help output usage information Commands: publish [options] <namespace> <name> <provider> <version> 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
  23. 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 테스트
  24. None
  25. https://blog.outsider.ne.kr/1384

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

  27. 0.2 0.3 블로그 포스팅

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

  29. 7 months later …

  30. None
  31. 0.2 0.3 블로그 포스팅 0.3.2

  32. None
  33. None
  34. 0.2 0.3 블로그 포스팅 0.3.2 0.3.3

  35. 1년 4개월

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

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

  38. // 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 }
  39. https://github.com/outsideris/citizen/pull/50

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

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

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

  43. 0.2 0.3 블로그 포스팅 0.3.2 0.3.3 0.4.0

  44. Usage: citizen [command] [options] Options: -V, -- version output the

    version number -h, -- help display help for command Commands: module [options] <namespace> <name> <provider> <version> Publish the terraform module provider [options] <namespace> <type> <version> [protocols] Publish the terraform provider server [options] Run a terraform registry Citizen CLI
  45. https://discuss.hashicorp.com/t/citizen-a-private-terraform-registry/21897

  46. 4개월 다시 찾아온 공백

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

  48. None
  49. https://mobile.twitter.com/Outsideris/status/1492007882589564929

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

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

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

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

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

  55. 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.
  56. https://burger.devops.vectra-svc.ai/

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

  58. 로드맵

  59. None
  60. None
  61. None
  62. EOL t Outsideris g outsideris envelope outsideris@gmail.com