Skip to main content
PreparationZone Logo
PrepZone

S3, SQS, Secrets on AWS

Integrating AWS services into Boot apps for cloud-native deployments.

Pass checkpoint below

Why this matters

  • Storing book cover images on the application server's disk does not scale across pods — S3 gives durable, CDN-fronted object storage with per-request access control.
  • SQS decouples order placement from downstream fulfilment: the API responds fast while a worker processes the queue at its own pace.
  • Secrets Manager rotates database passwords automatically; Spring Cloud AWS injects them at runtime so credentials never appear in application.yml or Docker images.

S3 for assets

L1 · Fresher

Store book cover images in S3; serve via CloudFront with signed URLs when needed.

SQS integration

L2 · Intermediate

Decouple order fulfillment with queues — Spring Cloud AWS or AWS SDK v2 clients from Boot.

Secrets Manager

L3 · Advanced

Load DB credentials at runtime with IAM roles — no secrets in application.yml in images.

IAM least privilege

L4 · Expert

Task roles grant only s3:GetObject on the BookStore bucket prefix — audit policies per environment.

StreamHub production architecture (AWS)

HTTPSstaticmissAPICLIENT
Mobile / WebStreamHub cli…
NETWORK
Route 53GeoDNS routing
NETWORK
CloudFrontCDN + WAF edge
NETWORK
AWS ALBTLS terminati…
NETWORK
API GatewayJWT · rate li…
STORAGE
Amazon S3media origin
COMPUTE
Amazon EKSAPI · auth · …
DATABASE
ElastiCachesessions · ho…
DATABASE
RDS Postgresprimary + rep…
INTEGRATION
Amazon MSKdomain events
ANALYTICS
OpenSearchstream discov…
OPS
CloudWatchmetrics · X-R…
End-to-end path from user to data — reference this when placing any new service.

AWS services mapped to BookStore needs

  • S3 — book cover images, publisher catalog CSV uploads, generated sales report PDFs.
  • SQS — order fulfilment queue, inventory sync messages, dead-letter queue for failed processing.
  • Secrets Manager — database URLs, API keys, JWT signing secrets.
  • Parameter Store — non-secret configuration like feature flags and service endpoints.
  • Spring Cloud AWS — auto-configuration for S3, SQS, and Secrets Manager in Boot 3.x.

Dependencies

Java
<dependency>
    <groupId>io.awspring.cloud</groupId>
    <artifactId>spring-cloud-aws-starter-s3</artifactId>
</dependency>
<dependency>
    <groupId>io.awspring.cloud</groupId>
    <artifactId>spring-cloud-aws-starter-sqs</artifactId>
</dependency>
<dependency>
    <groupId>io.awspring.cloud</groupId>
    <artifactId>spring-cloud-aws-starter-secrets-manager</artifactId>
</dependency>

The rest of this guide is part of Pro

Free covers every fresher guide in full. Pro unlocks Senior, Staff and Architect guides across every track.

Still to come · 3 sections

  • S3 for book cover images
  • SQS for order fulfilment
  • Secrets Manager for database credentials

Test yourself

Answer these before moving on — recall is what makes it stick.