Hello, World! Environment¶
Make sure you've completed configuring AWS Credentials and onboarded a team before starting this walkthrough.
1. Create a hello-world
directory in the cloned repo
1. Clone the team repo (zl-[team-name]-config
) you created in onboarding a team
Company
, Team
and Environment
Names when asked.
1. It will create the following hello-world.yaml
:
Click to expand!
apiVersion: stable.cloudknit.io/v1
kind: Environment
metadata:
name: company-hello-world
namespace: company-config
spec:
teamName: your-team
envName: hello-world
components:
- name: images
type: terraform
module:
source: aws
name: s3-bucket
variables:
- name: bucket
value: "company-hello-world-images-abcde"
- name: videos
type: terraform
dependsOn: [images]
module:
source: aws
name: s3-bucket
variables:
- name: bucket
value: "company-hello-world-videos-vwxyz"
- Commit the changes and push to Github
- Go to Environments page on CloudKnit UI
- After a few minutes you should see your new environment
- It will provision the
images
s3 bucket first, thenvideos
s3 bucket
- Once it starts provisioning, click on the
images
component - You should see the provision plan in the right panel
- Once the plan finishes you need to approve the changes by clicking
Approve
below the terraform plan (as shown in the image below) - This will start provisoning the
images
s3 bucket (which is terraform apply)
Teardown your first Environment¶
After you have provisioned your first environment, let's go through the teardown exercise.
You can read more about teardown
here.
-
Add
teardown: true
inhello-world.yaml
at thespec
level. See example below:
Click to expand!
apiVersion: stable.cloudknit.io/v1 kind: Environment metadata: name: zmart-hello-world namespace: zmart-config spec: teamName: your-team envName: hello-world teardown: true # Add this components: - name: images type: terraform module: source: aws name: s3-bucket variables: - name: bucket value: "zmart-hello-world-images-abcde" - name: videos type: terraform dependsOn: [images] module: source: aws name: s3-bucket variables: - name: bucket value: "zmart-hello-world-videos-vwxyz"
-
Commit and push changes to Github
- The teardown will start at the bottom most leaf node
- Approve the teardown plan when prompted
- Monitor the progress on CloudKnit UI