Hello World Environment¶
Set AWS Credentials¶
Make sure you set AWS Credentials that you want to use for provisioning your environment.
Provision your first Environment¶
After you have setup AWS Credentials, you will want to provision a simple environment to see how it works end to end.
- Clone your team repo locally on your machine
- Go to root directory of the team repo and create a new folder to represent your team called
hello-world
mkdir hello-world;
cd hello-world;
- Run the below bash script using terminal and enter
Company
,Team
andEnvironment
Names when asked.
bash <(curl -s https://docs.zlifecycle.com/scripts/getting_started.sh)
- It will create a env.yaml like below:
Click to expand!
apiVersion: stable.compuzest.com/v1
kind: Environment
metadata:
name: zmart-checkout-hello-world
namespace: zmart-config
spec:
teamName: checkout
envName: hello-world
components:
- name: images
type: terraform
module:
source: aws
name: s3-bucket
variables:
- name: bucket
value: "zmart-checkout-hello-world-images-abcde"
- name: videos
type: terraform
dependsOn: [images]
module:
source: aws
name: s3-bucket
variables:
- name: bucket
value: "zmart-checkout-hello-world-videos-vwxyz"
- Commit and push this file to your team repository
- Go to Environments page on zLifecycle UI
- After a few mins you should see the new environment with the team & env name you entered getting provisioned
- It will start provisioning the
images
s3 bucket first and thenvideos
s3 bucket - Once it starts provisioning, you can click on the
images
component and open the right panel - Right panel should show the terraform plan
- Once the status changes to
Waiting For Approval
you will need to approve the changes by clicking on theApprove
button below the terraform plan (as shown in the image below) to start provisoning theimages
s3 bucket (which is terraform apply)
Teardown your first Environment¶
After you have provisioned your first environment, let's go through the teardown exercise.
- In the
hello-world.yaml
that you created in the Provision step above add a 'teardown' flag totrue
at the spec level which will apply to all of the environment's components in the file. See example below.
Click to expand!
apiVersion: stable.compuzest.com/v1
kind: Environment
metadata:
name: zmart-checkout-hello-world
namespace: zmart-config
spec:
teamName: checkout
envName: hello-world
teardown: true
components:
- name: images
type: terraform
module:
source: aws
name: s3-bucket
variables:
- name: bucket
value: "zmart-checkout-hello-world-images-abcde"
- name: videos
type: terraform
dependsOn: [images]
module:
source: aws
name: s3-bucket
variables:
- name: bucket
value: "zmart-checkout-hello-world-videos-vwxyz"
- Commit and push changes to your team repository
- The teardown will start at the bottom most leaf node
- Approve the teardown plan when prompted
- Monitor the progress on zLifecycle UI