Lock in $30 Savings on PRO—Offer Ends Soon! ⏳

Citizen 개발기

Citizen 개발기

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

Outsider

June 29, 2022
Tweet

More Decks by Outsider

Other Decks in Technology

Transcript

  1. 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
  2. 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 테스트
  3. // 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 }
  4. 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
  5. 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.