-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ae971d3
commit 1b2fb84
Showing
5 changed files
with
25 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
mkdocs | ||
mkdocs-material | ||
pymdown-extensions | ||
pymdown-extensions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
``` | ||
``` |