SkillSprout
Chapter 1 · Lesson 5
Intermediate
6 min read

Developer Tooling: CLI, SDKs, CloudShell, CodeGuru, Proton and Application Composer

Overview

Pipelines are only as good as the tools that talk to AWS. The AWS CLI and SDKs are how scripts, build jobs and Lambda functions call AWS APIs; CloudShell gives an authenticated browser shell; CodeGuru reviews code and profiles performance; AWS Proton lets a platform team publish standard infrastructure and pipeline templates for developers.

Think of a workshop. The CLI and SDKs are the hand tools every craftsperson owns, CloudShell is a bench that is already set up when you walk in, CodeGuru is the experienced colleague who reviews your work, and Proton is the shared jig library that guarantees every team builds the same shape.

DOP-C02 lists these tools in scope, so expect questions on credential resolution, retries and pagination in scripts, safe ways to give developers self-service environments and how to review code automatically.

Key Concepts

  • The credential provider chain resolves credentials in order: explicit parameters, environment variables, shared config/credentials profile, web identity or SSO, container (ECS task role) credentials and finally the EC2 instance profile.
  • Use named profiles and aws configure sso for humans; assume roles through profiles with role_arn and source_profile for cross-account access.
  • SDKs implement retries with exponential backoff and jitter, pagination helpers and waiters; the CLI offers --query (JMESPath), --output, --no-paginate and aws <service> wait commands.
  • AWS CloudShell is a browser-based shell with preinstalled CLI and tools, using the console identity, 1 GB persistent home storage per Region and no inbound network access.
  • Amazon CodeGuru Reviewer analyses pull requests for defects and security issues; CodeGuru Profiler finds expensive code paths in running applications (CodeGuru Security covers vulnerability scanning).
  • AWS CodeStar project creation is discontinued; use CodeCatalyst, CodePipeline and CodeConnections instead, but the service still appears in exam lists.
  • AWS Proton is a template-based service where platform teams publish environment and service templates (CloudFormation or Terraform) and developers deploy them with managed pipelines and versioned updates.
  • The Serverless Application Repository, CloudFormation modules, Service Catalog and Proton all publish reusable building blocks; they differ in audience and update model.

Detailed Notes

CLI and SDK practices for automation

ConcernRecommended practice
Credentials in CIUse an IAM role (OIDC, CodeBuild service role) and never embed keys
Cross-accountNamed profile with role_arn, or aws sts assume-role in a script
Large result setsRely on automatic pagination or loop with NextToken; filter server side with --filters and client side with --query
ThrottlingSDK retries use exponential backoff and jitter; set retry_mode=adaptive or standard and implement idempotency tokens
Waiting for stateUse waiters, for example aws cloudformation wait stack-create-complete
RegionSet explicitly (--region or AWS_REGION); some services (CloudFront, WAF scope, ACM for CloudFront) are global or us-east-1
Output--output json for scripts, --query to select fields
bash
aws configure sso --profile prod-admin
aws ec2 describe-instances --profile prod-admin \
  --filters Name=tag:env,Values=prod Name=instance-state-name,Values=running \
  --query "Reservations[].Instances[].[InstanceId,PrivateIpAddress]" --output text
aws cloudformation deploy --stack-name web --template-file template.yml \
  --capabilities CAPABILITY_IAM --no-fail-on-empty-changeset

An idempotent SDK call in a Lambda automation:

python
import boto3
from botocore.config import Config

ec2 = boto3.client("ec2", config=Config(retries={"max_attempts": 10, "mode": "adaptive"}))
paginator = ec2.get_paginator("describe_volumes")
for page in paginator.paginate(Filters=[{"Name": "status", "Values": ["available"]}]):
    for v in page["Volumes"]:
        print(v["VolumeId"])

CloudShell versus a bastion or local CLI

AspectCloudShellLocal CLIEC2 bastion
SetupNone, uses console credentialsInstall and configureInstance, patching, SSH
NetworkOutbound only; can attach to a VPC environmentYour networkVPC network
Persistence1 GB home directory per RegionLocal diskInstance storage
AuditCloudTrail with the console identityCloudTrailCloudTrail + host logs

Code quality services

  • CodeGuru Reviewer associates with a repository (CodeCommit, GitHub, Bitbucket, S3) and comments on pull requests with recommendations, including secrets detection and AWS API best practices.
  • CodeGuru Profiler installs an agent in the application and produces flame graphs and cost estimates; use it to reduce compute spend.
  • Combine with third-party SAST, dependency scanning (CodeArtifact, Inspector) and the pipeline test stage so findings fail the build.

Platform engineering: Proton, Service Catalog and friends

ToolBest forUpdate model
AWS ProtonPlatform team publishes environment and service templates with pipelinesTemplate versions; Proton can update all instances
Service CatalogGoverned self-service of approved products with launch constraintsProduct versions; users update provisioned products
CloudFormation modules / registryReusable resource patterns inside templatesModule versions in registry
Serverless Application RepositorySharing SAM applicationsSemantic versions, consumers redeploy
CDK constructsCode-level librariesPackage versions via CodeArtifact

Proton separates environment templates (shared VPC, cluster) from service templates (service plus pipeline). Developers fill in a spec; Proton renders and deploys it through a service role (or CodeBuild provisioning for Terraform). Check the service lifecycle before recommending it: for new designs many teams now favour CDK constructs, Service Catalog or Backstage-style portals.

Troubleshooting automation scripts

  1. Unable to locate credentials: the chain found nothing; check the profile, environment variables or instance role.
  2. ExpiredToken: temporary credentials expired; refresh the SSO session or lengthen the role session.
  3. ThrottlingException: add backoff, batch calls or request quota increases.
  4. AccessDenied after assume-role: check the trust policy, session policy, SCPs and any permissions boundary.

Real World Example

Scenario: a platform team wants consistent services without becoming a ticket queue. They publish standard environment and web-service templates in Proton, each including a CodePipeline, CodeBuild project and alarms. Developers choose a template version and supply parameters; the platform team upgrades all services by publishing a new minor version.

Developers use CloudShell for quick investigations, SSO profiles locally, and CodeGuru Reviewer on every pull request. Automation scripts use SDK adaptive retries and paginators so nightly inventory jobs no longer fail on throttling.

Architecture Diagram

Developer tooling around the pipeline
Architecture
AWS Cloud
DevelopersCLI / CloudShell
Git + CodeGuruPR review
Proton templateEnv + service
Provisioned stackPipeline included

Humans and machines use temporary credentials; templates and reviews standardise delivery.

  1. 1Developers authenticate with SSO and use the CLI, SDKs or CloudShell.
  2. 2Pull requests are reviewed automatically by CodeGuru and tests.
  3. 3A platform-owned template is selected with parameters.
  4. 4Proton or Service Catalog provisions the infrastructure and pipeline.
  5. 5Template updates roll out consistently to every consumer.

Best Practices

  • ✓Use roles and SSO in every script and pipeline; never commit access keys.
  • ✓Rely on SDK retries, paginators and waiters instead of custom loops and sleeps.
  • ✓Publish versioned, tested templates for common patterns and let teams self-serve.
  • ✓Automate code review and dependency scanning in pull requests.
  • ✓Prefer CloudShell or Session Manager over shared bastion hosts for ad hoc work.

Common Interview Questions

Exam Tips

DOP-C02 focus

  • "Browser shell with console credentials and no setup" = CloudShell.
  • "Automated code review on pull requests" = CodeGuru Reviewer.
  • "Platform team publishes standard templates for developers" = Proton or Service Catalog.
  • "Credentials error in an EC2-hosted script" = check the instance profile and credential chain order.

Chapter quiz

SDLC Automation · 10 questions

  1. 1.A company runs CodePipeline in a tooling account and must deploy the same build artifact to dev, test and production accounts, with production accessible only from the pipeline. Which approach is most appropriate?

  2. 2.A build pulls internal npm packages from CodeArtifact. A public package with the same name as an internal package was published to npm and builds started installing it. What is the best prevention?

  3. 3.A security team wants every container image pushed to ECR to be scanned for known vulnerabilities, with findings visible in Security Hub and tags that cannot be overwritten. Which configuration meets this?

  4. 4.A developer script that lists thousands of EC2 snapshots intermittently fails with ThrottlingException when run from many pipelines at once. Which change gives the most robust fix?

  5. 5.Platform engineers need to give 50 application teams a standard way to create an ECS service with a pipeline, alarms and tagging. Teams must be able to self-serve but not alter the standard architecture, and platform updates must reach existing services. Which service fits best?

  6. 6.A company keeps code in GitHub and wants CodePipeline to start only when files under the services/billing directory change on the main branch, without storing personal access tokens. What should the DevOps engineer do?

  7. 7.A CodeBuild project must build and push a Docker image, but the build fails with 'Cannot connect to the Docker daemon'. What is the MOST likely fix?

  8. 8.A security team wants all builds to resolve npm packages from a controlled location that caches public packages and blocks a public package from replacing an internal package of the same name. Which solution meets this?

  9. 9.A pipeline in a tooling account deploys CloudFormation stacks to a production account. The deploy action fails with an error decrypting the artifact. The artifact bucket uses the default aws/s3 key. What should be done?

  10. 10.A team wants integration tests to run after each staging deployment and to block the production stage on failure, with the tests needing access to a private RDS instance. Which design is BEST?

0 of 10 answered

Finished this lesson?

0 of 44 lessons done · 0% of the course