Skip to content

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
  • Labs icon Lab
  • A Cloud Guru
Google Cloud Platform icon
Labs

Deploying Custom Code with a CI/CD Pipeline Using AWS CodeStar

After using CodeStar and deploying a built-in template from AWS, you want to deploy your own project, as well as provide a project environment your team members can use to collaborate on the project. In this hands-on lab, you will use the CLI to deploy your own custom code directly into the start of a AWS CodeStar project.

Google Cloud Platform icon
Labs

Path Info

Level
Clock icon Intermediate
Duration
Clock icon 1h 0m
Published
Clock icon Nov 20, 2019

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.

Table of Contents

  1. Challenge

    Launch the Lab's CLI Environment

    1. In the AWS console, navigate to Systems Manager.

    2. From the left-hand menu, select Session Manager.

    3. Click Start Session.

    4. Select the only EC2 instance in the list (it should be named ssm-cli-instance), and click Start session.

    5. Verify you are connected to an SSH session. Type the command (and see this response):

      whoami
      ssm-user
      
  2. Challenge

    Clone the GitHub Repo onto the EC2 Instance

    This task uses the SSH capability launched in the previous task.

    1. Navigate to the home folder for the current user:

      cd ~
      
    2. Use the git command to clone the repo:

      git clone https://github.com/ACloudGuru-Resources/content-aws-developertools
      
    3. Navigate into the folder containing the resources for this lab:

      cd content-aws-developertools
      cd Deploy-custom-code-with-a-CI_CD-pipline-using-AWS-CodeStar
      
    4. Perform a directory listing to ensure you have the files we need:

      ls -l
      
  3. Challenge

    Create an S3 Bucket and Copy the Source Files

    Note: Prior to this task, ensure you have downloaded the resource files for this lab from the lab GitHub page here.

    1. In the AWS console, navigate to S3.
    2. Create a bucket.
    3. Select the bucket you just created.
    4. Select Upload, then Add files, and select the following files:
      • mytoolchain.yml
      • mysrc.zip
  4. Challenge

    Use the CLI to Create a AWS CodeStar Project

    This task uses the SSH capability launched in the previous task.

    1. Ensure you are in the folder with the resource files for this lab:

      cd content-aws-developertools
      cd Deploy-custom-code-with-a-CI_CD-pipline-using-AWS-CodeStar
      
    2. Edit the myinput.json file with vi:

      vi myinput.json
      
    3. Replace the placeholder values in the file with the values created so far in this lab:

      • [BUCKET-NAME]: The name of the bucket created earlier in the lab

      • [VPC-ID]: The ID of the VPC within this lab environment

      • [SUBNET-ID]: The ID of one of the subnets within the VPC in this lab environment

      • [AWS-CODESTAR-SERVICE-ROLE]: The role ARN, which is obtained as follows:

        1. In a new tab, navigate to the CodeStar console.
        2. Select Start a project.
        3. In the dialog window, select Yes, create role.
        4. Navigate to the AWS IAM console page.
        5. Select Roles from the left-hand menu.
        6. From the list of roles, select aws-codestar-service-role.
        7. Copy the ARN of the role, and enter it into myinput.json.
      • Save the file in vi with :w and quit with :q.

    4. In the terminal, run the following command to create the AWS CodeStar project:

      aws codestar create-project --cli-input-json file://myinput.json --region us-east-1
      
  5. Challenge

    Review the Project and the Deployed Website

    1. In the AWS console, navigate to CodeStar.
    2. Select the Lab Demo project.
    3. Review the project.
    4. Navigate to EC2, locate the lab-demo instance, copy its public IP address, and enter this as an address into your web browser.

The Cloud Content team comprises subject matter experts hyper focused on services offered by the leading cloud vendors (AWS, GCP, and Azure), as well as cloud-related technologies such as Linux and DevOps. The team is thrilled to share their knowledge to help you build modern tech solutions from the ground up, secure and optimize your environments, and so much more!

What's a lab?

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Provided environment for hands-on practice

We will provide the credentials and environment necessary for you to practice right within your browser.

Guided walkthrough

Follow along with the author’s guided walkthrough and build something new in your provided environment!

Did you know?

On average, you retain 75% more of your learning if you get time for practice.

Start learning by doing today

View Plans