Public | Automated Build

Last pushed: a month ago
Short Description
A Private Terraform Module Registry
Full Description

= Citizen

image:["Build Status", link=""]
image:["FOSSA Status", link=""]
image:["Dependency Status", link=""]
image:["devDependency Status", link=""]

A Private link:[Terraform Module Registry]
in the early stages of development.

== Requirements

  • Node.js 8+
  • HTTPS - Terraform module registry only support HTTPS.

== Usage
link:[Download the latest release!]

=== citizen server
To launch the registry server
[source, sh]
$ ./citizen server

It will be launched at link:http://localhost:3000[http://localhost:3000]. You can check it at link:http://localhost:3000/health[http://localhost:3000/health].

Because link:[Terraform CLI] works with only HTTPS server, you should set up HTTPS in front of the registry server.

If you want to test it at local, you need a tool which provides HTTPS like link:[ngrok].

Environment variables:

  • CITIZEN_DATA_PATH: A directory to save database file. The default is data directory in a current working directory (absolute/relative path can be used).
  • CITIZEN_STORAGE : Storage type to store module files. You can use file or s3 type.
  • CITIZEN_STORAGE_PATH: A directory to save module files only if CITIZEN_STORAGE is file (absolute/relative path can be used).
  • CITIZEN_AWS_S3_BUCKET`: A S3 bucket to save module files only if CITIZEN_STORAGE is s3.
  • AWS_ACCESS_KEY_ID: Your AWS access key only if CITIZEN_STORAGE is s3.
  • AWS_SECRET_ACCESS_KEY: Your AWS secret access key only if CITIZEN_STORAGE is s3.

=== citizen publish
Since link:[official Terraform Module Registry] is integrated with GitHub, users can publish terraform modules if they just push it on GitHub.

Citizen provides a special command to publish a module onto citizen registry server instead integrating GitHub.

In a module directory, you can publish your terraform module via a command below:
[source, sh]
$ ./citizen publish <namespace> <name> <provider> <version>

You should set CITIZEN_ADDR as citizen registry server address which you will publish your modules to. e.g.

=== Examples
If you have ALB module in ./alb directory and your registry server is launched at, you run below command in ./alb directory to publish ALB module.
[source, sh]
citizen publish dev-team alb aws 0.1.0

Then, you can define it in your terraform file like this:
module "alb" {
source = ""
version = "0.1.0"

== Docker
You can use docker to launch the registry server.
The docker image is in link:[outsideris/citizen].

[source, sh]
$ docker run -d -p "3000:3000" outsideris/citizen:latest

== Development
Set environment variables, see above.

[source, sh]
$ ./bin/citizen server
$ ./bin/citizen publish

=== Test
[source, sh]
$ npm test

=== Build distributions

[source, sh]
$ npm run build

Under dist/,
citizen binaries for linux, darwin and windows made.

== License
image:["FOSSA Status", link=""]

Docker Pull Command
Source Repository