# @nekonomokochan/terraform-config-creator

> Create terraform config files

Latest version **2.0.2** (published 2020-01-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install @nekonomokochan/terraform-config-creator
pnpm add @nekonomokochan/terraform-config-creator
yarn add @nekonomokochan/terraform-config-creator
bun add @nekonomokochan/terraform-config-creator
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.2 |
| Published | 2020-01-19 |
| First published | 2019-01-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 15.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | nekonomokochan |
| Maintainers | nekonomokochan |
| Keywords | terraform, backend.tf, provider.tf |

## Links

- npm: https://www.npmjs.com/package/@nekonomokochan/terraform-config-creator
- Repository: https://github.com/nekonomokochan/terraform-config-creator
- Homepage: https://github.com/nekonomokochan/terraform-config-creator#readme
- Issues: https://github.com/nekonomokochan/terraform-config-creator/issues
- npm.io page: https://npm.io/package/@nekonomokochan/terraform-config-creator

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 2.0.2 (latest) — 2020-01-19
- 2.0.1 — 2019-07-14
- 2.0.0 — 2019-06-14
- 1.0.1 — 2019-06-13
- 1.0.0 — 2019-01-11

## README

# terraform-config-creator
[![npm version](https://badge.fury.io/js/%40nekonomokochan%2Fterraform-config-creator.svg)](https://badge.fury.io/js/%40nekonomokochan%2Fterraform-config-creator)
[![Build Status](https://travis-ci.org/nekonomokochan/terraform-config-creator.svg?branch=master)](https://travis-ci.org/nekonomokochan/terraform-config-creator)
[![Coverage Status](https://coveralls.io/repos/github/nekonomokochan/terraform-config-creator/badge.svg?branch=master)](https://coveralls.io/github/nekonomokochan/terraform-config-creator?branch=master)

Create terraform config files

# Getting Started

## Install npm package

### yarn
`yarn add @nekonomokochan/terraform-config-creator`

### npm
`npm install --save @nekonomokochan/terraform-config-creator`

# How To Use

## Use With TypeScript

### createS3Backend

```typescript
import { createS3Backend } from "@nekonomokochan/terraform-config-creator";

(async () => {
  const params = {
    outputPath: "./",
    backendParams: {
      requiredVersion: "0.11.10",
      backend: {
        bucket: "dev-tfstate",
        key: "network/terraform.tfstate",
        region: "ap-northeast-1",
        profile: "nekochans-dev"
      }
    },
    remoteStateList: [
      {
        name: "network",
        bucket: "dev-tfstate",
        key: "env:/${terraform.env}/network/terraform.tfstate",
        region: "ap-northeast-1",
        profile: "nekochans-dev"
      },
      {
        name: "bastion",
        bucket: "dev-tfstate",
        key: "env:/${terraform.env}/bastion/terraform.tfstate",
        region: "ap-northeast-1",
        profile: "nekochans-dev"
      }
    ]
  };
  
  await createS3Backend(params);
})();
```

`backend.tf` is created in your current directory.

```hcl-terraform
terraform {
  required_version = "0.11.10"

  backend "s3" {
    bucket  = "dev-tfstate"
    key     = "network/terraform.tfstate"
    region  = "ap-northeast-1"
    profile = "nekochans-dev"
  }
}

data "terraform_remote_state" "network" {
  backend = "s3"

  config {
    bucket  = "dev-tfstate"
    key     = "env:/${terraform.env}/network/terraform.tfstate"
    region  = "ap-northeast-1"
    profile = "nekochans-dev"
  }
}

data "terraform_remote_state" "bastion" {
  backend = "s3"

  config {
    bucket  = "dev-tfstate"
    key     = "env:/${terraform.env}/bastion/terraform.tfstate"
    region  = "ap-northeast-1"
    profile = "nekochans-dev"
  }
}
```

### createAwsProvider

```typescript
import { createAwsProvider } from "@nekonomokochan/terraform-config-creator";

(async () => {
  const params = {
    outputPath: "./",
    awsProviderParams: [
      {
        version: "=1.54.0",
        region: "ap-northeast-1",
        profile: "nekochans-dev"
      },
      {
        version: "=1.54.0",
        region: "us-east-1",
        profile: "nekochans-dev",
        alias: "us_east_1"
      }
    ]
  };

  await createAwsProvider(params);
})();
```

`provider.tf` is created in your current directory.

## Use With JavaScript

### createS3Backend

```javascript
(async () => {
  "use strict";

  const terraformConfigCreator = require("@nekonomokochan/terraform-config-creator");

  const params = {
    outputPath: "./",
    backendParams: {
      requiredVersion: "0.11.10",
      backend: {
        bucket: "dev-tfstate",
        key: "network/terraform.tfstate",
        region: "ap-northeast-1",
        profile: "nekochans-dev"
      }
    },
    remoteStateList: [
      {
        name: "network",
        bucket: "dev-tfstate",
        key: "env:/${terraform.env}/network/terraform.tfstate",
        region: "ap-northeast-1",
        profile: "nekochans-dev"
      },
      {
        name: "bastion",
        bucket: "dev-tfstate",
        key: "env:/${terraform.env}/bastion/terraform.tfstate",
        region: "ap-northeast-1",
        profile: "nekochans-dev"
      }
    ]
  };

  await terraformConfigCreator.createS3Backend(params);
})();
```

`backend.tf` is created in your current directory.

### createAwsProvider

```javascript
(async () => {
  "use strict";

  const terraformConfigCreator = require("@nekonomokochan/terraform-config-creator");

  const params = {
    outputPath: "./",
    awsProviderParams: [
      {
        version: "=1.54.0",
        region: "ap-northeast-1",
        profile: "nekochans-dev"
      },
      {
        version: "=1.54.0",
        region: "us-east-1",
        profile: "nekochans-dev",
        alias: "us_east_1"
      }
    ]
  };

  await terraformConfigCreator.createAwsProvider(params);
})();
```

`provider.tf` is created in your current directory.

# License
MIT

---
_Source: https://npm.io/package/@nekonomokochan/terraform-config-creator · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
