Skip to content

Commit

Permalink
doc updates
Browse files Browse the repository at this point in the history
  • Loading branch information
spyoungtech committed Aug 23, 2024
1 parent ae971d3 commit 1b2fb84
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 70 deletions.
2 changes: 1 addition & 1 deletion doc-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
mkdocs
mkdocs-material
pymdown-extensions
pymdown-extensions
1 change: 0 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@
Level4 is a tool and framework for enterprise IAC management, written for Developers and DevOps teams, by developers and DevOps teams.

Note that Level4 is currently in the very early stages of development. Expect major changes.

5 changes: 2 additions & 3 deletions docs/usage/environments.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Environment providers

An "environment" describes where solutions live.
An environment _provider_ It also controls many of the default behaviors for how CDK constructs are created, for example
An "environment" describes where solutions live.
An environment _provider_ It also controls many of the default behaviors for how CDK constructs are created, for example
default VPCs, subnets, clusters, etc.


Expand All @@ -13,4 +13,3 @@ Environment providers must define at least:
## Writing a custom provider

...

1 change: 0 additions & 1 deletion docs/usage/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ necessary leverage to make deploying individual solutions effortless.

Manifests describe all the related resources you use in each individual solution you have. There's a lot of flexibility
in how much or how little you describe with your manifests.

86 changes: 22 additions & 64 deletions docs/usage/usage.md
Original file line number Diff line number Diff line change
@@ -1,89 +1,47 @@
# Quickstart


## Write a simple manifest

Here, we'll just create a simple manifest with one resource, an S3 bucket.
## Prerequisites

```yaml
version: "1"
resources:
buckets:
mybucket:
bucket_name: "hello-iae"
```
Level4 is built on top of AWS CDK, so if you haven't already, you'll want to install nodejs and [install the AWS CDK](https://docs.aws.amazon.com/cdk/v2/guide/getting_started.html)

```bash
npm install -g aws-cdk
```

## Deploy a CDK app using the manifest
You will also need an AWS account and have your credentials configured


IAE is built on top of AWS CDK, so if you haven't already, you'll want to [install the AWS CDK](https://docs.aws.amazon.com/cdk/v2/guide/getting_started.html).
### Install level4

<details>
<summary>start cdk app project</summary>
`level4` can be installed using `pip`.

```bash
pip install level4
```


## Start a new project

Starting a new level4 project is very similar to starting a CDK project (under the hood, it really is a CDK project).

```
mkdir myproject
cd myproject
cdk init --language=python app
python -m level4 init
```

Next, activate the virtualenv (`.venv` by default) created by the cdk and install `iae`

Next, activate the virtualenv (`.venv` by default) that was created in your project directory


=== "Linux/MacOS"
```bash
source .venv/bin/activate
pip install iae
```

=== "Windows"
```powershell
.venv\Scripts\activate
pip install iae

</details>


In a typical CDK app, normally you might have something like this:


```python
import aws_cdk as cdk
app = cdk.App()

class MyStack(cdk.Stack):
def __init__(self, scope, id, **kwargs):
super().__init__(scope, id, **kwargs)
# start defining constructs here

# ...

production = cdk.Environment(account='abc123', region='us-east-1')
stack = MyStack(app, 'mystack', env=production)

app.synth()
```



In `iae`, you'll do something similar, but we will instantiate our stack and describe our environment slightly differently:

```python
import aws_cdk as cdk
from level4 import ManifestStack, EnvironmentProvider
app = cdk.App()
class MyStack(ManifestStack):
...

production = EnvironmentProvider(environment_name='production', account='abc213', region='us-east-1')

stack = MyStack.from_manifest_file(app, 'path/to/mymanifest.iae.yaml', provider=production)

app.synth()
```

We can synth/diff/deploy/destroy your stack, just like any other CDK app.

```bash
cdk synth
```
```

0 comments on commit 1b2fb84

Please sign in to comment.