diff --git a/doc-requirements.txt b/doc-requirements.txt index 51b61b7..f79c751 100644 --- a/doc-requirements.txt +++ b/doc-requirements.txt @@ -1,3 +1,3 @@ mkdocs mkdocs-material -pymdown-extensions \ No newline at end of file +pymdown-extensions diff --git a/docs/index.md b/docs/index.md index 70f1beb..725194c 100644 --- a/docs/index.md +++ b/docs/index.md @@ -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. - diff --git a/docs/usage/environments.md b/docs/usage/environments.md index 9f7ca26..e308e44 100644 --- a/docs/usage/environments.md +++ b/docs/usage/environments.md @@ -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. @@ -13,4 +13,3 @@ Environment providers must define at least: ## Writing a custom provider ... - diff --git a/docs/usage/overview.md b/docs/usage/overview.md index ae52507..0623f65 100644 --- a/docs/usage/overview.md +++ b/docs/usage/overview.md @@ -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. - diff --git a/docs/usage/usage.md b/docs/usage/usage.md index e71fe84..69a39f6 100644 --- a/docs/usage/usage.md +++ b/docs/usage/usage.md @@ -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 -
-start cdk app project +`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 - -
- - -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 -``` + ```