Skip to content

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.

  1. Clone your team repo locally on your machine
  2. 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;
  1. Run the below bash script using terminal and enter Company, Team and Environment Names when asked.
bash <(curl -s https://docs.zlifecycle.com/scripts/getting_started.sh)
  1. 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"
  1. Commit and push this file to your team repository
  2. Go to Environments page on zLifecycle UI
  3. After a few mins you should see the new environment with the team & env name you entered getting provisioned
  4. It will start provisioning the images s3 bucket first and then videos s3 bucket
  5. Once it starts provisioning, you can click on the images component and open the right panel
  6. Right panel should show the terraform plan
  7. Once the status changes to Waiting For Approval you will need to approve the changes by clicking on the Approve button below the terraform plan (as shown in the image below) to start provisoning the images s3 bucket (which is terraform apply)

sample-right-panel

Teardown your first Environment

After you have provisioned your first environment, let's go through the teardown exercise.

  1. In the hello-world.yaml that you created in the Provision step above add a 'teardown' flag to true 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"
  1. Commit and push changes to your team repository
    • The teardown will start at the bottom most leaf node
  2. Approve the teardown plan when prompted
  3. Monitor the progress on zLifecycle UI