dmark
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

Dmark

git last tag npm last version

Terraform wrapper for multi-stage and multi-stack that adds only a config file. Perfect for no HCP projects.

Dependencies

Runtime

  • Node.js + npm
  • Terraform >= 0.14.0 or OpenTofu

Development

  • pnpm

How to install

npm i -g dmark

How to use

Example with an AWS S3 bucket:

The ./src/a-bucket/main.tf file:

terraform {
  required_version = ">= 1.3.4"

  required_providers {
    aws = {
      version = "4.39.0"
      source  = "hashicorp/aws"
    }
  }
}

provider "aws" {
  region  = var.region
  profile = var.profile
}

resource "aws_s3_bucket" "a_bucket" {
  bucket = var.name

  tags = {
    Name        = var.name
    Environment = var.stage
  }
}

The ./dmark.config.yaml file:

runner: tofu

globals:
  stages:
    __all__:
      vars:
        region: sa-east-1
      backendConfig:
        region: sa-east-1
    dev:
      vars:
        stage: Dev
    staging:
      vars:
        stage: Staging
    prod:
      vars:
        stage: Prod

stacks:
  aBucketStack:
    path: ./src/a-bucket
    description: Just a example with bucket.
    order: 1
    local: true
    labels:
      - admin-only
    stages:
      __all__:
        vars:
          profile: default
      dev:
        vars:
          name: a-dev-bucket
      staging:
        vars:
          name: a-staging-bucket
      prod:
        vars:
          name: a-prod-bucket

The Dmark calls examples:

dmark plan
dmark apply
# ...or any other terraform command;
# it will run all stacks and stages in order!

# or can run a exclusive config:
dmark plan --stack aBucketStack --stage dev
dmark apply --stack aBucketStack --stage dev

Package Sidebar

Install

npm i dmark

Weekly Downloads

24

Version

1.1.0

License

MIT

Unpacked Size

109 kB

Total Files

69

Last publish

Collaborators

  • komutilo