All Projects → outsideris → Citizen

outsideris / Citizen

Licence: mpl-2.0
A Private Terraform Module Registry

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Citizen

Terraform Fargate Example
Example repository to run an ECS cluster on Fargate
Stars: ✭ 206 (-10.43%)
Mutual labels:  terraform
Terraform Provider Cloudflare
Cloudflare Terraform Provider
Stars: ✭ 208 (-9.57%)
Mutual labels:  terraform
Terraform Provider Openstack
Terraform OpenStack provider
Stars: ✭ 225 (-2.17%)
Mutual labels:  terraform
Terraform Provider Azurerm
Terraform provider for Azure Resource Manager
Stars: ✭ 3,007 (+1207.39%)
Mutual labels:  terraform
Terraform Website S3 Cloudfront Route53
Terraform scripts to setup an S3 based static website, with a CloudFront distribution and the required Route53 entries.
Stars: ✭ 210 (-8.7%)
Mutual labels:  terraform
Terraform Provider Datadog
Terraform Datadog provider
Stars: ✭ 213 (-7.39%)
Mutual labels:  terraform
Terragrunt Reference Architecture
Terragrunt Reference Architecture (upd: May 2020)
Stars: ✭ 204 (-11.3%)
Mutual labels:  terraform
Terraform Provider Keycloak
Terraform provider for Keycloak
Stars: ✭ 230 (+0%)
Mutual labels:  terraform
Terraform Aws Elastic Beanstalk Environment
Terraform module to provision an AWS Elastic Beanstalk Environment
Stars: ✭ 211 (-8.26%)
Mutual labels:  terraform
Azure arc
Automated Azure Arc environments
Stars: ✭ 224 (-2.61%)
Mutual labels:  terraform
Intellij Hcl
HCL language support for IntelliJ platform based IDEs
Stars: ✭ 207 (-10%)
Mutual labels:  terraform
Terraform Provider Ibm
Terraform on IBM provider https://cloud.ibm.com/docs/ibm-cloud-provider-for-terraform?topic=ibm-cloud-provider-for-terraform-getting-started
Stars: ✭ 210 (-8.7%)
Mutual labels:  terraform
Terraform Aws Ecs Container Definition
Terraform module to generate well-formed JSON documents (container definitions) that are passed to the aws_ecs_task_definition Terraform resource
Stars: ✭ 217 (-5.65%)
Mutual labels:  terraform
Concourse Up
Deprecated - used Control Tower instead
Stars: ✭ 207 (-10%)
Mutual labels:  terraform
Streamalert
StreamAlert is a serverless, realtime data analysis framework which empowers you to ingest, analyze, and alert on data from any environment, using datasources and alerting logic you define.
Stars: ✭ 2,634 (+1045.22%)
Mutual labels:  terraform
Terraform Provider Gitlab
Terraform GitLab provider
Stars: ✭ 205 (-10.87%)
Mutual labels:  terraform
Terraform Provider Acme Old
ACME (Let's Encrypt) Support for Terraform
Stars: ✭ 211 (-8.26%)
Mutual labels:  terraform
Terraform Aws Tfstate Backend
Terraform module that provision an S3 bucket to store the `terraform.tfstate` file and a DynamoDB table to lock the state file to prevent concurrent modifications and state corruption.
Stars: ✭ 229 (-0.43%)
Mutual labels:  terraform
Harbor
An open source trusted cloud native registry project that stores, signs, and scans content.
Stars: ✭ 16,320 (+6995.65%)
Mutual labels:  registry
Tfsec
Security scanner for your Terraform code
Stars: ✭ 3,622 (+1474.78%)
Mutual labels:  terraform

= Citizen

image:https://github.com/outsideris/citizen/workflows/Unit%20tests/badge.svg["Unit Test Status", link="https://github.com/outsideris/citizen/actions?query=workflow%3A%22Unit+tests%22+branch%3Amaster"] image:https://github.com/outsideris/citizen/workflows/Integration%20Tests/badge.svg["Integration Test Status", link="https://github.com/outsideris/citizen/actions?query=workflow%3A%22Integration+Tests%22+branch%3Amaster"] image:https://app.fossa.io/api/projects/git%2Bgithub.com%2Foutsideris%2Fcitizen.svg?type=shield["FOSSA Status", link="https://app.fossa.io/projects/git%2Bgithub.com%2Foutsideris%2Fcitizen?ref=badge_shield"]

A Private link:https://registry.terraform.io/[Terraform Module] and link:https://www.terraform.io/docs/internals/provider-registry-protocol.html[Terraform Provider] registry.

== Requirements

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

== Download link:https://github.com/outsideris/citizen/releases/latest[Download the latest release!]

Also, you can use to launch the registry server. The docker image is in link:https://github.com/users/outsideris/packages/container/package/citizen[GitHub Container Registry ].

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

== Server Usage

=== 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:https://www.terraform.io/[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:https://ngrok.com/[ngrok].

Environment variables:

  • CITIZEN_DATABASE: Backend provider for registry metadata. Set to mongodb to use MongoDB. Leaving unset will use local nedb file.
  • CITIZEN_MONGO_DB_URI: MongoDB database URI if using MongoDB backend. URI format is mongodb://username:[email protected]:port/database?options.... Default is mongodb://localhost:27017/citizen
  • CITIZEN_DB_DIR: A directory to save database file if using local backend storage. 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 ifCITIZEN_STORAGEiss3`.
  • 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.

== Client Usage

=== citizen module <namespace> <name> <provider> <version>

Since link:https://registry.terraform.io/[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 module ....

You should set CITIZEN_ADDR as citizen registry server address which you will publish your modules to. e.g. https://registry.example.com.

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

Then, you can define it in your terraform file like this: .... module "alb" { source = "registry.example.com/dev-team/alb/aws" version = "0.1.0" } ....

=== citizen provider <namespace> <type> <version> [protocols]

Citizen provides a special command to publish providers onto citizen.

  • -g, --gpg-key <gpgkey>: GPG key to sign your SHA256SUMS.
  • You need to publish your provider with your GPG public key to terraform registry. Otherwise, terraform will refuse to install providers. Terraform official resistry manage partners' public keys, but, each provider version has own public key and signature in citizen registry.

You must first link:https://www.terraform.io/docs/registry/providers/publishing.html[build and package], citizen expects following files in the provider location:

  • <namespace>-<type>_<version>_<os>_<arch>.zip (one per os/arch combination)

Where <namespace> and <type> is a name of the provider and <version> is a provider version in the MAJOR.MINOR.PATCH version format.

Citizen will generate a SHA256SUMS file and a GPG signature file automatically for you: Following files will be generated in your directory during publising provider. So, You don't need prepare theses files.

  • <namespace>-<type>_<version>_SHA256SUMS
  • <namespace>-<type>_<version>_SHA256SUMS.sig

Therefore, shasum and gpg commands should be available in your machine.

In a provider directory, you can publish your terraform provider via a command below: [source, sh] .... $ ./citizen provider [protocols] ....

[protocols] is comma separated Terraform provider API versions, with MAJOR.MINOR.

You should set CITIZEN_ADDR as citizen registry server address which you will publish your modules to. e.g. https://registry.example.com.

=== Examples If you have ALB provider in ./utilities directory, and your registry server is launched at https://registry.example.com, you run below command in ./utilities directory to publish utilities provider. [source, sh] .... $ CITIZEN_ADDR=https://registry.example.com
citizen provider dev-team utilities 0.1.0 4.1,5.0 ....

Then, you can define it in your terraform file like this: .... provider "utilities" { }

terraform { required_providers { utilities = { source = "registry.example.com/dev-team/utilities" version = "0.1.0" } } } ....

== Development Set environment variables, see above.

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

=== Test Set at least a storage path and the s3 bucket name variables for the tests to succeed. You need to be able to access the bucket, so you probably want to have an active aws or aws-vault profile.

Run mongodb first like: [source, sh] .... $ docker run --rm -p 27017:27017 --name mongo mongo ....

Run the tests: [source, sh] .... $ npm test ....

Run the tests with the environment variables prefixed: [source, sh] .... $ CITIZEN_STORAGE_PATH=storage CITIZEN_AWS_S3_BUCKET=terraform-registry-modules npm test ....

=== Build distributions

[source, sh] .... $ npm run build ....

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

== License image:https://app.fossa.io/api/projects/git%2Bgithub.com%2Foutsideris%2Fcitizen.svg?type=large["FOSSA Status", link="https://app.fossa.io/projects/git%2Bgithub.com%2Foutsideris%2Fcitizen?ref=badge_large"]

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].