stackql-deploy 2.2.0

Infrastructure-as-code framework for declarative cloud resource management using StackQL
# `stackql-deploy` starter project for `aws`


> for starter projects using other providers, try `stackql-deploy init infrastructure/sqlserver/ --provider=azure` or `stackql-deploy init infrastructure/sqlserver/ --provider=google`

see the following links for more information on `stackql`, `stackql-deploy` and the `awscc` provider:

- [`awscc` provider docs]https://awscc.stackql.io/providers/awscc/
- [`stackql`]https://github.com/stackql/stackql
- [`stackql-deploy` GitHub repo]https://github.com/stackql/stackql-deploy-rs

## Overview


__`stackql-deploy`__ is a stateless, declarative, SQL driven Infrastructure-as-Code (IaC) framework.  There is no state file required as the current state is assessed for each resource at runtime.  __`stackql-deploy`__ is capable of provisioning, deprovisioning and testing a stack which can include resources across different providers, like a stack spanning `aws` and `azure` for example.

## Prerequisites


This example requires `stackql-deploy` to be installed.  The host used to run `stackql-deploy` needs the necessary environment variables set to authenticate to your specific provider, in the case of `aws`, `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY` and optionally `AWS_SESSION_TOKEN` must be set, for more information on authentication to `aws` see the [`awscc` provider documentation](https://awscc.stackql.io/providers/awscc/).

## Usage


Adjust the values in the [__`stackql_manifest.yml`__](stackql_manifest.yml) file if desired.  The [__`stackql_manifest.yml`__](stackql_manifest.yml) file contains resource configuration variables to support multiple deployment environments, these will be used for `stackql` queries in the `resources` folder.

The syntax for the `stackql-deploy` command is as follows:

```bash
stackql-deploy { build | test | teardown } { stack-directory } { deployment environment} [ optional flags ]
```

### Deploying a stack


For example, to deploy the stack named infrastructure/sqlserver/ to an environment labeled `sit`, run the following:

```bash
target/release/stackql-deploy build examples/aws/sqlserver dev \
-e DB_MASTER_PASSWORD=${DB_MASTER_PASSWORD}
```

Use the `--dry-run` flag to view the queries to be run without actually running them, for example:

```bash
stackql-deploy build infrastructure/sqlserver/ sit \
-e AWS_REGION=us-east-1 \
--dry-run
```

### Testing a stack


To test a stack to ensure that all resources are present and in the desired state, run the following (in our `sit` deployment example):

```bash
stackql-deploy test infrastructure/sqlserver/ sit \
-e AWS_REGION=us-east-1
```

### Tearing down a stack


To destroy or deprovision all resources in a stack for our `sit` deployment example, run the following:

```bash
stackql-deploy teardown infrastructure/sqlserver/ sit \
-e AWS_REGION=us-east-1
```