# @ef-class/infra-cli

> infrastucture command-line developer tools

Latest version **1.1.14** (published 2019-09-24) · ISC license · 0 weekly downloads

## Install

```sh
npm install @ef-class/infra-cli
pnpm add @ef-class/infra-cli
yarn add @ef-class/infra-cli
bun add @ef-class/infra-cli
```

Provides the command `infra-cli`.

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.14 |
| Published | 2019-09-24 |
| First published | 2019-07-01 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 27 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | cookiescrumbs |
| Maintainers | ef-class |

## Links

- npm: https://www.npmjs.com/package/@ef-class/infra-cli
- npm.io page: https://npm.io/package/@ef-class/infra-cli

## Dependencies (5)

- [shelljs](https://npm.io/package/shelljs.md) ^0.8.3
- [commander](https://npm.io/package/commander.md) ^2.20.0
- [@types/shelljs](https://npm.io/package/@types/shelljs.md) ^0.8.5
- [json-templater](https://npm.io/package/json-templater.md) ^1.2.0
- [@ef-class/web-infrastructure](https://npm.io/package/@ef-class/web-infrastructure.md) ^1.2.6

## Recent versions

- 1.1.14 (latest) — 2019-09-24
- 1.1.13 — 2019-09-24
- 1.1.11 — 2019-08-07
- 1.1.10 — 2019-08-07
- 1.1.9 — 2019-08-01
- 1.1.8 — 2019-07-31
- 1.1.7 — 2019-07-30
- 1.1.6 — 2019-07-30
- 1.1.5 — 2019-07-30
- 1.1.4 — 2019-07-17
- 1.1.3 — 2019-07-17
- 1.1.2 — 2019-07-17
- 1.1.1 — 2019-07-17
- 1.1.0 — 2019-07-16
- 1.0.9 — 2019-07-16
- … 8 more at https://npm.io/package/@ef-class/infra-cli/versions

## README

# infra-cli

`npm install -g @ef-class/infra-cli`


## infrastructure teardown
- `infra-cli teardown --app {{app}} --branch {{branch}}`
  - delete the CloudFront CDNs for the apps
  - delete the domains for the apps

## infrastructure create
- `infra-cli create --acc {{account}}  --app {{app}} --branch {{branch}}`
  - create the CloudFront CDNs for the apps
  - create the domains for the apps


### infrasturcture check
- `infra-cli check --acc {{account}}  --app {{app}} --branch {{branch}}`
    - checks the Terrafrom script is correct


`--app` Can be have a vlaue of '*' which equates to all the apps in the config or it can be a listy 'a,b,c' or it can be a single app 'a'


### Config file

You will need to create this config file and add it to the root of the project.

`infra.config.json` 

``` json
{
    "devel": { 
        "account": "devel",
        "apps": ["accounts", "student", "teacher", "static", "lesson-item-renderer", "design-system"],
        "state": {
            "bucket": "ctx-terraform-state-devel",
            "dir": "devel/fe_features",
            "region": "eu-west-1"
        },
        "aws": {
            "secret": "{{aws secrect}}",
            "key": "{{aws key}}",
            "region": "eu-west-1"
        },
        "terraform": { 
            "delimiter": "o",
            "domain": "ctx.ef.com",
            "s3": {
                "bucket": "ef-class-web-devel",
                "loggingPrefix": "logs/cloudfront/",
                "originAccessIdentity": "origin-access-identity/cloudfront/E3N3GP1T23HRMI" 
            },
            "r53": { 
                "zoneId": "ZVRF914X2I9LY"                
            },
            "cf": { 
                "amcCert": "arn:aws:acm:us-east-1:817216657652:certificate/c6c4616d-0f8d-492e-bf1e-9d66c17e3730"
            }
        }
    }
}

```

## Usage 

`cd ef-class/ef-class-web`

`infra-cli --help` 

`infra-cli teardown --help` 
`infra-cli create --help` 
`infra-cli check --help` 


## Development

`npm run test` to run the tests. This command first builds then runs the tests.

`npm run refresh` to install the cli locally for manual testing. You can run this command after a code update and it'll build and reinstall the npm package for the cli locally.

`npm run build` transpiles the ts to js.

---
_Source: https://npm.io/package/@ef-class/infra-cli · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
