Giter Club home page Giter Club logo

cztack's Introduction

CZtack

// bump Cztack (pronounced "stack") is CZI's collection of Terraform modules. We use these as way to scale our infrastructure work.

These modules are compatible with Terraform 0.12 and up.

Contributing

Making a release

Release-please managages all the releases. To make a release, merge the release PR.

Adding a new module

To create a new module, copy the module-template directory and modify as you see fit. And make sure to add the module to the list of modules to test in .github/workflows/ci.yml.

Writing tests

A few notes on writing test for this repo. Note that this is new ground for us, so this will be a work in progress.

  • To make modules testable, all fields that have a unique constraint need to be parameterizeable. Otherwise concurrent tests will conflict.
  • It is tempting in testing module A to use module B to set up some context, but because terraform will just store the statefile locally, you can have a conflict.
    • We've tried to avoid this for now and set up context more directly
    • And also to not run tests in parrallel
    • and to clean up state files before and after each run
  • our linter requires a test for each module. At the very least run init so that its syntax is checked. See an example here.
  • AWS IAM is eventually consistent and supposedly is homed in us-east-1, so its probably best to run all tests that use IAM in that region.

Test Dependencies

cztack's People

Contributors

abiju-czi avatar aldengolab avatar alexlokshin-czi avatar alexsmaliy-czi avatar alldoami avatar chauvm avatar chrisgoffinet avatar czi-github-helper[bot] avatar czimergebot avatar cziprodsec avatar dependabot-preview[bot] avatar dependabot[bot] avatar dingying0410 avatar dtsai-czi avatar hspitzley-czi avatar huzefa avatar jakeyheath avatar jayengee avatar jgadling avatar jjb007 avatar katyho avatar kuannie1 avatar mbarrien avatar netvisao avatar oliviabholmes avatar ryanking avatar salmacodes avatar srm78 avatar tapanr avatar valenzuelaomar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cztack's Issues

aws ecs service module not reading source_security_group_id

We are using the aws-ecs-service module and saw this error with the configuration, from the source code it looks like the security group for the container should be referenced in the alb, but somehow an error was raised for not setting it. (can provide links to our terraform code and run history via direct message)

raw output from terraform:
Error: One of ['cidr_blocks', 'ipv6_cidr_blocks', 'self', 'source_security_group_id', 'prefix_list_ids'] must be set to create an AWS Security Group Rule

on .terraform/modules/napari-hub.web-service.alb-sg/main.tf line 469, in resource "aws_security_group_rule" "egress_with_source_security_group_id":
469: resource "aws_security_group_rule" "egress_with_source_security_group_id" {

Terraform modules snowflake-XXX-grant-all should not have OWNERSHIP privileges

All the terraform modules have in their privileges list the OWNERSHIP role, for example on the snowflake-warehouse-grant-all module :

"privileges": [
"MODIFY",
"MONITOR",
"OPERATE",
"OWNERSHIP",
"USAGE"
]

This is incorrect, because the actual result of the Snowflake command GRANT ALL ON WAREHOUSE TO ROLE will give the following privileges : MODIFY, MONITOR, OPERATE and USAGE.

fogg.json as suggested does not work

I wasn't able to get the provider working by just defining it in terraform, so I tried the suggested workflow with fogg in an empty repo:

user@MacBook-Pro bless-test % fogg apply                                 
fogg.yml has error(s):
ERROR: could not open fogg.yml config file
user@MacBook-Pro bless-test % fogg version
0.76.0

The docs suggested I use these contents for fogg.json:

{
  "defaults":{},
  "modules":{},
  "accounts":{},
  "envs":{},
  "plugins": {
    "terraform_providers": {
      "terraform-provider-bless": {
        "url": "https://github.com/chanzuckerberg/terraform-provider-bless/releases/download/v0.2.5/terraform-provider-bless_0.2.5_linux_amd64.tar.gz",
        "format": "tar"
      }
    }
  }
}

I'm guessing v0.76 requires a yaml and not json anymore, so I tried converting the suggested json to fogg.yaml:

defaults: {}
modules: {}
accounts: {}
envs: {}
plugins:
    terraform_providers:
        terraform-provider-bless:
            url: 'https://github.com/chanzuckerberg/terraform-provider-bless/releases/download/v0.2.5/terraform-provider-bless_0.2.5_linux_amd64.tar.gz'
            format: tar

This also produced errors, so I'm guessing the specified information is not sufficient to get started.

user@MacBook-Pro bless-test % fogg apply    
fogg.yml has error(s):
UNKNOWN ERROR: 4 errors occurred:
        * Key: 'Config.Version' Error:Field validation for 'Version' failed on the 'required' tag
        * global must have a valid owner set at either the global or defaults level
        * global must have a valid project set at either the global or defaults level
        * global must have a valid terraform version set at either the global or defaults level

Provider invalid for bless module: "Failed to query available provider packages"

Thanks for running this project.
When getting started today for the first time with the provided example, and defining the provider like so:

terraform {
  required_providers {
    bless = {
      source = "registry.terraform.io/chanzuckerberg/bless"
      version = "~> 0.5"
    }
  }
  required_version = ">= 0.13"
}

I get an error on terraform init:

│ Error: Failed to query available provider packages
│ 
│ Could not retrieve the list of available versions for provider hashicorp/bless: provider registry registry.terraform.io does not have a provider
│ named registry.terraform.io/hashicorp/bless
│ 
│ Did you intend to use chanzuckerberg/bless? If so, you must specify that source address in each module which requires that provider. To see
│ which modules are currently depending on hashicorp/bless, run the following command:
│     terraform providers
╵

It appears the bless module is pointing at an incorrect url for the intended provider:

Providers required by configuration:
.
├── provider[registry.terraform.io/chanzuckerberg/bless] ~> 0.5
├── provider[registry.terraform.io/hashicorp/null] ~> 3.0
├── provider[registry.terraform.io/hashicorp/aws]
└── module.bless
    ├── provider[registry.terraform.io/hashicorp/random]
    ├── provider[registry.terraform.io/hashicorp/bless]
    ├── provider[registry.terraform.io/hashicorp/aws]
    ├── module.lambda
    │   └── provider[registry.terraform.io/hashicorp/aws] >= 3.0.0
    └── module.logs_policy
        └── provider[registry.terraform.io/hashicorp/aws]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.