Configure AWS CodeStar project

Setting up an AWS CodeStar project

  1. Access to AWS VPC dashboard.

VPC

  1. Select Your VPCs. We should see a VPC named Module2/DevAxNetworkVPC.

VPC

  1. Select Subnets on the left menu và filter by VPC ID of Module2/DevAxNetworkVPC VPC ở menu bên trái và lọc theo VPC ID của VPC Module2/DevAxNetworkVPC. We should see 4 subnets - 2 privates and 2 public.

VPC

  1. Open CodeStar dashboard. Select Create project.

NewProjectCodeStar

  1. We should see many project template.

NewProjectCodeStar

If you see a message related to the missing service role. Select Create service role

6. Cause our monolith is written by Java and we are going to deploy an application, in the search panel, select the options:

  • AWS Elastic Beanstalk
  • Web Application
  • Java

This will list the template tags that match the request - select the tag Java Spring - Web Application

NewProjectCodeStar

  1. In the next page, enter TravelBuddy for Project name.
  2. In repository section, make sure that CodeCommit is selected and repository name (Travel Buddy) is auto filled.

NewProjectCodeStar

  1. In EC2 Configuration section, select t3.medium for Instance Type
  2. Select vpc match the VPC name of the exercise.
  3. Select Subnet is public subnet id seen above.
  4. Select KPforDevAxInstances keypair.
  5. Select Next

NewProjectCodeStar

  1. Select Create Project

NewProjectCodeStar

  1. The CodeStar will start creating a pipeline. After a few minutes, the new project is displayed.

NewProjectCodeStar

  1. While waiting for project creation completed, explore the IDE tab and learn how to access the project source code.

NewProjectCodeStar

  1. On the left menu, select Team.
  2. Select Add team member.

Addmember

  1. We will add an existing user awsstudent. In the Select user section, select awsstudent
  2. CodeStar requires members to have an email address. Therefore, remember to add an email address for the user.
  3. In Role Type section, select Owner.
  4. Select Remote Access.
  5. Click Add team member.

Addmember

  1. Next, we will create a new user. Click Add team member.
  2. In User section, select Create new IAM user. This will redirect you to IAM Management to create a user.

CreateNewMember

  1. In IAM Management Console, enter user-lab02 for username, select both access types: Programmatic access and AWS Management Console access.
  2. Click Next: Permissions.

CreateNewMember

  1. Select Attach existing policies directly and select AdministratorAccess.
  • Chọn Next: Tags

CreateNewMember

  1. Click Next: Tags, tag the user if needed or click Next: Review to review the configure.

CreateNewMember

  1. Click Create User and

CreateNewMember

  1. Click Download .csv file to download file that contains a secret key and an access key.This information will be used in the following part.
  • Click Close and back to CodeStar page.

CreateNewMember

  1. Click refresh symbol to refresh user list, select user-lab02 just created
  2. Enter email for user, select Owner in Project role section, tick Remote Access and click Add team member .

AddNewMember

  1. Now, we will create credentials to use for Codecommit for the newly created user. Access to IAM console. Select Users on the left menu.
  2. Click newly created user

CredentialforCodecommit

  1. Select Security Credentials tab.

CredentialforCodecommit

  1. Scroll down to HTTPS Git credentials for AWS CodeCommit section and click Generate Credentials

CredentialforCodecommit

  1. Click Download credentials, then click Close.

CredentialforCodecommit

CodeStar has now configured a CI/CD pipeline to deliver our project artefact to a public Elastic Beanstalk PaaS web server. This will take a few minutes, check the link in the path and click this link and check the your new java HelloWorld application has been created.

  1. Access CodeStar and select Projects
  2. Select TravelBuddy, then select Pipeline tab. Bạn sẽ thấy 3 giai đoạn được tạo Source, Build và Deploy.

CodeStarProject

  1. You can click View application in the upper right corner to access to your running application.

CodeStarProject