> For the complete documentation index, see [llms.txt](https://fredericheem.gitbook.io/starhackit/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://fredericheem.gitbook.io/starhackit/deployment/grucloud-aws.md).

# Deploy Infrastructure with GruCloud

This directory contains the code to deploy and destroy the instructure on AWS with [grucloud](https://grucloud.com).

The following resources are defined in [iac](https://github.com/FredericHeem/starhackit/tree/5387a32ab753e65b62145acca55123fb5c7b5fc8/deploy/grucloud-aws/iac.js):

![resource-mindmap](https://3715266525-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M2gucNmlg9pt7OcEXxQ%2Fsync%2Fde96534ec6e6a13f02f7ded34cadec2699bf9e59.svg?generation=1628176300268776\&alt=media)

> Mindmap generated by `gc tree`

Visit [AwsRequirements](https://www.grucloud.com/docs/aws/AwsRequirements) and ensure the *aws cli* is configured properly.

Edit [config.js](https://github.com/FredericHeem/starhackit/tree/5387a32ab753e65b62145acca55123fb5c7b5fc8/deploy/grucloud-aws/config.js) and change the domain name and the key pair name.

Install the *gc CLI* globally:

```bash
npm i -g @grucloud/core
```

Install the dependencies

```bash
npm i
```

Generate a graph of the infrastructure:

```bash
gc graph
```

![Graph](https://github.com/FredericHeem/starhackit/tree/5387a32ab753e65b62145acca55123fb5c7b5fc8/deploy/grucloud-aws/artifacts/diagram-target.svg)

Deploy the infrastructure with:

```bash
gc apply
```

List the running resources:

```bash
gc list
```

Destroy the running resources:

```bash
gc destroy
```
