AWS Developer Services: Console Lab Guide

titleAWS Developer Services: Gold-Standard Console Lab Guide
subtitleCodeCommit • CodeArtifact • CodeBuild • CodeDeploy • CodePipeline
authorInstructor Edition | Browser-Only Labs
date10 November 2026
langen-US

Course navigation

LabAWS servicePractical result
1CodeCommitCreate a browser-authored repo, branch, PR and merge
2CodeArtifactConfigure a private npm repository and public upstream
3CodeBuildResolve dependencies, test, create a deployable ZIP
4CodeDeployDeploy the tested ZIP to AL2023 EC2 without SSH
5CodePipelineAutomate commit-triggered build and deployment

Instructor’s quick start

Course outcome. Complete five connected, independently verifiable labs that take one small web application from source control through dependency acquisition, automated build and tests, manual deployment, and change-triggered continuous delivery. All user interactions take place in web browsers and the AWS Management Console. Learners never use a terminal, AWS CLI, CloudShell, Session Manager shell, or local Git client. The supplied build and deployment scripts execute automatically inside managed AWS services; they are configuration files, not manual lab commands.

Source starting point. The lab adapts the idea of the official AWS GitHub repository aws-samples/aws-codedeploy-samples, specifically applications/SampleApp_Linux, into an Amazon Linux 2023-friendly static website with a meaningful Node.js build using an npm package from CodeArtifact. Original sample: https://github.com/aws-samples/aws-codedeploy-samples/tree/master/applications/SampleApp_Linux . This manual uses a separately provided AWS_Developer_Services_Console_Lab_Source.zip, whose text files are created in CodeCommit through the browser. The GitHub repository is the provenance/reference; the ZIP is the modernized educational derivative.

Currency and verification disclosure. Research checked AWS’s publicly available CodeCommit, CodeArtifact, CodeBuild, CodeDeploy, Systems Manager and CodePipeline instructions on 10 November 2026. The source tree, JSON, YAML and shell syntax were inspected offline. AWS account-specific execution, current live console screenshots and end-to-end runtime outcomes have not been verified: no access to a training AWS account was provided, and package installation from npm could not be exercised in the authoring environment. AWS can change field labels, Region availability, defaults and wizard ordering. Follow the named AWS documentation links in the final section whenever a screen differs. No simulated screenshots are presented as real console evidence.

Important service status. AWS announced on 24 November 2025 that CodeCommit returned to general availability for new customers. Do not follow older training materials claiming it is closed to new customers. Current CodePipeline documentation uses the Build custom pipeline creation choice and a V2 pipeline experience. [AWS01][AWS02]

Architecture at a glance

GitHub sample (reference)
         |
         v  Copy modernized source files through CodeCommit browser editor
AWS CodeCommit (main)
         |
         +--> CodePipeline Source stage --> CodeBuild Build stage --> CodeDeploy Deploy stage
                                             |                      |
                    AWS CodeArtifact <-------+                      v
                     npm upstream                           Amazon EC2 (AL2023)
                    [lodash 4.17.21]                          Apache web server
                                             |
                               build release ZIP: appspec.yml,
                               index.html, scripts/*

The same release ZIP is first deployed manually from Amazon S3 during Lab 4. Later, CodePipeline passes CodeBuild’s output artifact directly to CodeDeploy in Lab 5; do not deploy the unbuilt CodeCommit source artifact, because index.html contains build-time template placeholders.

Time, cost and prerequisites

ItemRequirement or recommendation
Course duration4–6 hours instructor-led; 6–8 hours for first-time learners, excluding provisioning delays
AWS accountNonproduction, disposable training account preferred; access to IAM, EC2, CodeCommit, CodeArtifact, CodeBuild, CodeDeploy, CodePipeline, Systems Manager, S3 and CloudWatch
User permissionsA training-admin or an approved permission set capable of creating IAM roles/policies and passing them to AWS services; no root-user access
RegionAsia Pacific (Tokyo), ap-northeast-1, throughout; use another common Region only after adapting all Region references
NetworkDefault VPC with at least one public subnet and outbound internet, EC2 auto-assigned public IPv4, Systems Manager connectivity and HTTP/80 access from learner’s current public IP
BrowserCurrent Chrome, Edge, Firefox or Safari with downloads and clipboard enabled
DownloadsAWS_Developer_Services_Console_Lab_Source.zip and this manual; extract ZIP locally using the operating system’s file manager (no terminal)
CostNot free by default. EC2 compute, EBS, public IPv4, CodeBuild, CodeArtifact, CodePipeline, S3, CloudWatch and requests may incur charges; charges vary by account/Region/usage. Clean up same day.
SecurityPersonal training account, least privileges where practical, S3 Block Public Access ON, EC2 TCP/80 from My IP only, no SSH needed, never store credentials in Git

Start-of-class gate. Open the AWS account menu, record the 12-digit account ID, and verify the Region Asia Pacific (Tokyo) is displayed in each console. If a default VPC is absent, ask the instructor to supply a VPC with a public subnet and an internet route; do not create a public EC2 target in a private subnet by mistake. All example resource names are illustrative and should be kept consistent throughout.

Fixed naming worksheet — complete before opening Lab 1

ResourceName/value used in this guideRecord actual value
Regionap-northeast-1__________________
AWS account ID12-digit AWS account ID__________________
CodeCommit repositoryawsdevlab-webapp__________________
CodeCommit branchmain__________________
CodeArtifact domainawsdevlab__________________
CodeArtifact downstream repositoryweb-npm__________________
CodeArtifact public upstreamnpm-store__________________
CodeBuild projectawsdevlab-web-build__________________
S3 standalone artifact bucketawsdevlab-artifacts-ACCOUNTID-apne1 (replace ACCOUNTID)__________________
IAM EC2 instance roleawsdevlab-ec2-role__________________
IAM CodeDeploy service roleawsdevlab-codedeploy-role__________________
EC2 instance Name tagawsdevlab-web-ec2__________________
EC2 security groupawsdevlab-http-sg__________________
CodeDeploy applicationawsdevlab-web-app__________________
CodeDeploy deployment groupawsdevlab-web-ec2__________________
CodePipeline pipelineawsdevlab-web-pipeline__________________
CodePipeline artifact bucketCreated by pipeline wizard; record later__________________

Naming note. S3 bucket names are globally unique. If the proposed bucket name is unavailable, append a short suffix and update every reference to that bucket. Avoid changing the fixed CodeArtifact names unless you also edit buildspec.yml through CodeCommit’s browser editor.


Lab 1 — AWS CodeCommit: store and review the application

Objective. Create a Git repository, populate it with the modernized GitHub-derived application, browse commit history, and complete one browser-only branch and pull request workflow.

Before you begin. Sign in with the assigned training IAM Identity Center role or IAM identity; Region is ap-northeast-1. Download and extract the provided source ZIP using the graphical file manager. Have a name and contact email available for commit metadata (not credentials).

1.1 Create the repository

  1. In the AWS Console search bar, search CodeCommit and open the service (direct link: https://console.aws.amazon.com/codecommit/ ).
  2. Check the Region selector in the top bar: choose Asia Pacific (Tokyo).
  3. In the left navigation choose Repositories; select Create repository.
  4. In Repository name, enter awsdevlab-webapp.
  5. In Description, enter Browser-only AWS developer tools training application.
  6. Keep repository encryption at the AWS-managed/default setting offered by your account. Do not configure CodeGuru or optional integrations for this lab unless your console mandates a setting.
  7. Choose Create. Wait for the new repository’s detail page to open.
  8. Select its Code view. An empty-repository prompt is expected: there is no default branch until your first browser-created commit.

Checkpoint CC-1: Repositories lists awsdevlab-webapp. Copy its HTTPS clone URL only as reference; do not open a terminal or clone it.

1.2 Add the application using only the CodeCommit web editor

  1. From the repository’s Code tab, choose Add file → Create file. Open README.md from the extracted source folder in a graphical text editor; copy all its contents into the CodeCommit editor; enter File name README.md.
  2. Fill Author name, Email address, and Commit message (for example, Add lab README). Select Commit changes. The console creates the main branch for the first commit in a new repository.
  3. Return to the repository’s Code tab and confirm the branch drop-down shows main. For each file below, repeat Add file → Create file, paste the file’s text, enter its exact path in File name, provide the same author/email and a meaningful commit message, then choose Commit changes:File name to create in CodeCommitPurposeindex.htmlSite HTML template and first visible release labelpackage.jsonPinned npm dependency and build/test scriptsbuildspec.ymlCodeBuild phases, CodeArtifact login and release-artifact selectionappspec.ymlCodeDeploy file mapping and lifecycle eventsscripts/install_dependenciesInstall Apache and curl on Amazon Linux 2023scripts/start_serverStart and enable Apachescripts/stop_serverGraceful stop before later deploymentsscripts/validate_serverLocal service and HTTP content verificationtests/verify-source.cjsAutomated source checkstools/build-release.cjsBuild release HTML and stage deployment package
  4. For nested names, type the entire relative path such as scripts/start_server in the Create file dialog; AWS’s CodeCommit training tutorial documents this browser-only folder-creation method. Do not flatten paths to the root. [AWS03]
  5. Verify the repository tree shows README.md, index.html, package.json, buildspec.yml, appspec.yml, and folders scripts/, tests/, tools/.
  6. Open buildspec.yml in CodeCommit and verify the domain is awsdevlab, the repository is web-npm, and artifacts.base-directory is release.
  7. Open appspec.yml and verify it is located at the repository root, includes ValidateService, and installs /index.html to /var/www/html/.
  8. Select Commits or History in the repository navigation to confirm each browser-created file produced a commit on main.

Important: Uploading the entire ZIP as one CodeCommit repository file does not unpack it into Git. Use the Create file editor separately for the listed file paths. This is deliberately slower than Git push but honors the browser-only requirement. Never paste the ZIP’s binary data into the editor.

1.3 Practice branching, review and merge entirely in CodeCommit

  1. Select Branches in the repository. Choose Create branch (the exact control may be under the Branches view).
  2. Set Branch name feature/lab-banner and Branch from main; select Create branch.
  3. Return to Code, select branch feature/lab-banner, and open index.html.
  4. Select Edit, locate the visible sentence Five services. One end-to-end delivery workflow., and replace it with Source control review completed. Ready for CI/CD. Leave <%- releaseLabel %> and <%- builtAt %> placeholders untouched.
  5. Enter a meaningful commit message such as Update demo banner in feature branch; choose Commit changes. Confirm that main still has the original text and feature/lab-banner has the update.
  6. Go to Pull requests → Create pull request. Select Source feature/lab-banner and Destination main.
  7. Review the diff. Enter title Update training website banner and a description of the change; choose Create pull request.
  8. In the pull request, review the Changes tab, add a review comment if available, then choose Merge. Select a permitted merge strategy (for a simple, conflict-free example choose Fast forward if offered), confirm the destination is main, and complete the merge.
  9. Return to branch main and open index.html. Confirm the updated sentence is present and the pull request is merged/closed.

Checkpoint CC-2: A named feature branch, a reviewed and merged pull request, and the modified file on main are visible in the CodeCommit console. If required by an organizational approval rule, ask another authorized learner to approve instead of bypassing governance.

Lab 1 evidence to capture

  • Screenshot: repository name with main branch and complete folder tree.
  • Screenshot: pull request diff and merged status.
  • Record: repository ARN, default branch, most recent commit ID.

Lab 1 troubleshooting

  • AccessDenied on creation or commit: check the trainee permission set and account/Region; a repository policy or organization SCP may restrict codecommit:CreateRepository, PutFile or merge permissions.
  • No main branch: complete the first browser-created file and refresh the page.
  • Missing scripts/ folder: nested file paths must be entered in the filename field on Create file, not in a flat Upload file chooser.
  • Pull request cannot merge: verify destination/main, source/feature, merge conflicts, branch policies and required approvals.

Lab 2 — AWS CodeArtifact: manage build dependencies

Objective. Create an AWS CodeArtifact domain and npm repository connected to the public npm registry, grant the CodeBuild role secure read access, and later verify that CodeBuild actually fetched the pinned lodash dependency through CodeArtifact.

Note on order. This lab creates the repository. The first package version will appear under Packages after the initial CodeBuild execution in Lab 3. A console-only learner does not need to authenticate npm on a local machine.

2.1 Create domain, downstream repository and npm upstream

  1. Use AWS Console search to open CodeArtifact (direct link: https://console.aws.amazon.com/codesuite/codeartifact/start ). Check Region ap-northeast-1.
  2. Choose Create repository from the Repositories view.
  3. Set Repository name to web-npm and optional description Dependencies consumed by the web application CodeBuild project.
  4. Under Public upstream repositories, select the npm-store option that connects to the public npmjs registry. The wizard will create/link an upstream repository named npm-store. Do not leave the public upstream selection empty; this is how the first lodash package is ingested.
  5. Choose Next. For AWS account, choose This AWS account.
  6. For Domain name, enter awsdevlab (new domain). If a domain already exists, only reuse it if your instructor confirms the domain ownership and permissions.
  7. Under Additional configuration, choose the AWS managed key for domain encryption for this disposable lab; customer-managed KMS keys require additional permissions.
  8. Choose Next, review the package flow web-npm → npm-store → npmjs, then Create repository.
  9. From Repositories, verify both web-npm and npm-store exist and are associated with domain awsdevlab; from Domains, verify awsdevlab exists.
  10. Open repository web-npm and select View connection instructions → npm. Inspect the displayed domain/repository/Region endpoint. This screen is for understanding the connection; do not execute the suggested terminal login command. Authentication will occur inside CodeBuild using buildspec.yml in Lab 3. [AWS04]

Checkpoint CA-1: CodeArtifact’s repository view shows web-npm, its upstream npm-store and the new domain awsdevlab. The package list might correctly be empty until Lab 3.

2.2 Prepare the future CodeBuild access policy in IAM

The policy below is intended for the CodeBuild service role, not the trainee identity or EC2 instance. Create it after CodeBuild creates its role in Lab 3 (the next section gives the exact console steps). Do not place CodeArtifact tokens in CodeCommit, package.json, or CodeBuild plaintext environment variables. Each build automatically acquires a short-lived token. [AWS05]

IAM policy template — replace ACCOUNT_ID with your 12-digit account ID before saving. This is policy JSON, not a terminal command.

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "CodeArtifactDomainToken",
      "Effect": "Allow",
      "Action": "codeartifact:GetAuthorizationToken",
      "Resource": "arn:aws:codeartifact:ap-northeast-1:ACCOUNT_ID:domain/awsdevlab"
    },
    {
      "Sid": "CodeArtifactReadRepository",
      "Effect": "Allow",
      "Action": [
        "codeartifact:GetRepositoryEndpoint",
        "codeartifact:ReadFromRepository"
      ],
      "Resource": "arn:aws:codeartifact:ap-northeast-1:ACCOUNT_ID:repository/awsdevlab/web-npm"
    },
    {
      "Sid": "AllowServiceBearerToken",
      "Effect": "Allow",
      "Action": "sts:GetServiceBearerToken",
      "Resource": "*",
      "Condition": {
        "StringEquals": {
          "sts:AWSServiceName": "codeartifact.amazonaws.com"
        }
      }
    }
  ]
}

Instructor checkpoint: Explain the two trust boundaries: the trainee can configure IAM, while CodeBuild assumes its own execution role. sts:GetServiceBearerToken is separate from CodeArtifact’s repository authorization. The example grants read, not publish, permissions. [AWS06]

2.3 Return after Lab 3 to prove package use

  1. After the first successful CodeBuild run, open CodeArtifact → Repositories → web-npm → Packages.
  2. Refresh. Search for lodash. Open the package and confirm a package version such as 4.17.21 is present.
  3. Inspect its assets/metadata. Navigate to npm-store and examine the upstream relationship, if shown in your console.
  4. Return to CodeBuild’s build logs. Confirm the CodeArtifact login phase and package-install phase succeeded; treat CodeArtifact package presence and build success together as evidence that the dependency path worked.

Checkpoint CA-2: lodash 4.17.21 appears in the downstream repository following a successful build. Package visibility may lag; refresh before troubleshooting.

Lab 2 troubleshooting

  • Public package missing after build: check upstream npm-store, public internet egress from CodeBuild, build logs, and whether the build actually installed npm dependencies. Do not assume an empty package list before first build is a fault.
  • Token authorization error: CodeBuild role requires CodeArtifact token + repository read actions and sts:GetServiceBearerToken; root credentials cannot request a CodeArtifact auth token.
  • Repository not listed in CodeBuild account: verify Region, account, domain and repository spelling. Cross-account CodeArtifact access needs additional resource policies not covered here.
  • Private VPC build cannot access CodeArtifact/npmjs: use the default service-managed CodeBuild networking for this course; custom VPC builds need additional routes/endpoints.

Lab 3 — AWS CodeBuild: test, build and store a release ZIP

Objective. Create a standalone CodeBuild project whose source is CodeCommit, automatically fetch npm lodash from CodeArtifact, run tests, generate an index.html with a release label, and publish a fully formed CodeDeploy revision as a ZIP in private S3.

What success looks like: CodeBuild status Succeeded, test result PASS, S3 ZIP contains appspec.yml, index.html, and scripts/* at the archive root, and the CodeArtifact package can be inspected in its console.

3.1 Create the private S3 release-artifact bucket

  1. Open Amazon S3 → Buckets → Create bucket.
  2. Choose General purpose bucket. Set Bucket name to awsdevlab-artifacts-ACCOUNTID-apne1 (substitute your account ID; append a suffix if already in use).
  3. Set the AWS Region to Asia Pacific (Tokyo).
  4. Leave Block all public access enabled. Do not make the bucket or its objects public.
  5. For Bucket Versioning, choose Disable for this disposable lab, unless your institution requires versioning (if enabled, cleanup requires deleting versions and delete markers).
  6. For Default encryption, leave SSE-S3 or another account-approved default. For the simplest lab, use SSE-S3 rather than customer-managed KMS.
  7. Leave other settings at their defaults; choose Create bucket and record its exact name.
  8. Open the bucket and confirm the Permissions panel shows Block Public Access enabled.

Checkpoint CB-1: Private, same-Region S3 bucket is available and empty.

3.2 Create the CodeBuild project

  1. Open CodeBuild → Build → Build projects → Create build project (or Create build project from the welcome screen).
  2. Project configuration → Project name: awsdevlab-web-build. Enter a short description such as CodeCommit → CodeArtifact npm → test → S3 deployable ZIP.
  3. Source → Source provider: choose AWS CodeCommit. Repository: awsdevlab-webapp. Reference type: Branch. Branch: main (if requested). Leave Git depth and submodules at defaults unless your console requires an option.
  4. Environment → Provisioning model: On-demand (managed). Environment image: Managed image. Operating system: Amazon Linux. Runtime: Standard. Image: select Amazon Linux 2023 x86_64 standard:6.0 (the exact catalog label may include aws/codebuild/amazonlinux-x86_64-standard:6.0). Choose a Linux container and the smallest general-purpose compute option appropriate for a lightweight Node build.
  5. Environment → Service role: choose New service role; note the automatically proposed role name, such as codebuild-awsdevlab-web-build-service-role. Avoid privileged mode (not required), a custom VPC, secrets or additional environment variables for this lab.
  6. Buildspec → Build specifications: choose Use a buildspec file in the source root. Confirm the name is buildspec.yml (do not paste terminal commands into the browser).
  7. Artifacts → Type: Amazon S3. Select the private bucket created in 3.1.
  8. Artifact name: web-demo-release.zip. Select ZIP packaging. Keep a blank Path, choose No namespace / None if that field appears, and leave any artifact name override/semantic versioning option off. If the option Remove artifacts encryption appears, use it only if the bucket enforces SSE-S3 and the course is not using client-side AWS KMS artifact encryption; otherwise use the default encryption and grant the deployment role appropriate KMS decrypt permissions.
  9. Cache: No cache for the first run. Logs: enable CloudWatch Logs to capture the build phases. Accept a generated or explicitly named log group; record it for cleanup.
  10. Choose Create build project. Note the project’s Service role ARN on the details page. [AWS07][AWS08]

Image selection note. AWS currently documents Node.js 22 on the Amazon Linux 2023 standard 6.0 CodeBuild image. Our buildspec.yml explicitly selects Node.js 22 to avoid silent runtime changes. [AWS09]

3.3 Grant CodeBuild role access through the IAM console

  1. Open IAM → Roles in another tab.
  2. Search for the CodeBuild service role recorded in 3.2. Select it; verify its trusted entity/service is codebuild.amazonaws.com.
  3. On Permissions, select Add permissions → Create inline policy (or create a customer-managed policy in IAM → Policies and attach it to this role). Open the JSON editor.
  4. Replace ACCOUNT_ID in the Lab 2 CodeArtifact policy with your actual account ID and paste the full JSON. Choose Next; enter policy name AWSDevLabCodeArtifactRead; review and Create policy. Wait until the policy appears on the CodeBuild role.
  5. Inspect the existing CodeBuild role permissions for CodeCommit source access, CloudWatch Logs, and the chosen S3 output bucket. The console may create some scoped policies automatically; do not assume permissions are present solely because the role exists.
  6. If the role lacks S3 write or CodeCommit pull access, create and attach this supplementary inline policy, replacing ACCOUNT_ID in the resource ARNs and the ARTIFACT_BUCKET value with the actual bucket name:
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "ReadTrainingCodeCommit",
      "Effect": "Allow",
      "Action": ["codecommit:GitPull", "codecommit:GetRepository"],
      "Resource": "arn:aws:codecommit:ap-northeast-1:ACCOUNT_ID:awsdevlab-webapp"
    },
    {
      "Sid": "InspectArtifactBucket",
      "Effect": "Allow",
      "Action": ["s3:GetBucketLocation", "s3:ListBucket"],
      "Resource": "arn:aws:s3:::ARTIFACT_BUCKET"
    },
    {
      "Sid": "WriteArtifactObjects",
      "Effect": "Allow",
      "Action": ["s3:PutObject", "s3:GetObject"],
      "Resource": "arn:aws:s3:::ARTIFACT_BUCKET/*"
    }
  ]
}
  1. Review the IAM policy summary before saving; confirm the target is the CodeBuild role and there are no unresolved placeholder values. If an organization SCP or bucket policy applies an explicit deny, fixing the IAM role alone may not be sufficient.

Checkpoint CB-2: CodeBuild’s execution role has CodeArtifact read/token, service bearer token, CodeCommit pull, CloudWatch log permissions, and S3 artifact write permissions.

3.4 Inspect the build contract before running

  1. Open CodeCommit → awsdevlab-webapp → Code → main → buildspec.yml.
  2. Confirm install selects Node.js 22; pre_build authenticates npm to CodeArtifact and installs dependencies; the test checks source structure; build generates the release; artifacts packages release/** with release as the base directory.
  3. Open package.json. Confirm dependency lodash is pinned to version 4.17.21 and has test and build scripts.
  4. Open tools/build-release.cjs. Confirm it renders the template with lodash, copies appspec.yml, and includes all four CodeDeploy hooks in the release/scripts/ directory.
  5. Explain to learners that the YAML/JavaScript/shell files are source configuration. The user never manually runs their operations. CodeBuild executes the buildspec internally using the service role; CodeDeploy executes lifecycle hooks later on the deployment host.

Production distinction: For teaching a first-time upstream cache ingest, this lab pins a single dependency and performs a fresh package resolution without a lockfile. For production, create a reviewed registry-consistent lockfile, use a reproducible installation mode, add vulnerability scanning, and remove unnecessary public dependency access.

3.5 Start and inspect the standalone build

  1. Return to CodeBuild → Build projects → awsdevlab-web-build.
  2. Choose Start build. For source version, choose the default/latest main revision; leave optional build overrides unchanged and choose Start build.
  3. Open the new build ID in Build history. Watch each phase: DOWNLOAD_SOURCE, INSTALL, PRE_BUILD, BUILD, UPLOAD_ARTIFACTS, FINALIZING.
  4. On the Build logs tab, confirm the CodeArtifact npm login step completed successfully, dependency installation completed, the automated test printed a PASS message, and build output states the release directory was created.
  5. Confirm the build’s top-level Status is Succeeded. Record the build ID and source commit ID.
  6. In the build detail Artifacts section, follow the Artifacts upload location link to S3, or open S3 → your artifact bucket manually.
  7. Locate web-demo-release.zip (or the S3 object whose exact key appears in the build details). Confirm it is an S3 object, not a folder of loose individual files.
  8. From the S3 object page, choose Download in the browser; use your operating system’s graphical archive viewer to inspect its entries. The expected ZIP hierarchy is:
appspec.yml
index.html
scripts/install_dependencies
scripts/start_server
scripts/stop_server
scripts/validate_server
  1. Verify that appspec.yml is at the ZIP root, not inside release/, source/, a GitHub folder or another nested directory. Open the packaged index.html in a local text editor and confirm the visible Release: LAB-V1 placeholder has been rendered and the build time is a real UTC timestamp.
  2. Return to CodeArtifact → web-npm → Packages; verify lodash version 4.17.21 appears (allow some time and refresh if initially absent).

Checkpoint CB-3: Build Succeeded, release ZIP has correct file paths, lodash is present in CodeArtifact, and build log contains the source-test PASS. Save the S3 URI of the ZIP for manual CodeDeploy deployment.

Lab 3 troubleshooting matrix

Symptom in CodeBuildVerify in consoleRecovery without terminal
Source download failsBuild log; CodeCommit repository and branch; role policyCheck same Region, correct branch, codecommit:GitPull, repo ARN
CodeArtifact access deniedPRE_BUILD log and CodeBuild roleApply all 3 permissions areas from Lab 2, including sts:GetServiceBearerToken
npm package not found / 404Domain, downstream upstream flowConnect web-npm to npm-store and npmjs; retry build
buildspec.yml not foundCodeCommit treeCreate at repository root, correct spelling (not buildspec.yaml)
Node runtime unsupportedBuild environment imageUse AL2023 x86_64 standard 6.0 and Node.js 22
Test failedDetailed log; tests/ pathRestore exact sample file paths and template markers
Artifact upload failedUPLOAD_ARTIFACTS and IAM/S3Check S3 PutObject, actual bucket ARN, ZIP packaging and encryption
ZIP contains nested release/ directoryBuildspec base-directorySet base-directory: release, re-run, inspect ZIP again

Lab 4 — AWS CodeDeploy: deploy the build artifact to Amazon EC2

Objective. Launch a single Amazon Linux 2023 target, install the CodeDeploy agent entirely through the CodeDeploy/Systems Manager consoles, manually deploy the tested ZIP from Lab 3, inspect lifecycle events, and validate the live HTTP website.

Architecture note. This is intentionally a single-instance, in-place deployment with no load balancer. It teaches CodeDeploy lifecycle events. It is not a highly available production deployment. The web server is installed by lifecycle hooks included in the build artifact; the learner does not manually run installation commands.

4.1 Create the EC2 instance profile (IAM role)

  1. Open IAM → Roles → Create role.
  2. Under Trusted entity type, choose AWS service; Use case → EC2; choose Next.
  3. In Permissions, attach AmazonSSMManagedInstanceCore and AmazonEC2RoleforAWSCodeDeploy. The latter grants broad S3 read permissions and is convenient for this isolated course; do not use its broad S3 resource scope unreviewed in production. For production, scope S3 reads to approved artifact paths and any required AWS-owned service buckets. [AWS10]
  4. Choose Next; enter Role name awsdevlab-ec2-role; optionally add tag Course=AWSDevLab; choose Create role.
  5. Open the role and verify its Trust relationships shows the EC2 service principal, and its Permissions tab contains both managed policies.

Checkpoint CD-1: An EC2-trusted instance role exists, with SSM access and the CodeDeploy agent’s artifact access.

4.2 Launch the EC2 target using the EC2 console

  1. Open EC2 → Instances → Launch instances.
  2. Set Name to awsdevlab-web-ec2. This creates Name=awsdevlab-web-ec2, which the deployment group will use to select the target.
  3. Under Application and OS Images (AMI) choose Amazon Linux and explicitly select Amazon Linux 2023 (AL2023), x86_64. Do not choose an old Amazon Linux 2 image only because an older walkthrough shows it.
  4. Under Instance type, choose a small, supported general-purpose type suitable for the course, such as t3.micro if available and permitted. Verify pricing in your account; do not assume free-tier eligibility.
  5. Under Key pair (login) choose Proceed without a key pair if allowed. This lab uses no SSH. If your organization requires an approved key pair, choose it, but do not open TCP/22 merely for this tutorial.
  6. Expand Network settings → Edit. Select the instructor-approved VPC and public subnet. Choose Auto-assign public IP: Enable. Ensure the subnet’s route table provides an Internet Gateway path for internet-facing test traffic.
  7. Create a new security group awsdevlab-http-sg with Inbound HTTP TCP/80 → Source type: My IP. Remove SSH TCP/22 if the wizard adds it automatically. Leave the normal outbound rule allowing required service access. Record the IPv4 CIDR displayed for My IP; this may need to be updated if your public IP changes.
  8. Under Configure storage, keep the default encrypted/root EBS volume size offered by the selected AMI (small is sufficient). Check Delete on termination is enabled for the root volume.
  9. Expand Advanced details. Under IAM instance profile, select awsdevlab-ec2-role. No user data is required; do not paste bootstrapping commands.
  10. Under Summary, verify Number of instances = 1. Choose Launch instance.
  11. In EC2 → Instances, select the new instance and wait for Instance state: Running and Status checks: 2/2 checks passed. Record instance ID, public IPv4, public DNS and the security group.

Checkpoint CD-2: One AL2023 EC2 instance is running in a public subnet with Name tag awsdevlab-web-ec2, assigned instance role and HTTP ingress only from your IP.

4.3 Confirm SSM sees the instance; do not install agents from a shell

  1. Open AWS Systems Manager in ap-northeast-1. Under Node Management / Fleet Manager → Managed nodes, look for the EC2 instance ID. Console navigation grouping may vary; search Managed nodes inside Systems Manager if necessary.
  2. Confirm the node shows a healthy/online SSM agent connection. AL2023 Amazon-provided AMIs typically include SSM Agent; registration requires the EC2 IAM role and outbound connectivity.
  3. If not online, revisit the EC2 instance profile, VPC internet route, network ACL, outbound security group and SSM prerequisites. Do not continue until the instance is manageable. [AWS11]

4.4 Create the CodeDeploy service role

  1. Open IAM → Roles → Create role.
  2. Choose AWS service → CodeDeploy → CodeDeploy as the use case and Next.
  3. Confirm the console proposes or attaches AWSCodeDeployRole managed policy for EC2/On-Premises deployments.
  4. Set role name awsdevlab-codedeploy-role; choose Create role.
  5. Open the role and verify its trust principal is codedeploy.amazonaws.com.

Checkpoint CD-3: The CodeDeploy service role exists and is distinct from the EC2 instance role and the CodeBuild role.

4.5 Create the CodeDeploy application and deployment group

  1. Open CodeDeploy → Deploy → Applications → Create application.
  2. Application name: awsdevlab-web-app. Compute platform: EC2/On-premises. Choose Create application.
  3. On the application page select Create deployment group.
  4. Deployment group name: awsdevlab-web-ec2. Service role: choose the ARN of awsdevlab-codedeploy-role.
  5. Under Deployment type, choose In-place.
  6. Under Environment configuration, choose Amazon EC2 instances. Set tag selector Key = Name, Value = awsdevlab-web-ec2. If the console shows a matched-instance count, confirm one target is selected.
  7. Under Agent configuration with AWS Systems Manager, choose Now and schedule updates. This uses Systems Manager to install/configure the CodeDeploy agent on selected instances; this field is the key to our no-terminal requirement. If this option is absent, see the alternative in Step 4.6. [AWS12]
  8. Deployment configuration: CodeDeployDefault.OneAtATime. Load balancer: disable Enable load balancing for this one-instance course.
  9. Review fields; choose Create deployment group.
  10. In the deployment group’s details, verify in-place, EC2 target tag, CodeDeploy service role and agent management settings. Allow agent installation to finish before deploying.

Checkpoint CD-4: Application and deployment group exist; the correct EC2 target is registered; CodeDeploy agent installation is being managed by SSM.

4.6 Fallback: install CodeDeploy agent with Systems Manager’s visual package workflow

Use this only if the deployment group’s agent-management UI is absent or reports an install failure. It is still browser-only.

  1. Open Systems Manager → Node Management → Distributor (or the Systems Manager package-management feature; console groupings change). Choose Third party / Amazon-owned packages or the repository of available packages.
  2. Search for the AWS package AWSCodeDeployAgentV2, the AWS-documented package for CodeDeploy agent version 2.0 and later. Select the package and Install / Install package.
  3. In the setup choose Installation type: Install and target the managed EC2 instance ID from 4.2. For recurring updates, choose the update schedule your instructor approves; a one-off install is enough for a disposable lab.
  4. Choose Run / Create association as the UI offers. View the Command/Association execution status until Success. Do not enter custom shell scripts or use the terminal. [AWS13]
  5. Return to the CodeDeploy deployment group and verify agent readiness. If the package screen differs materially, follow the AWS CodeDeploy agent installation via Systems Manager documentation cited in the References section.

4.7 Deploy the S3 build output manually

  1. Open S3 → the standalone artifacts bucket → web-demo-release.zip. From the object detail page, choose Copy S3 URI (or copy the actual S3 object path). The value must point to the exact ZIP object, not the bucket, prefix or console webpage URL.
  2. Return to CodeDeploy → Applications → awsdevlab-web-app → Deployments → Create deployment.
  3. Deployment group: awsdevlab-web-ec2.
  4. Under Repository / Revision type, select My application is stored in Amazon S3.
  5. Revision location: paste the full S3 object URI, such as s3://awsdevlab-artifacts-ACCOUNTID-apne1/web-demo-release.zip (replace with real bucket/key).
  6. Revision file type: .zip. Enter description Manual deployment of tested CodeBuild release.
  7. Leave the configured deployment group strategy, deployment configuration and any optional rollback settings at their course defaults. If auto rollback on failure is available, enable it for safety, but understand a first-time deployment has no last-good revision to roll back to.
  8. Choose Create deployment. Record its deployment ID. [AWS14]

4.8 Validate lifecycle execution and the public website

  1. On the CodeDeploy deployment detail page, inspect Deployment status until Succeeded.
  2. Expand Deployment lifecycle events / Instance details. Confirm the expected events were completed: BeforeInstall → Install → ApplicationStart → ValidateService. ApplicationStop is normally skipped on the first deployment because there is no previous successfully deployed revision from which to load a stop hook.
  3. If an event is red/failed, select its error/details link or related View logs link in the deployment pane. The instance’s agent logs are not required for the normal success path; the UI’s failure details should be your first stop.
  4. From EC2 → Instances → awsdevlab-web-ec2, copy its Public IPv4 address or Public IPv4 DNS. In a new browser tab, open the http:// URL (not https://, because the course does not configure TLS).
  5. Confirm the page displays AWS Developer Services Lab, the merged banner from Lab 1, Release: LAB-V1, and a UTC build time. Take a screenshot showing the browser URL and page content.
  6. If the browser times out but CodeDeploy succeeded, check the instance’s public IP, inbound HTTP/80 rule with your current My IP, public route table, and local network restrictions. If the browser returns HTTP error 403/404, inspect Apache lifecycle hooks or the ZIP’s path structure.

Checkpoint CD-5: CodeDeploy deployment status Succeeded, ValidateService succeeded and a real browser request to the instance’s public IP returns the released page.

Lab 4 troubleshooting matrix

SymptomLikely issueBrowser-based recovery
No EC2 targets matchedTag mismatch or wrong RegionCheck EC2 Name tag, CodeDeploy group tag Key/Value and account/Region
Deployment never begins / skipped targetCodeDeploy agent not installed / not healthyCheck SSM Managed nodes and agent association; use Distributor V2 workflow
Failed BeforeInstallApache package install error / outbound internetOpen lifecycle failure, verify public subnet internet and EC2 outbound access; retry after network fix
Failed Install (missing AppSpec)ZIP root structure wrongOpen standalone ZIP locally; AppSpec must be at root, rebuild from CodeBuild
AccessDenied fetching revisionIAM role / S3 object / KMSCheck EC2 instance profile s3:GetObject, exact S3 key and any KMS decrypt grant
Failed ApplicationStartWeb server not runningOpen lifecycle error, confirm AL2023, install hook and scripts in revision
Failed ValidateServiceHTTP endpoint/content verification failedCheck the rendered index.html, Apache service startup and root path
CodeDeploy Succeeded but public page inaccessibleHTTP/80 inbound / public IP / VPC routeCheck My IP CIDR, subnet/IGW, instance public IPv4; use HTTP URL

Lab 5 — AWS CodePipeline: automate source → build → deploy

Objective. Transform the standalone CodeBuild project into a pipeline-compatible action, create a V2 CodePipeline containing CodeCommit source, CodeBuild build and CodeDeploy deployment, then demonstrate an automatic rebuild and redeployment from an in-browser CodeCommit edit.

Two essential integration rules: (1) The existing CodeBuild project must have Source provider = AWS CodePipeline and Artifacts type = AWS CodePipeline before the pipeline executes it. (2) The CodeDeploy action input artifact must be the CodeBuild output (often BuildArtifact), not the CodeCommit raw source output (SourceArtifact). Missing either rule is a common source of misleading pipelines that cannot deploy the rendered HTML. [AWS15][AWS16]

5.1 Reconfigure the existing build project for CodePipeline

  1. Open CodeBuild → Build projects → awsdevlab-web-build.
  2. Choose Edit → Source. Change Source provider from AWS CodeCommit to AWS CodePipeline. The pipeline will now supply source ZIPs to this project. Save Update source / Update configuration, depending on the screen.
  3. Choose Edit → Artifacts. Change Type from Amazon S3 to AWS CodePipeline; save. This does not delete the standalone ZIP created earlier in S3.
  4. Verify Environment still uses AL2023 x86_64 standard 6.0, Service role is the same CodeBuild role (with CodeArtifact read access), and Buildspec still uses root buildspec.yml.
  5. On project details verify Source: AWS CodePipeline and Artifacts: AWS CodePipeline. Do not use Start build directly for another standalone test; pipeline now supplies the input source and manages artifacts.

Checkpoint CP-1: The existing, already-tested CodeBuild project is configured for CodePipeline source and artifact exchange.

5.2 Create the V2 custom pipeline in the AWS console

  1. Open CodePipeline → Pipelines → Create pipeline.
  2. On Choose creation option, select Build custom pipeline, then Next. Avoid a prebuilt template that changes the pipeline’s service architecture.
  3. On Pipeline settings, set Pipeline name awsdevlab-web-pipeline.
  4. For Pipeline type, use V2 (the current console experience). Select New service role and allow AWS to create the CodePipeline service role. Record its role ARN. Keep the default same-Region S3 pipeline artifact store unless organizational policy requires a preexisting protected artifact bucket. Choose Next. [AWS02]
  5. Add source stage: Source provider = AWS CodeCommit. Repository name = awsdevlab-webapp. Branch name = main. For Output artifact format, choose CodePipeline default, not Full clone, because the deployment later needs buildable ZIP contents. Enable Start the pipeline on source code change / EventBridge change detection. Confirm the source output artifact name, normally SourceArtifact. Choose Next.
  6. Add build stage: Build provider = AWS CodeBuild. Select Existing project, then choose awsdevlab-web-build. Keep build mode Single build if offered, not batch build. Confirm the build receives SourceArtifact and will produce a new output artifact, normally BuildArtifact. Choose Next.
  7. Add test stage, if offered: choose Skip test stage, since CodeBuild already runs the automated test in its PRE_BUILD phase. For production, consider a distinct dedicated test stage.
  8. Add deploy stage: Deploy provider = AWS CodeDeploy. Application name = awsdevlab-web-app. Deployment group = awsdevlab-web-ec2. If there is an Input artifacts selector, explicitly choose the CodeBuild output (normally BuildArtifact). Choose Next.
  9. On the Review page check source repository and branch, build project name, deployment group, artifact wiring and V2 type. Choose Create pipeline.
  10. The pipeline may start an initial execution immediately. In Pipeline details / Edit, inspect the Deploy action. If it selected SourceArtifact or a different input, choose Edit action, set Input artifact to the CodeBuild BuildArtifact, and Save the pipeline change. Trigger a fresh execution using Release change after correcting the input; the first run may have failed if it used an incorrect artifact.
  11. Inspect the pipeline’s automatically created artifact bucket from Pipeline settings / Artifact store and record its name. These artifacts are managed separately from the standalone Lab 3 S3 bucket.

Checkpoint CP-2: The pipeline visually shows Source (CodeCommit) → Build (CodeBuild) → Deploy (CodeDeploy). Source output flows to Build; Build output flows to Deploy.

5.3 Observe first complete pipeline execution

  1. On the pipeline Executions or visualization page, choose Release change if no execution is in progress; confirm the action when prompted.
  2. Watch Source become Succeeded. Select its execution details and verify the main branch and latest CodeCommit commit ID.
  3. Watch Build. Follow View details to CodeBuild and confirm tests, CodeArtifact npm authentication and release/ packaging all succeed.
  4. Watch Deploy. Follow View details to CodeDeploy and confirm the correct application/deployment group and all lifecycle events succeed.
  5. Once the full pipeline is Succeeded, refresh the browser tab pointing at the EC2 public IP. Confirm the page remains accessible and the Build time (UTC) reflects the new pipeline build.
  6. Capture the pipeline execution ID, CodeCommit commit ID, CodeBuild build ID and CodeDeploy deployment ID. These four linked IDs form the traceable evidence chain for the release.

Checkpoint CP-3: A green three-stage pipeline deploys a built ZIP produced by CodeBuild and the HTTP page is healthy.

5.4 Demonstrate a true automatically triggered change

  1. Open CodeCommit → awsdevlab-webapp → Code → main → index.html.
  2. Select Edit. Change the visible headline AWS Developer Services Lab (inside the <h1> element only) to AWS Developer Services Lab — Version 2. Keep the separate <title> text, the verification marker strings, the releaseLabel template placeholder and the lab-check element untouched.
  3. The source-test checker intentionally verifies the phrase AWS Developer Services Lab, which remains a substring of the updated heading, so the test will continue to pass.
  4. Enter commit message Release version 2 from CodeCommit console and choose Commit changes directly on main for the automatic-trigger demonstration. (In a governed production workflow, use a pull request with approvals.)
  5. Immediately return to CodePipeline → awsdevlab-web-pipeline. Observe a new execution created by the CodeCommit change. It can take a short time for the event to arrive.
  6. Verify Source, Build, Deploy each become Succeeded. In Build logs, look for PASS and the generated release. In CodeDeploy, confirm ValidateService succeeded.
  7. Refresh the public page. Confirm the new heading AWS Developer Services Lab — Version 2 and a changed UTC build time.
  8. Optionally open CodeCommit → Commits, CodePipeline → Executions, CodeBuild → Build history, and CodeDeploy → Deployments side by side and connect the commit, pipeline, build and deployment IDs.

Checkpoint CP-4: A single CodeCommit browser edit automatically results in a tested, packaged and successfully deployed Version 2 website—without manually starting a build or deployment.

5.5 Optional: introduce a controlled failure and practice recovery

  1. Open index.html through CodeCommit Edit and temporarily remove the HTML element with id="lab-check". Commit this change on a separate temporary branch or on main only if the class permits deliberately failing the training pipeline.
  2. Observe the subsequent Build stage fail its source test in CodeBuild. Confirm CodePipeline does not run a new successful Deploy action for that failed source revision; the old website should remain reachable.
  3. Restore the id="lab-check" element using the CodeCommit browser editor and commit the corrected file. Re-run (or allow the trigger to start) the pipeline.
  4. Verify the next pipeline execution becomes Succeeded and the website is healthy. Explain why build-time tests prevent a defective revision from reaching the deployment stage.

Safety note: A pipeline source-stage rule, branch permission or manual approval may prevent an automatic trigger. If so, capture that governance behavior as part of the exercise rather than disabling organizational controls without permission.

Lab 5 troubleshooting matrix

SymptomInspectCorrective action in console
CodePipeline build says wrong source typeCodeBuild Source settingsChange CodeBuild Source to AWS CodePipeline
CodeBuild artifact type mismatchCodeBuild Artifacts settingsChange Type to AWS CodePipeline
Deploy step says missing AppSpec or raw template shownDeploy action Input artifactsSelect BuildArtifact, not SourceArtifact
No auto-trigger after CodeCommit commitSource stage change detectionCheck main branch, EventBridge rule and pipeline trigger settings; release manually to isolate fault
CodePipeline cannot use CodeBuildPipeline service role permissionsConfirm codebuild:StartBuild, codebuild:BatchGetBuilds, build project ARN
CodeDeploy cannot read pipeline artifactEC2 instance role / artifact bucket and KMS policyCheck managed S3 GetObject and any extra KMS decrypt rights
Only first pipeline worksRegion/branch, token refresh, artifact namesTrace each stage’s current input/output and cloud log references
Old website after green runBrowser cache, wrong public IP, artifact inputHard-refresh browser, inspect build timestamp, deploy action artifact and EC2 target tag

Instructor verification and assessment

Deliverable checklist

GateMust-have evidencePass condition
CC-1/2CodeCommit repo tree; PR diff; merged statusCorrect root/nested paths, main branch, completed review
CA-1/2CodeArtifact domain, npm upstream, cached lodashweb-npm and npm-store; lodash 4.17.21 after successful build
CB-1/3Private artifact bucket; CodeBuild status/log; release ZIPSucceeded, tests PASS, AppSpec at ZIP root, readable release content
CD-1/5EC2 role/instance/SSM; deployment detail; web pageManaged EC2 target, CodeDeploy Succeeded, ValidateService passed, HTTP page loads
CP-1/4Pipeline wiring; second execution; Version 2 pageV2 pipeline, BuildArtifact to Deploy, automatic trigger, page changes
Clean-upEmpty artifact buckets; deleted EC2 and lab resourcesNo running instances/pipelines or remaining paid lab artifacts

Suggested assessment (100 points): CodeCommit 15; CodeArtifact 15; CodeBuild 20; CodeDeploy 25; CodePipeline 20; safe clean-up 5. Award points only for screenshots/IDs or in-console evidence; do not award on the basis of claimed success alone.

Security and production-hardening discussion

  • IAM: The provided CodeBuild CodeArtifact policy is scoped to one repository/domain. The beginner-friendly EC2 AmazonEC2RoleforAWSCodeDeploy managed policy is broad (s3:* read-related actions on all resources); consider a custom scope for production, including service-specific buckets, and any required customer-managed KMS permissions.
  • Package supply chain: CodeArtifact is an upstream/cache boundary, not malware scanning by itself. Pin versions, adopt lockfiles, scan dependency vulnerabilities, govern upstream repositories and consider repository package-origin controls.
  • Deployment: A single EC2 instance and HTTP from My IP are instructional. For production use private instances, an ALB, TLS, launch templates or images with the CodeDeploy agent, Auto Scaling or blue/green, alarms and rollback.
  • Build security: Keep CodeBuild privileged mode OFF when not needed; avoid plaintext secrets and broad service roles; log and monitor builds, consider VPC endpoints and private package access.
  • Release governance: Prefer PR reviews, protected main branch, manual approval for production stages, deployment windows, change records and automated failure alarms.

No-terminal cleanup runbook — perform in this order

Why the order matters: Pipelines may retrigger from new source commits, deployments may create Systems Manager associations, and S3 buckets may contain automatically generated artifacts. Removing high-level orchestration first reduces orphaned resources.

  1. CodePipeline: Open Pipelines → awsdevlab-web-pipeline. Stop/disable active executions or transitions if possible; then select Delete pipeline and confirm. Record the CodePipeline-managed S3 artifact bucket from pipeline settings before deleting if you have not already recorded it.
  2. CodeDeploy: Open Applications → awsdevlab-web-app; inspect deployment group and any active deployments. Delete the deployment group and application through their Delete controls. Review Systems Manager → State Manager/Associations for any CodeDeploy agent installation/update associations created for the target and remove lab-only associations if they remain.
  3. EC2: Open EC2 → Instances; select awsdevlab-web-ec2 and choose Instance state → Terminate instance. Confirm termination. Inspect Volumes, Snapshots and Elastic IPs for any lab-only resources left behind; delete only those created by this lab. Delete awsdevlab-http-sg after the instance releases the security group.
  4. CodeBuild: Open Build projects → awsdevlab-web-build → Delete. Check its optional CloudWatch Logs group; delete the lab-specific log group after saving any instructional evidence.
  5. CodeCommit: Open Repositories → awsdevlab-webapp → Delete repository. Confirm that there is no source data you still need.
  6. CodeArtifact: Under Repositories delete web-npm and npm-store (including package contents per prompts), then go to Domains and delete awsdevlab. You cannot delete a domain until its repositories have been removed.
  7. Amazon S3: Empty the standalone awsdevlab-artifacts-ACCOUNTID-apne1 bucket, then Delete bucket. Identify the separate CodePipeline-generated artifact bucket/folder; remove the pipeline’s lab objects, and delete the bucket only if you confirm no other pipeline shares it. Versioned buckets require removal of all object versions and delete markers.
  8. IAM: Delete the lab-specific IAM roles awsdevlab-ec2-role, awsdevlab-codedeploy-role, the generated CodeBuild service role, and the generated CodePipeline role only after confirming nothing else uses them. Delete any custom AWSDevLabCodeArtifactRead policy if not reused. Detach policies before deleting roles when the console requests it.
  9. CloudWatch/EventBridge: Inspect for lab-only log groups, alarms and EventBridge rules still present; delete orphaned lab-only resources. Some change detection rules are removed automatically when the pipeline is deleted.
  10. Cost review: Open Billing and Cost Management → Cost Explorer after billing data posts. Look for EC2, CodeBuild, CodeArtifact, CodePipeline, S3, public IPv4 and CloudWatch charges. Cost data is not necessarily real time.

Final cleanup gate: EC2 Instances shows no running training EC2, CodePipeline and CodeBuild no longer list training resources, CodeArtifact domain is deleted, the standalone S3 bucket is gone, and training IAM roles are removed or explicitly retained by policy.


Reference guide: verified documentation and sample provenance

KeyCurrent authoritative/reference materialURL
AWS01AWS announcement: CodeCommit returned to general availability (24 November 2025)https://aws.amazon.com/blogs/devops/aws-codecommit-returns-to-general-availability/
AWS02AWS CodePipeline: create a custom pipeline (console), V1/V2, stages and change detectionhttps://docs.aws.amazon.com/codepipeline/latest/userguide/pipelines-create.html
AWS03AWS CodePipeline tutorial: CodeCommit browser files and nested pathshttps://docs.aws.amazon.com/codepipeline/latest/userguide/tutorials-simple-codecommit.html
AWS04AWS CodeArtifact: getting started using the consolehttps://docs.aws.amazon.com/codeartifact/latest/ug/getting-started-console.html
AWS05CodeArtifact authentication/token behaviorhttps://docs.aws.amazon.com/codeartifact/latest/ug/tokens-authentication.html
AWS06CodeArtifact: using npm packages in CodeBuild and IAM permissionshttps://docs.aws.amazon.com/codeartifact/latest/ug/using-npm-packages-in-codebuild.html
AWS07CodeBuild: create build project through consolehttps://docs.aws.amazon.com/codebuild/latest/userguide/create-project.html
AWS08CodeBuild: buildspec syntax and artifact base-directoryhttps://docs.aws.amazon.com/codebuild/latest/userguide/build-spec-ref.html
AWS09CodeBuild: currently available runtimes and imageshttps://docs.aws.amazon.com/codebuild/latest/userguide/available-runtimes.html
AWS10Managed EC2 CodeDeploy role scope (AWS managed policy)https://docs.aws.amazon.com/aws-managed-policy/latest/reference/AmazonEC2RoleforAWSCodeDeploy.html
AWS11Systems Manager: managing EC2 as managed nodeshttps://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-setting-up-nodes.html
AWS12CodeDeploy/CodePipeline tutorial: configure agent using SSM in deployment grouphttps://docs.aws.amazon.com/codepipeline/latest/userguide/tutorials-simple-codecommit.html
AWS13CodeDeploy: install CodeDeploy agent through Systems Manager Distributorhttps://docs.aws.amazon.com/codedeploy/latest/userguide/codedeploy-agent-operations-install-ssm.html
AWS14CodeDeploy: create EC2/on-prem deployment with S3 revisionhttps://docs.aws.amazon.com/codedeploy/latest/userguide/deployments-create-console.html
AWS15CodeBuild: change project source and artifacts in the consolehttps://docs.aws.amazon.com/codebuild/latest/userguide/change-project.html
AWS16CodePipeline: CodeDeploy deploy action and artifact requirementshttps://docs.aws.amazon.com/codepipeline/latest/userguide/action-reference-CodeDeploy.html
AWS17GitHub sample: AWS CodeDeploy SampleApp_Linux (architecture and origin)https://github.com/aws-samples/aws-codedeploy-samples/tree/master/applications/SampleApp_Linux
AWS18lodash package source and current npm package informationhttps://www.npmjs.com/package/lodash

Source integrity reminder: This guide is an original training adaptation, not a claim that the GitHub sample was written for CodeArtifact or AL2023. For exact upstream source and license, review the AWS GitHub repository. The downloadable training ZIP contains the files participants should transfer through the CodeCommit browser editor. No AWS or GitHub credentials are bundled.

titleAWS Developer Services: Gold-Standard Console Lab Guide
subtitleCodeCommit • CodeArtifact • CodeBuild • CodeDeploy • CodePipeline
authorInstructor Edition | Browser-Only Labs
date10 November 2026
langen-US

Course navigation

LabAWS servicePractical result
1CodeCommitCreate a browser-authored repo, branch, PR and merge
2CodeArtifactConfigure a private npm repository and public upstream
3CodeBuildResolve dependencies, test, create a deployable ZIP
4CodeDeployDeploy the tested ZIP to AL2023 EC2 without SSH
5CodePipelineAutomate commit-triggered build and deployment

Instructor’s quick start

Course outcome. Complete five connected, independently verifiable labs that take one small web application from source control through dependency acquisition, automated build and tests, manual deployment, and change-triggered continuous delivery. All user interactions take place in web browsers and the AWS Management Console. Learners never use a terminal, AWS CLI, CloudShell, Session Manager shell, or local Git client. The supplied build and deployment scripts execute automatically inside managed AWS services; they are configuration files, not manual lab commands.

Source starting point. The lab adapts the idea of the official AWS GitHub repository aws-samples/aws-codedeploy-samples, specifically applications/SampleApp_Linux, into an Amazon Linux 2023-friendly static website with a meaningful Node.js build using an npm package from CodeArtifact. Original sample: https://github.com/aws-samples/aws-codedeploy-samples/tree/master/applications/SampleApp_Linux . This manual uses a separately provided AWS_Developer_Services_Console_Lab_Source.zip, whose text files are created in CodeCommit through the browser. The GitHub repository is the provenance/reference; the ZIP is the modernized educational derivative.

Currency and verification disclosure. Research checked AWS’s publicly available CodeCommit, CodeArtifact, CodeBuild, CodeDeploy, Systems Manager and CodePipeline instructions on 10 November 2026. The source tree, JSON, YAML and shell syntax were inspected offline. AWS account-specific execution, current live console screenshots and end-to-end runtime outcomes have not been verified: no access to a training AWS account was provided, and package installation from npm could not be exercised in the authoring environment. AWS can change field labels, Region availability, defaults and wizard ordering. Follow the named AWS documentation links in the final section whenever a screen differs. No simulated screenshots are presented as real console evidence.

Important service status. AWS announced on 24 November 2025 that CodeCommit returned to general availability for new customers. Do not follow older training materials claiming it is closed to new customers. Current CodePipeline documentation uses the Build custom pipeline creation choice and a V2 pipeline experience. [AWS01][AWS02]

Architecture at a glance

GitHub sample (reference)
         |
         v  Copy modernized source files through CodeCommit browser editor
AWS CodeCommit (main)
         |
         +--> CodePipeline Source stage --> CodeBuild Build stage --> CodeDeploy Deploy stage
                                             |                      |
                    AWS CodeArtifact <-------+                      v
                     npm upstream                           Amazon EC2 (AL2023)
                    [lodash 4.17.21]                          Apache web server
                                             |
                               build release ZIP: appspec.yml,
                               index.html, scripts/*

The same release ZIP is first deployed manually from Amazon S3 during Lab 4. Later, CodePipeline passes CodeBuild’s output artifact directly to CodeDeploy in Lab 5; do not deploy the unbuilt CodeCommit source artifact, because index.html contains build-time template placeholders.

Time, cost and prerequisites

ItemRequirement or recommendation
Course duration4–6 hours instructor-led; 6–8 hours for first-time learners, excluding provisioning delays
AWS accountNonproduction, disposable training account preferred; access to IAM, EC2, CodeCommit, CodeArtifact, CodeBuild, CodeDeploy, CodePipeline, Systems Manager, S3 and CloudWatch
User permissionsA training-admin or an approved permission set capable of creating IAM roles/policies and passing them to AWS services; no root-user access
RegionAsia Pacific (Tokyo), ap-northeast-1, throughout; use another common Region only after adapting all Region references
NetworkDefault VPC with at least one public subnet and outbound internet, EC2 auto-assigned public IPv4, Systems Manager connectivity and HTTP/80 access from learner’s current public IP
BrowserCurrent Chrome, Edge, Firefox or Safari with downloads and clipboard enabled
DownloadsAWS_Developer_Services_Console_Lab_Source.zip and this manual; extract ZIP locally using the operating system’s file manager (no terminal)
CostNot free by default. EC2 compute, EBS, public IPv4, CodeBuild, CodeArtifact, CodePipeline, S3, CloudWatch and requests may incur charges; charges vary by account/Region/usage. Clean up same day.
SecurityPersonal training account, least privileges where practical, S3 Block Public Access ON, EC2 TCP/80 from My IP only, no SSH needed, never store credentials in Git

Start-of-class gate. Open the AWS account menu, record the 12-digit account ID, and verify the Region Asia Pacific (Tokyo) is displayed in each console. If a default VPC is absent, ask the instructor to supply a VPC with a public subnet and an internet route; do not create a public EC2 target in a private subnet by mistake. All example resource names are illustrative and should be kept consistent throughout.

Fixed naming worksheet — complete before opening Lab 1

ResourceName/value used in this guideRecord actual value
Regionap-northeast-1__________________
AWS account ID12-digit AWS account ID__________________
CodeCommit repositoryawsdevlab-webapp__________________
CodeCommit branchmain__________________
CodeArtifact domainawsdevlab__________________
CodeArtifact downstream repositoryweb-npm__________________
CodeArtifact public upstreamnpm-store__________________
CodeBuild projectawsdevlab-web-build__________________
S3 standalone artifact bucketawsdevlab-artifacts-ACCOUNTID-apne1 (replace ACCOUNTID)__________________
IAM EC2 instance roleawsdevlab-ec2-role__________________
IAM CodeDeploy service roleawsdevlab-codedeploy-role__________________
EC2 instance Name tagawsdevlab-web-ec2__________________
EC2 security groupawsdevlab-http-sg__________________
CodeDeploy applicationawsdevlab-web-app__________________
CodeDeploy deployment groupawsdevlab-web-ec2__________________
CodePipeline pipelineawsdevlab-web-pipeline__________________
CodePipeline artifact bucketCreated by pipeline wizard; record later__________________

Naming note. S3 bucket names are globally unique. If the proposed bucket name is unavailable, append a short suffix and update every reference to that bucket. Avoid changing the fixed CodeArtifact names unless you also edit buildspec.yml through CodeCommit’s browser editor.


Lab 1 — AWS CodeCommit: store and review the application

Objective. Create a Git repository, populate it with the modernized GitHub-derived application, browse commit history, and complete one browser-only branch and pull request workflow.

Before you begin. Sign in with the assigned training IAM Identity Center role or IAM identity; Region is ap-northeast-1. Download and extract the provided source ZIP using the graphical file manager. Have a name and contact email available for commit metadata (not credentials).

1.1 Create the repository

  1. In the AWS Console search bar, search CodeCommit and open the service (direct link: https://console.aws.amazon.com/codecommit/ ).
  2. Check the Region selector in the top bar: choose Asia Pacific (Tokyo).
  3. In the left navigation choose Repositories; select Create repository.
  4. In Repository name, enter awsdevlab-webapp.
  5. In Description, enter Browser-only AWS developer tools training application.
  6. Keep repository encryption at the AWS-managed/default setting offered by your account. Do not configure CodeGuru or optional integrations for this lab unless your console mandates a setting.
  7. Choose Create. Wait for the new repository’s detail page to open.
  8. Select its Code view. An empty-repository prompt is expected: there is no default branch until your first browser-created commit.

Checkpoint CC-1: Repositories lists awsdevlab-webapp. Copy its HTTPS clone URL only as reference; do not open a terminal or clone it.

1.2 Add the application using only the CodeCommit web editor

  1. From the repository’s Code tab, choose Add file → Create file. Open README.md from the extracted source folder in a graphical text editor; copy all its contents into the CodeCommit editor; enter File name README.md.
  2. Fill Author name, Email address, and Commit message (for example, Add lab README). Select Commit changes. The console creates the main branch for the first commit in a new repository.
  3. Return to the repository’s Code tab and confirm the branch drop-down shows main. For each file below, repeat Add file → Create file, paste the file’s text, enter its exact path in File name, provide the same author/email and a meaningful commit message, then choose Commit changes:File name to create in CodeCommitPurposeindex.htmlSite HTML template and first visible release labelpackage.jsonPinned npm dependency and build/test scriptsbuildspec.ymlCodeBuild phases, CodeArtifact login and release-artifact selectionappspec.ymlCodeDeploy file mapping and lifecycle eventsscripts/install_dependenciesInstall Apache and curl on Amazon Linux 2023scripts/start_serverStart and enable Apachescripts/stop_serverGraceful stop before later deploymentsscripts/validate_serverLocal service and HTTP content verificationtests/verify-source.cjsAutomated source checkstools/build-release.cjsBuild release HTML and stage deployment package
  4. For nested names, type the entire relative path such as scripts/start_server in the Create file dialog; AWS’s CodeCommit training tutorial documents this browser-only folder-creation method. Do not flatten paths to the root. [AWS03]
  5. Verify the repository tree shows README.md, index.html, package.json, buildspec.yml, appspec.yml, and folders scripts/, tests/, tools/.
  6. Open buildspec.yml in CodeCommit and verify the domain is awsdevlab, the repository is web-npm, and artifacts.base-directory is release.
  7. Open appspec.yml and verify it is located at the repository root, includes ValidateService, and installs /index.html to /var/www/html/.
  8. Select Commits or History in the repository navigation to confirm each browser-created file produced a commit on main.

Important: Uploading the entire ZIP as one CodeCommit repository file does not unpack it into Git. Use the Create file editor separately for the listed file paths. This is deliberately slower than Git push but honors the browser-only requirement. Never paste the ZIP’s binary data into the editor.

1.3 Practice branching, review and merge entirely in CodeCommit

  1. Select Branches in the repository. Choose Create branch (the exact control may be under the Branches view).
  2. Set Branch name feature/lab-banner and Branch from main; select Create branch.
  3. Return to Code, select branch feature/lab-banner, and open index.html.
  4. Select Edit, locate the visible sentence Five services. One end-to-end delivery workflow., and replace it with Source control review completed. Ready for CI/CD. Leave <%- releaseLabel %> and <%- builtAt %> placeholders untouched.
  5. Enter a meaningful commit message such as Update demo banner in feature branch; choose Commit changes. Confirm that main still has the original text and feature/lab-banner has the update.
  6. Go to Pull requests → Create pull request. Select Source feature/lab-banner and Destination main.
  7. Review the diff. Enter title Update training website banner and a description of the change; choose Create pull request.
  8. In the pull request, review the Changes tab, add a review comment if available, then choose Merge. Select a permitted merge strategy (for a simple, conflict-free example choose Fast forward if offered), confirm the destination is main, and complete the merge.
  9. Return to branch main and open index.html. Confirm the updated sentence is present and the pull request is merged/closed.

Checkpoint CC-2: A named feature branch, a reviewed and merged pull request, and the modified file on main are visible in the CodeCommit console. If required by an organizational approval rule, ask another authorized learner to approve instead of bypassing governance.

Lab 1 evidence to capture

  • Screenshot: repository name with main branch and complete folder tree.
  • Screenshot: pull request diff and merged status.
  • Record: repository ARN, default branch, most recent commit ID.

Lab 1 troubleshooting

  • AccessDenied on creation or commit: check the trainee permission set and account/Region; a repository policy or organization SCP may restrict codecommit:CreateRepository, PutFile or merge permissions.
  • No main branch: complete the first browser-created file and refresh the page.
  • Missing scripts/ folder: nested file paths must be entered in the filename field on Create file, not in a flat Upload file chooser.
  • Pull request cannot merge: verify destination/main, source/feature, merge conflicts, branch policies and required approvals.

Lab 2 — AWS CodeArtifact: manage build dependencies

Objective. Create an AWS CodeArtifact domain and npm repository connected to the public npm registry, grant the CodeBuild role secure read access, and later verify that CodeBuild actually fetched the pinned lodash dependency through CodeArtifact.

Note on order. This lab creates the repository. The first package version will appear under Packages after the initial CodeBuild execution in Lab 3. A console-only learner does not need to authenticate npm on a local machine.

2.1 Create domain, downstream repository and npm upstream

  1. Use AWS Console search to open CodeArtifact (direct link: https://console.aws.amazon.com/codesuite/codeartifact/start ). Check Region ap-northeast-1.
  2. Choose Create repository from the Repositories view.
  3. Set Repository name to web-npm and optional description Dependencies consumed by the web application CodeBuild project.
  4. Under Public upstream repositories, select the npm-store option that connects to the public npmjs registry. The wizard will create/link an upstream repository named npm-store. Do not leave the public upstream selection empty; this is how the first lodash package is ingested.
  5. Choose Next. For AWS account, choose This AWS account.
  6. For Domain name, enter awsdevlab (new domain). If a domain already exists, only reuse it if your instructor confirms the domain ownership and permissions.
  7. Under Additional configuration, choose the AWS managed key for domain encryption for this disposable lab; customer-managed KMS keys require additional permissions.
  8. Choose Next, review the package flow web-npm → npm-store → npmjs, then Create repository.
  9. From Repositories, verify both web-npm and npm-store exist and are associated with domain awsdevlab; from Domains, verify awsdevlab exists.
  10. Open repository web-npm and select View connection instructions → npm. Inspect the displayed domain/repository/Region endpoint. This screen is for understanding the connection; do not execute the suggested terminal login command. Authentication will occur inside CodeBuild using buildspec.yml in Lab 3. [AWS04]

Checkpoint CA-1: CodeArtifact’s repository view shows web-npm, its upstream npm-store and the new domain awsdevlab. The package list might correctly be empty until Lab 3.

2.2 Prepare the future CodeBuild access policy in IAM

The policy below is intended for the CodeBuild service role, not the trainee identity or EC2 instance. Create it after CodeBuild creates its role in Lab 3 (the next section gives the exact console steps). Do not place CodeArtifact tokens in CodeCommit, package.json, or CodeBuild plaintext environment variables. Each build automatically acquires a short-lived token. [AWS05]

IAM policy template — replace ACCOUNT_ID with your 12-digit account ID before saving. This is policy JSON, not a terminal command.

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "CodeArtifactDomainToken",
      "Effect": "Allow",
      "Action": "codeartifact:GetAuthorizationToken",
      "Resource": "arn:aws:codeartifact:ap-northeast-1:ACCOUNT_ID:domain/awsdevlab"
    },
    {
      "Sid": "CodeArtifactReadRepository",
      "Effect": "Allow",
      "Action": [
        "codeartifact:GetRepositoryEndpoint",
        "codeartifact:ReadFromRepository"
      ],
      "Resource": "arn:aws:codeartifact:ap-northeast-1:ACCOUNT_ID:repository/awsdevlab/web-npm"
    },
    {
      "Sid": "AllowServiceBearerToken",
      "Effect": "Allow",
      "Action": "sts:GetServiceBearerToken",
      "Resource": "*",
      "Condition": {
        "StringEquals": {
          "sts:AWSServiceName": "codeartifact.amazonaws.com"
        }
      }
    }
  ]
}

Instructor checkpoint: Explain the two trust boundaries: the trainee can configure IAM, while CodeBuild assumes its own execution role. sts:GetServiceBearerToken is separate from CodeArtifact’s repository authorization. The example grants read, not publish, permissions. [AWS06]

2.3 Return after Lab 3 to prove package use

  1. After the first successful CodeBuild run, open CodeArtifact → Repositories → web-npm → Packages.
  2. Refresh. Search for lodash. Open the package and confirm a package version such as 4.17.21 is present.
  3. Inspect its assets/metadata. Navigate to npm-store and examine the upstream relationship, if shown in your console.
  4. Return to CodeBuild’s build logs. Confirm the CodeArtifact login phase and package-install phase succeeded; treat CodeArtifact package presence and build success together as evidence that the dependency path worked.

Checkpoint CA-2: lodash 4.17.21 appears in the downstream repository following a successful build. Package visibility may lag; refresh before troubleshooting.

Lab 2 troubleshooting

  • Public package missing after build: check upstream npm-store, public internet egress from CodeBuild, build logs, and whether the build actually installed npm dependencies. Do not assume an empty package list before first build is a fault.
  • Token authorization error: CodeBuild role requires CodeArtifact token + repository read actions and sts:GetServiceBearerToken; root credentials cannot request a CodeArtifact auth token.
  • Repository not listed in CodeBuild account: verify Region, account, domain and repository spelling. Cross-account CodeArtifact access needs additional resource policies not covered here.
  • Private VPC build cannot access CodeArtifact/npmjs: use the default service-managed CodeBuild networking for this course; custom VPC builds need additional routes/endpoints.

Lab 3 — AWS CodeBuild: test, build and store a release ZIP

Objective. Create a standalone CodeBuild project whose source is CodeCommit, automatically fetch npm lodash from CodeArtifact, run tests, generate an index.html with a release label, and publish a fully formed CodeDeploy revision as a ZIP in private S3.

What success looks like: CodeBuild status Succeeded, test result PASS, S3 ZIP contains appspec.yml, index.html, and scripts/* at the archive root, and the CodeArtifact package can be inspected in its console.

3.1 Create the private S3 release-artifact bucket

  1. Open Amazon S3 → Buckets → Create bucket.
  2. Choose General purpose bucket. Set Bucket name to awsdevlab-artifacts-ACCOUNTID-apne1 (substitute your account ID; append a suffix if already in use).
  3. Set the AWS Region to Asia Pacific (Tokyo).
  4. Leave Block all public access enabled. Do not make the bucket or its objects public.
  5. For Bucket Versioning, choose Disable for this disposable lab, unless your institution requires versioning (if enabled, cleanup requires deleting versions and delete markers).
  6. For Default encryption, leave SSE-S3 or another account-approved default. For the simplest lab, use SSE-S3 rather than customer-managed KMS.
  7. Leave other settings at their defaults; choose Create bucket and record its exact name.
  8. Open the bucket and confirm the Permissions panel shows Block Public Access enabled.

Checkpoint CB-1: Private, same-Region S3 bucket is available and empty.

3.2 Create the CodeBuild project

  1. Open CodeBuild → Build → Build projects → Create build project (or Create build project from the welcome screen).
  2. Project configuration → Project name: awsdevlab-web-build. Enter a short description such as CodeCommit → CodeArtifact npm → test → S3 deployable ZIP.
  3. Source → Source provider: choose AWS CodeCommit. Repository: awsdevlab-webapp. Reference type: Branch. Branch: main (if requested). Leave Git depth and submodules at defaults unless your console requires an option.
  4. Environment → Provisioning model: On-demand (managed). Environment image: Managed image. Operating system: Amazon Linux. Runtime: Standard. Image: select Amazon Linux 2023 x86_64 standard:6.0 (the exact catalog label may include aws/codebuild/amazonlinux-x86_64-standard:6.0). Choose a Linux container and the smallest general-purpose compute option appropriate for a lightweight Node build.
  5. Environment → Service role: choose New service role; note the automatically proposed role name, such as codebuild-awsdevlab-web-build-service-role. Avoid privileged mode (not required), a custom VPC, secrets or additional environment variables for this lab.
  6. Buildspec → Build specifications: choose Use a buildspec file in the source root. Confirm the name is buildspec.yml (do not paste terminal commands into the browser).
  7. Artifacts → Type: Amazon S3. Select the private bucket created in 3.1.
  8. Artifact name: web-demo-release.zip. Select ZIP packaging. Keep a blank Path, choose No namespace / None if that field appears, and leave any artifact name override/semantic versioning option off. If the option Remove artifacts encryption appears, use it only if the bucket enforces SSE-S3 and the course is not using client-side AWS KMS artifact encryption; otherwise use the default encryption and grant the deployment role appropriate KMS decrypt permissions.
  9. Cache: No cache for the first run. Logs: enable CloudWatch Logs to capture the build phases. Accept a generated or explicitly named log group; record it for cleanup.
  10. Choose Create build project. Note the project’s Service role ARN on the details page. [AWS07][AWS08]

Image selection note. AWS currently documents Node.js 22 on the Amazon Linux 2023 standard 6.0 CodeBuild image. Our buildspec.yml explicitly selects Node.js 22 to avoid silent runtime changes. [AWS09]

3.3 Grant CodeBuild role access through the IAM console

  1. Open IAM → Roles in another tab.
  2. Search for the CodeBuild service role recorded in 3.2. Select it; verify its trusted entity/service is codebuild.amazonaws.com.
  3. On Permissions, select Add permissions → Create inline policy (or create a customer-managed policy in IAM → Policies and attach it to this role). Open the JSON editor.
  4. Replace ACCOUNT_ID in the Lab 2 CodeArtifact policy with your actual account ID and paste the full JSON. Choose Next; enter policy name AWSDevLabCodeArtifactRead; review and Create policy. Wait until the policy appears on the CodeBuild role.
  5. Inspect the existing CodeBuild role permissions for CodeCommit source access, CloudWatch Logs, and the chosen S3 output bucket. The console may create some scoped policies automatically; do not assume permissions are present solely because the role exists.
  6. If the role lacks S3 write or CodeCommit pull access, create and attach this supplementary inline policy, replacing ACCOUNT_ID in the resource ARNs and the ARTIFACT_BUCKET value with the actual bucket name:
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "ReadTrainingCodeCommit",
      "Effect": "Allow",
      "Action": ["codecommit:GitPull", "codecommit:GetRepository"],
      "Resource": "arn:aws:codecommit:ap-northeast-1:ACCOUNT_ID:awsdevlab-webapp"
    },
    {
      "Sid": "InspectArtifactBucket",
      "Effect": "Allow",
      "Action": ["s3:GetBucketLocation", "s3:ListBucket"],
      "Resource": "arn:aws:s3:::ARTIFACT_BUCKET"
    },
    {
      "Sid": "WriteArtifactObjects",
      "Effect": "Allow",
      "Action": ["s3:PutObject", "s3:GetObject"],
      "Resource": "arn:aws:s3:::ARTIFACT_BUCKET/*"
    }
  ]
}
  1. Review the IAM policy summary before saving; confirm the target is the CodeBuild role and there are no unresolved placeholder values. If an organization SCP or bucket policy applies an explicit deny, fixing the IAM role alone may not be sufficient.

Checkpoint CB-2: CodeBuild’s execution role has CodeArtifact read/token, service bearer token, CodeCommit pull, CloudWatch log permissions, and S3 artifact write permissions.

3.4 Inspect the build contract before running

  1. Open CodeCommit → awsdevlab-webapp → Code → main → buildspec.yml.
  2. Confirm install selects Node.js 22; pre_build authenticates npm to CodeArtifact and installs dependencies; the test checks source structure; build generates the release; artifacts packages release/** with release as the base directory.
  3. Open package.json. Confirm dependency lodash is pinned to version 4.17.21 and has test and build scripts.
  4. Open tools/build-release.cjs. Confirm it renders the template with lodash, copies appspec.yml, and includes all four CodeDeploy hooks in the release/scripts/ directory.
  5. Explain to learners that the YAML/JavaScript/shell files are source configuration. The user never manually runs their operations. CodeBuild executes the buildspec internally using the service role; CodeDeploy executes lifecycle hooks later on the deployment host.

Production distinction: For teaching a first-time upstream cache ingest, this lab pins a single dependency and performs a fresh package resolution without a lockfile. For production, create a reviewed registry-consistent lockfile, use a reproducible installation mode, add vulnerability scanning, and remove unnecessary public dependency access.

3.5 Start and inspect the standalone build

  1. Return to CodeBuild → Build projects → awsdevlab-web-build.
  2. Choose Start build. For source version, choose the default/latest main revision; leave optional build overrides unchanged and choose Start build.
  3. Open the new build ID in Build history. Watch each phase: DOWNLOAD_SOURCE, INSTALL, PRE_BUILD, BUILD, UPLOAD_ARTIFACTS, FINALIZING.
  4. On the Build logs tab, confirm the CodeArtifact npm login step completed successfully, dependency installation completed, the automated test printed a PASS message, and build output states the release directory was created.
  5. Confirm the build’s top-level Status is Succeeded. Record the build ID and source commit ID.
  6. In the build detail Artifacts section, follow the Artifacts upload location link to S3, or open S3 → your artifact bucket manually.
  7. Locate web-demo-release.zip (or the S3 object whose exact key appears in the build details). Confirm it is an S3 object, not a folder of loose individual files.
  8. From the S3 object page, choose Download in the browser; use your operating system’s graphical archive viewer to inspect its entries. The expected ZIP hierarchy is:
appspec.yml
index.html
scripts/install_dependencies
scripts/start_server
scripts/stop_server
scripts/validate_server
  1. Verify that appspec.yml is at the ZIP root, not inside release/, source/, a GitHub folder or another nested directory. Open the packaged index.html in a local text editor and confirm the visible Release: LAB-V1 placeholder has been rendered and the build time is a real UTC timestamp.
  2. Return to CodeArtifact → web-npm → Packages; verify lodash version 4.17.21 appears (allow some time and refresh if initially absent).

Checkpoint CB-3: Build Succeeded, release ZIP has correct file paths, lodash is present in CodeArtifact, and build log contains the source-test PASS. Save the S3 URI of the ZIP for manual CodeDeploy deployment.

Lab 3 troubleshooting matrix

Symptom in CodeBuildVerify in consoleRecovery without terminal
Source download failsBuild log; CodeCommit repository and branch; role policyCheck same Region, correct branch, codecommit:GitPull, repo ARN
CodeArtifact access deniedPRE_BUILD log and CodeBuild roleApply all 3 permissions areas from Lab 2, including sts:GetServiceBearerToken
npm package not found / 404Domain, downstream upstream flowConnect web-npm to npm-store and npmjs; retry build
buildspec.yml not foundCodeCommit treeCreate at repository root, correct spelling (not buildspec.yaml)
Node runtime unsupportedBuild environment imageUse AL2023 x86_64 standard 6.0 and Node.js 22
Test failedDetailed log; tests/ pathRestore exact sample file paths and template markers
Artifact upload failedUPLOAD_ARTIFACTS and IAM/S3Check S3 PutObject, actual bucket ARN, ZIP packaging and encryption
ZIP contains nested release/ directoryBuildspec base-directorySet base-directory: release, re-run, inspect ZIP again

Lab 4 — AWS CodeDeploy: deploy the build artifact to Amazon EC2

Objective. Launch a single Amazon Linux 2023 target, install the CodeDeploy agent entirely through the CodeDeploy/Systems Manager consoles, manually deploy the tested ZIP from Lab 3, inspect lifecycle events, and validate the live HTTP website.

Architecture note. This is intentionally a single-instance, in-place deployment with no load balancer. It teaches CodeDeploy lifecycle events. It is not a highly available production deployment. The web server is installed by lifecycle hooks included in the build artifact; the learner does not manually run installation commands.

4.1 Create the EC2 instance profile (IAM role)

  1. Open IAM → Roles → Create role.
  2. Under Trusted entity type, choose AWS service; Use case → EC2; choose Next.
  3. In Permissions, attach AmazonSSMManagedInstanceCore and AmazonEC2RoleforAWSCodeDeploy. The latter grants broad S3 read permissions and is convenient for this isolated course; do not use its broad S3 resource scope unreviewed in production. For production, scope S3 reads to approved artifact paths and any required AWS-owned service buckets. [AWS10]
  4. Choose Next; enter Role name awsdevlab-ec2-role; optionally add tag Course=AWSDevLab; choose Create role.
  5. Open the role and verify its Trust relationships shows the EC2 service principal, and its Permissions tab contains both managed policies.

Checkpoint CD-1: An EC2-trusted instance role exists, with SSM access and the CodeDeploy agent’s artifact access.

4.2 Launch the EC2 target using the EC2 console

  1. Open EC2 → Instances → Launch instances.
  2. Set Name to awsdevlab-web-ec2. This creates Name=awsdevlab-web-ec2, which the deployment group will use to select the target.
  3. Under Application and OS Images (AMI) choose Amazon Linux and explicitly select Amazon Linux 2023 (AL2023), x86_64. Do not choose an old Amazon Linux 2 image only because an older walkthrough shows it.
  4. Under Instance type, choose a small, supported general-purpose type suitable for the course, such as t3.micro if available and permitted. Verify pricing in your account; do not assume free-tier eligibility.
  5. Under Key pair (login) choose Proceed without a key pair if allowed. This lab uses no SSH. If your organization requires an approved key pair, choose it, but do not open TCP/22 merely for this tutorial.
  6. Expand Network settings → Edit. Select the instructor-approved VPC and public subnet. Choose Auto-assign public IP: Enable. Ensure the subnet’s route table provides an Internet Gateway path for internet-facing test traffic.
  7. Create a new security group awsdevlab-http-sg with Inbound HTTP TCP/80 → Source type: My IP. Remove SSH TCP/22 if the wizard adds it automatically. Leave the normal outbound rule allowing required service access. Record the IPv4 CIDR displayed for My IP; this may need to be updated if your public IP changes.
  8. Under Configure storage, keep the default encrypted/root EBS volume size offered by the selected AMI (small is sufficient). Check Delete on termination is enabled for the root volume.
  9. Expand Advanced details. Under IAM instance profile, select awsdevlab-ec2-role. No user data is required; do not paste bootstrapping commands.
  10. Under Summary, verify Number of instances = 1. Choose Launch instance.
  11. In EC2 → Instances, select the new instance and wait for Instance state: Running and Status checks: 2/2 checks passed. Record instance ID, public IPv4, public DNS and the security group.

Checkpoint CD-2: One AL2023 EC2 instance is running in a public subnet with Name tag awsdevlab-web-ec2, assigned instance role and HTTP ingress only from your IP.

4.3 Confirm SSM sees the instance; do not install agents from a shell

  1. Open AWS Systems Manager in ap-northeast-1. Under Node Management / Fleet Manager → Managed nodes, look for the EC2 instance ID. Console navigation grouping may vary; search Managed nodes inside Systems Manager if necessary.
  2. Confirm the node shows a healthy/online SSM agent connection. AL2023 Amazon-provided AMIs typically include SSM Agent; registration requires the EC2 IAM role and outbound connectivity.
  3. If not online, revisit the EC2 instance profile, VPC internet route, network ACL, outbound security group and SSM prerequisites. Do not continue until the instance is manageable. [AWS11]

4.4 Create the CodeDeploy service role

  1. Open IAM → Roles → Create role.
  2. Choose AWS service → CodeDeploy → CodeDeploy as the use case and Next.
  3. Confirm the console proposes or attaches AWSCodeDeployRole managed policy for EC2/On-Premises deployments.
  4. Set role name awsdevlab-codedeploy-role; choose Create role.
  5. Open the role and verify its trust principal is codedeploy.amazonaws.com.

Checkpoint CD-3: The CodeDeploy service role exists and is distinct from the EC2 instance role and the CodeBuild role.

4.5 Create the CodeDeploy application and deployment group

  1. Open CodeDeploy → Deploy → Applications → Create application.
  2. Application name: awsdevlab-web-app. Compute platform: EC2/On-premises. Choose Create application.
  3. On the application page select Create deployment group.
  4. Deployment group name: awsdevlab-web-ec2. Service role: choose the ARN of awsdevlab-codedeploy-role.
  5. Under Deployment type, choose In-place.
  6. Under Environment configuration, choose Amazon EC2 instances. Set tag selector Key = Name, Value = awsdevlab-web-ec2. If the console shows a matched-instance count, confirm one target is selected.
  7. Under Agent configuration with AWS Systems Manager, choose Now and schedule updates. This uses Systems Manager to install/configure the CodeDeploy agent on selected instances; this field is the key to our no-terminal requirement. If this option is absent, see the alternative in Step 4.6. [AWS12]
  8. Deployment configuration: CodeDeployDefault.OneAtATime. Load balancer: disable Enable load balancing for this one-instance course.
  9. Review fields; choose Create deployment group.
  10. In the deployment group’s details, verify in-place, EC2 target tag, CodeDeploy service role and agent management settings. Allow agent installation to finish before deploying.

Checkpoint CD-4: Application and deployment group exist; the correct EC2 target is registered; CodeDeploy agent installation is being managed by SSM.

4.6 Fallback: install CodeDeploy agent with Systems Manager’s visual package workflow

Use this only if the deployment group’s agent-management UI is absent or reports an install failure. It is still browser-only.

  1. Open Systems Manager → Node Management → Distributor (or the Systems Manager package-management feature; console groupings change). Choose Third party / Amazon-owned packages or the repository of available packages.
  2. Search for the AWS package AWSCodeDeployAgentV2, the AWS-documented package for CodeDeploy agent version 2.0 and later. Select the package and Install / Install package.
  3. In the setup choose Installation type: Install and target the managed EC2 instance ID from 4.2. For recurring updates, choose the update schedule your instructor approves; a one-off install is enough for a disposable lab.
  4. Choose Run / Create association as the UI offers. View the Command/Association execution status until Success. Do not enter custom shell scripts or use the terminal. [AWS13]
  5. Return to the CodeDeploy deployment group and verify agent readiness. If the package screen differs materially, follow the AWS CodeDeploy agent installation via Systems Manager documentation cited in the References section.

4.7 Deploy the S3 build output manually

  1. Open S3 → the standalone artifacts bucket → web-demo-release.zip. From the object detail page, choose Copy S3 URI (or copy the actual S3 object path). The value must point to the exact ZIP object, not the bucket, prefix or console webpage URL.
  2. Return to CodeDeploy → Applications → awsdevlab-web-app → Deployments → Create deployment.
  3. Deployment group: awsdevlab-web-ec2.
  4. Under Repository / Revision type, select My application is stored in Amazon S3.
  5. Revision location: paste the full S3 object URI, such as s3://awsdevlab-artifacts-ACCOUNTID-apne1/web-demo-release.zip (replace with real bucket/key).
  6. Revision file type: .zip. Enter description Manual deployment of tested CodeBuild release.
  7. Leave the configured deployment group strategy, deployment configuration and any optional rollback settings at their course defaults. If auto rollback on failure is available, enable it for safety, but understand a first-time deployment has no last-good revision to roll back to.
  8. Choose Create deployment. Record its deployment ID. [AWS14]

4.8 Validate lifecycle execution and the public website

  1. On the CodeDeploy deployment detail page, inspect Deployment status until Succeeded.
  2. Expand Deployment lifecycle events / Instance details. Confirm the expected events were completed: BeforeInstall → Install → ApplicationStart → ValidateService. ApplicationStop is normally skipped on the first deployment because there is no previous successfully deployed revision from which to load a stop hook.
  3. If an event is red/failed, select its error/details link or related View logs link in the deployment pane. The instance’s agent logs are not required for the normal success path; the UI’s failure details should be your first stop.
  4. From EC2 → Instances → awsdevlab-web-ec2, copy its Public IPv4 address or Public IPv4 DNS. In a new browser tab, open the http:// URL (not https://, because the course does not configure TLS).
  5. Confirm the page displays AWS Developer Services Lab, the merged banner from Lab 1, Release: LAB-V1, and a UTC build time. Take a screenshot showing the browser URL and page content.
  6. If the browser times out but CodeDeploy succeeded, check the instance’s public IP, inbound HTTP/80 rule with your current My IP, public route table, and local network restrictions. If the browser returns HTTP error 403/404, inspect Apache lifecycle hooks or the ZIP’s path structure.

Checkpoint CD-5: CodeDeploy deployment status Succeeded, ValidateService succeeded and a real browser request to the instance’s public IP returns the released page.

Lab 4 troubleshooting matrix

SymptomLikely issueBrowser-based recovery
No EC2 targets matchedTag mismatch or wrong RegionCheck EC2 Name tag, CodeDeploy group tag Key/Value and account/Region
Deployment never begins / skipped targetCodeDeploy agent not installed / not healthyCheck SSM Managed nodes and agent association; use Distributor V2 workflow
Failed BeforeInstallApache package install error / outbound internetOpen lifecycle failure, verify public subnet internet and EC2 outbound access; retry after network fix
Failed Install (missing AppSpec)ZIP root structure wrongOpen standalone ZIP locally; AppSpec must be at root, rebuild from CodeBuild
AccessDenied fetching revisionIAM role / S3 object / KMSCheck EC2 instance profile s3:GetObject, exact S3 key and any KMS decrypt grant
Failed ApplicationStartWeb server not runningOpen lifecycle error, confirm AL2023, install hook and scripts in revision
Failed ValidateServiceHTTP endpoint/content verification failedCheck the rendered index.html, Apache service startup and root path
CodeDeploy Succeeded but public page inaccessibleHTTP/80 inbound / public IP / VPC routeCheck My IP CIDR, subnet/IGW, instance public IPv4; use HTTP URL

Lab 5 — AWS CodePipeline: automate source → build → deploy

Objective. Transform the standalone CodeBuild project into a pipeline-compatible action, create a V2 CodePipeline containing CodeCommit source, CodeBuild build and CodeDeploy deployment, then demonstrate an automatic rebuild and redeployment from an in-browser CodeCommit edit.

Two essential integration rules: (1) The existing CodeBuild project must have Source provider = AWS CodePipeline and Artifacts type = AWS CodePipeline before the pipeline executes it. (2) The CodeDeploy action input artifact must be the CodeBuild output (often BuildArtifact), not the CodeCommit raw source output (SourceArtifact). Missing either rule is a common source of misleading pipelines that cannot deploy the rendered HTML. [AWS15][AWS16]

5.1 Reconfigure the existing build project for CodePipeline

  1. Open CodeBuild → Build projects → awsdevlab-web-build.
  2. Choose Edit → Source. Change Source provider from AWS CodeCommit to AWS CodePipeline. The pipeline will now supply source ZIPs to this project. Save Update source / Update configuration, depending on the screen.
  3. Choose Edit → Artifacts. Change Type from Amazon S3 to AWS CodePipeline; save. This does not delete the standalone ZIP created earlier in S3.
  4. Verify Environment still uses AL2023 x86_64 standard 6.0, Service role is the same CodeBuild role (with CodeArtifact read access), and Buildspec still uses root buildspec.yml.
  5. On project details verify Source: AWS CodePipeline and Artifacts: AWS CodePipeline. Do not use Start build directly for another standalone test; pipeline now supplies the input source and manages artifacts.

Checkpoint CP-1: The existing, already-tested CodeBuild project is configured for CodePipeline source and artifact exchange.

5.2 Create the V2 custom pipeline in the AWS console

  1. Open CodePipeline → Pipelines → Create pipeline.
  2. On Choose creation option, select Build custom pipeline, then Next. Avoid a prebuilt template that changes the pipeline’s service architecture.
  3. On Pipeline settings, set Pipeline name awsdevlab-web-pipeline.
  4. For Pipeline type, use V2 (the current console experience). Select New service role and allow AWS to create the CodePipeline service role. Record its role ARN. Keep the default same-Region S3 pipeline artifact store unless organizational policy requires a preexisting protected artifact bucket. Choose Next. [AWS02]
  5. Add source stage: Source provider = AWS CodeCommit. Repository name = awsdevlab-webapp. Branch name = main. For Output artifact format, choose CodePipeline default, not Full clone, because the deployment later needs buildable ZIP contents. Enable Start the pipeline on source code change / EventBridge change detection. Confirm the source output artifact name, normally SourceArtifact. Choose Next.
  6. Add build stage: Build provider = AWS CodeBuild. Select Existing project, then choose awsdevlab-web-build. Keep build mode Single build if offered, not batch build. Confirm the build receives SourceArtifact and will produce a new output artifact, normally BuildArtifact. Choose Next.
  7. Add test stage, if offered: choose Skip test stage, since CodeBuild already runs the automated test in its PRE_BUILD phase. For production, consider a distinct dedicated test stage.
  8. Add deploy stage: Deploy provider = AWS CodeDeploy. Application name = awsdevlab-web-app. Deployment group = awsdevlab-web-ec2. If there is an Input artifacts selector, explicitly choose the CodeBuild output (normally BuildArtifact). Choose Next.
  9. On the Review page check source repository and branch, build project name, deployment group, artifact wiring and V2 type. Choose Create pipeline.
  10. The pipeline may start an initial execution immediately. In Pipeline details / Edit, inspect the Deploy action. If it selected SourceArtifact or a different input, choose Edit action, set Input artifact to the CodeBuild BuildArtifact, and Save the pipeline change. Trigger a fresh execution using Release change after correcting the input; the first run may have failed if it used an incorrect artifact.
  11. Inspect the pipeline’s automatically created artifact bucket from Pipeline settings / Artifact store and record its name. These artifacts are managed separately from the standalone Lab 3 S3 bucket.

Checkpoint CP-2: The pipeline visually shows Source (CodeCommit) → Build (CodeBuild) → Deploy (CodeDeploy). Source output flows to Build; Build output flows to Deploy.

5.3 Observe first complete pipeline execution

  1. On the pipeline Executions or visualization page, choose Release change if no execution is in progress; confirm the action when prompted.
  2. Watch Source become Succeeded. Select its execution details and verify the main branch and latest CodeCommit commit ID.
  3. Watch Build. Follow View details to CodeBuild and confirm tests, CodeArtifact npm authentication and release/ packaging all succeed.
  4. Watch Deploy. Follow View details to CodeDeploy and confirm the correct application/deployment group and all lifecycle events succeed.
  5. Once the full pipeline is Succeeded, refresh the browser tab pointing at the EC2 public IP. Confirm the page remains accessible and the Build time (UTC) reflects the new pipeline build.
  6. Capture the pipeline execution ID, CodeCommit commit ID, CodeBuild build ID and CodeDeploy deployment ID. These four linked IDs form the traceable evidence chain for the release.

Checkpoint CP-3: A green three-stage pipeline deploys a built ZIP produced by CodeBuild and the HTTP page is healthy.

5.4 Demonstrate a true automatically triggered change

  1. Open CodeCommit → awsdevlab-webapp → Code → main → index.html.
  2. Select Edit. Change the visible headline AWS Developer Services Lab (inside the <h1> element only) to AWS Developer Services Lab — Version 2. Keep the separate <title> text, the verification marker strings, the releaseLabel template placeholder and the lab-check element untouched.
  3. The source-test checker intentionally verifies the phrase AWS Developer Services Lab, which remains a substring of the updated heading, so the test will continue to pass.
  4. Enter commit message Release version 2 from CodeCommit console and choose Commit changes directly on main for the automatic-trigger demonstration. (In a governed production workflow, use a pull request with approvals.)
  5. Immediately return to CodePipeline → awsdevlab-web-pipeline. Observe a new execution created by the CodeCommit change. It can take a short time for the event to arrive.
  6. Verify Source, Build, Deploy each become Succeeded. In Build logs, look for PASS and the generated release. In CodeDeploy, confirm ValidateService succeeded.
  7. Refresh the public page. Confirm the new heading AWS Developer Services Lab — Version 2 and a changed UTC build time.
  8. Optionally open CodeCommit → Commits, CodePipeline → Executions, CodeBuild → Build history, and CodeDeploy → Deployments side by side and connect the commit, pipeline, build and deployment IDs.

Checkpoint CP-4: A single CodeCommit browser edit automatically results in a tested, packaged and successfully deployed Version 2 website—without manually starting a build or deployment.

5.5 Optional: introduce a controlled failure and practice recovery

  1. Open index.html through CodeCommit Edit and temporarily remove the HTML element with id="lab-check". Commit this change on a separate temporary branch or on main only if the class permits deliberately failing the training pipeline.
  2. Observe the subsequent Build stage fail its source test in CodeBuild. Confirm CodePipeline does not run a new successful Deploy action for that failed source revision; the old website should remain reachable.
  3. Restore the id="lab-check" element using the CodeCommit browser editor and commit the corrected file. Re-run (or allow the trigger to start) the pipeline.
  4. Verify the next pipeline execution becomes Succeeded and the website is healthy. Explain why build-time tests prevent a defective revision from reaching the deployment stage.

Safety note: A pipeline source-stage rule, branch permission or manual approval may prevent an automatic trigger. If so, capture that governance behavior as part of the exercise rather than disabling organizational controls without permission.

Lab 5 troubleshooting matrix

SymptomInspectCorrective action in console
CodePipeline build says wrong source typeCodeBuild Source settingsChange CodeBuild Source to AWS CodePipeline
CodeBuild artifact type mismatchCodeBuild Artifacts settingsChange Type to AWS CodePipeline
Deploy step says missing AppSpec or raw template shownDeploy action Input artifactsSelect BuildArtifact, not SourceArtifact
No auto-trigger after CodeCommit commitSource stage change detectionCheck main branch, EventBridge rule and pipeline trigger settings; release manually to isolate fault
CodePipeline cannot use CodeBuildPipeline service role permissionsConfirm codebuild:StartBuild, codebuild:BatchGetBuilds, build project ARN
CodeDeploy cannot read pipeline artifactEC2 instance role / artifact bucket and KMS policyCheck managed S3 GetObject and any extra KMS decrypt rights
Only first pipeline worksRegion/branch, token refresh, artifact namesTrace each stage’s current input/output and cloud log references
Old website after green runBrowser cache, wrong public IP, artifact inputHard-refresh browser, inspect build timestamp, deploy action artifact and EC2 target tag

Instructor verification and assessment

Deliverable checklist

GateMust-have evidencePass condition
CC-1/2CodeCommit repo tree; PR diff; merged statusCorrect root/nested paths, main branch, completed review
CA-1/2CodeArtifact domain, npm upstream, cached lodashweb-npm and npm-store; lodash 4.17.21 after successful build
CB-1/3Private artifact bucket; CodeBuild status/log; release ZIPSucceeded, tests PASS, AppSpec at ZIP root, readable release content
CD-1/5EC2 role/instance/SSM; deployment detail; web pageManaged EC2 target, CodeDeploy Succeeded, ValidateService passed, HTTP page loads
CP-1/4Pipeline wiring; second execution; Version 2 pageV2 pipeline, BuildArtifact to Deploy, automatic trigger, page changes
Clean-upEmpty artifact buckets; deleted EC2 and lab resourcesNo running instances/pipelines or remaining paid lab artifacts

Suggested assessment (100 points): CodeCommit 15; CodeArtifact 15; CodeBuild 20; CodeDeploy 25; CodePipeline 20; safe clean-up 5. Award points only for screenshots/IDs or in-console evidence; do not award on the basis of claimed success alone.

Security and production-hardening discussion

  • IAM: The provided CodeBuild CodeArtifact policy is scoped to one repository/domain. The beginner-friendly EC2 AmazonEC2RoleforAWSCodeDeploy managed policy is broad (s3:* read-related actions on all resources); consider a custom scope for production, including service-specific buckets, and any required customer-managed KMS permissions.
  • Package supply chain: CodeArtifact is an upstream/cache boundary, not malware scanning by itself. Pin versions, adopt lockfiles, scan dependency vulnerabilities, govern upstream repositories and consider repository package-origin controls.
  • Deployment: A single EC2 instance and HTTP from My IP are instructional. For production use private instances, an ALB, TLS, launch templates or images with the CodeDeploy agent, Auto Scaling or blue/green, alarms and rollback.
  • Build security: Keep CodeBuild privileged mode OFF when not needed; avoid plaintext secrets and broad service roles; log and monitor builds, consider VPC endpoints and private package access.
  • Release governance: Prefer PR reviews, protected main branch, manual approval for production stages, deployment windows, change records and automated failure alarms.

No-terminal cleanup runbook — perform in this order

Why the order matters: Pipelines may retrigger from new source commits, deployments may create Systems Manager associations, and S3 buckets may contain automatically generated artifacts. Removing high-level orchestration first reduces orphaned resources.

  1. CodePipeline: Open Pipelines → awsdevlab-web-pipeline. Stop/disable active executions or transitions if possible; then select Delete pipeline and confirm. Record the CodePipeline-managed S3 artifact bucket from pipeline settings before deleting if you have not already recorded it.
  2. CodeDeploy: Open Applications → awsdevlab-web-app; inspect deployment group and any active deployments. Delete the deployment group and application through their Delete controls. Review Systems Manager → State Manager/Associations for any CodeDeploy agent installation/update associations created for the target and remove lab-only associations if they remain.
  3. EC2: Open EC2 → Instances; select awsdevlab-web-ec2 and choose Instance state → Terminate instance. Confirm termination. Inspect Volumes, Snapshots and Elastic IPs for any lab-only resources left behind; delete only those created by this lab. Delete awsdevlab-http-sg after the instance releases the security group.
  4. CodeBuild: Open Build projects → awsdevlab-web-build → Delete. Check its optional CloudWatch Logs group; delete the lab-specific log group after saving any instructional evidence.
  5. CodeCommit: Open Repositories → awsdevlab-webapp → Delete repository. Confirm that there is no source data you still need.
  6. CodeArtifact: Under Repositories delete web-npm and npm-store (including package contents per prompts), then go to Domains and delete awsdevlab. You cannot delete a domain until its repositories have been removed.
  7. Amazon S3: Empty the standalone awsdevlab-artifacts-ACCOUNTID-apne1 bucket, then Delete bucket. Identify the separate CodePipeline-generated artifact bucket/folder; remove the pipeline’s lab objects, and delete the bucket only if you confirm no other pipeline shares it. Versioned buckets require removal of all object versions and delete markers.
  8. IAM: Delete the lab-specific IAM roles awsdevlab-ec2-role, awsdevlab-codedeploy-role, the generated CodeBuild service role, and the generated CodePipeline role only after confirming nothing else uses them. Delete any custom AWSDevLabCodeArtifactRead policy if not reused. Detach policies before deleting roles when the console requests it.
  9. CloudWatch/EventBridge: Inspect for lab-only log groups, alarms and EventBridge rules still present; delete orphaned lab-only resources. Some change detection rules are removed automatically when the pipeline is deleted.
  10. Cost review: Open Billing and Cost Management → Cost Explorer after billing data posts. Look for EC2, CodeBuild, CodeArtifact, CodePipeline, S3, public IPv4 and CloudWatch charges. Cost data is not necessarily real time.

Final cleanup gate: EC2 Instances shows no running training EC2, CodePipeline and CodeBuild no longer list training resources, CodeArtifact domain is deleted, the standalone S3 bucket is gone, and training IAM roles are removed or explicitly retained by policy.


Reference guide: verified documentation and sample provenance

KeyCurrent authoritative/reference materialURL
AWS01AWS announcement: CodeCommit returned to general availability (24 November 2025)https://aws.amazon.com/blogs/devops/aws-codecommit-returns-to-general-availability/
AWS02AWS CodePipeline: create a custom pipeline (console), V1/V2, stages and change detectionhttps://docs.aws.amazon.com/codepipeline/latest/userguide/pipelines-create.html
AWS03AWS CodePipeline tutorial: CodeCommit browser files and nested pathshttps://docs.aws.amazon.com/codepipeline/latest/userguide/tutorials-simple-codecommit.html
AWS04AWS CodeArtifact: getting started using the consolehttps://docs.aws.amazon.com/codeartifact/latest/ug/getting-started-console.html
AWS05CodeArtifact authentication/token behaviorhttps://docs.aws.amazon.com/codeartifact/latest/ug/tokens-authentication.html
AWS06CodeArtifact: using npm packages in CodeBuild and IAM permissionshttps://docs.aws.amazon.com/codeartifact/latest/ug/using-npm-packages-in-codebuild.html
AWS07CodeBuild: create build project through consolehttps://docs.aws.amazon.com/codebuild/latest/userguide/create-project.html
AWS08CodeBuild: buildspec syntax and artifact base-directoryhttps://docs.aws.amazon.com/codebuild/latest/userguide/build-spec-ref.html
AWS09CodeBuild: currently available runtimes and imageshttps://docs.aws.amazon.com/codebuild/latest/userguide/available-runtimes.html
AWS10Managed EC2 CodeDeploy role scope (AWS managed policy)https://docs.aws.amazon.com/aws-managed-policy/latest/reference/AmazonEC2RoleforAWSCodeDeploy.html
AWS11Systems Manager: managing EC2 as managed nodeshttps://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-setting-up-nodes.html
AWS12CodeDeploy/CodePipeline tutorial: configure agent using SSM in deployment grouphttps://docs.aws.amazon.com/codepipeline/latest/userguide/tutorials-simple-codecommit.html
AWS13CodeDeploy: install CodeDeploy agent through Systems Manager Distributorhttps://docs.aws.amazon.com/codedeploy/latest/userguide/codedeploy-agent-operations-install-ssm.html
AWS14CodeDeploy: create EC2/on-prem deployment with S3 revisionhttps://docs.aws.amazon.com/codedeploy/latest/userguide/deployments-create-console.html
AWS15CodeBuild: change project source and artifacts in the consolehttps://docs.aws.amazon.com/codebuild/latest/userguide/change-project.html
AWS16CodePipeline: CodeDeploy deploy action and artifact requirementshttps://docs.aws.amazon.com/codepipeline/latest/userguide/action-reference-CodeDeploy.html
AWS17GitHub sample: AWS CodeDeploy SampleApp_Linux (architecture and origin)https://github.com/aws-samples/aws-codedeploy-samples/tree/master/applications/SampleApp_Linux
AWS18lodash package source and current npm package informationhttps://www.npmjs.com/package/lodash

Source integrity reminder: This guide is an original training adaptation, not a claim that the GitHub sample was written for CodeArtifact or AL2023. For exact upstream source and license, review the AWS GitHub repository. The downloadable training ZIP contains the files participants should transfer through the CodeCommit browser editor. No AWS or GitHub credentials are bundled.

Related Posts

AWS CodeCommit – Complete Step-by-Step Tutorial

Beginner to Advanced | macOS, Linux, Git, SSH, IAM, CodeBuild This master tutorial covers the complete AWS CodeCommit workflow, from creating your first repository to managing source…

Read More

Oracle Cloud Always Free VPS — Complete Step-by-Step Tutorial

Beginner to Advanced | Updated: November 2, 2026 | Verified against official Oracle Cloud Infrastructure documentation This guide walks you through logging in to Oracle Cloud, configuring…

Read More

Microsoft Sentinel Intermediate: One Complete End-to-End Hands-On Lab – Part – 3

Module 2: Intermediate | Day 3 only | Complete instructor-and-learner manual Edition: 1 November 2026Course: Microsoft Sentinel Technical Training — 5-day progressive curriculumThis document: Day 3 only; prerequisite: successful completion of Foundations…

Read More

Microsoft Sentinel Advance: One Complete End-to-End Hands-On Lab – Part – 4

Module 3: Advanced | Day 4 only | Detection Engineering, Threat Hunting and SOAR Curriculum version: 1 November 2026Course: Five-day progressive Microsoft Sentinel technical trainingThis manual: Day 4 only — syllabus competencies A01–A14Prerequisite: Demonstrated…

Read More

Microsoft Sentinel Advance: One Complete End-to-End Hands-On Lab – Part – 5

Module 3: Advanced | Day 5 only | Enterprise Architecture, Data Lake, DevSecOps and SOC Governance Edition: 1 November 2026Training path: Day 5 of the five-day progressive Microsoft Sentinel programThis manual: Day…

Read More

Microsoft Sentinel Foundations: One Complete End-to-End Hands-On Lab – Part – 1

Student workbook + instructor validation and answer key | Days 1-2 | 2026-11-01 edition One lab, one continuous story: Build a Microsoft Sentinel environment, connect Azure Activity logs,…

Read More