Copyright (c) 2026 MindMesh Academy. All rights reserved. This content is proprietary and may not be reproduced or distributed without permission.

2.1.1.8. Service-to-Service Networking and Container Image Management (VPC Lattice, ECS Service Connect, Amazon ECR)

2.1.1.8. Service-to-Service Networking and Container Image Management (VPC Lattice, ECS Service Connect, Amazon ECR)

💡 First Principle: Microservices need discovery, routing, authorization and telemetry on every call; a managed application-networking layer provides these consistently instead of every team rebuilding them in code or in network plumbing. Container images are the software supply chain, so what you scan and what you keep decides what can be deployed.

Service-to-service options:
"Amazon VPC Lattice""Amazon ECS Service Connect""AWS App Mesh"
ScopeEC2, IP targets, Lambda, ALB, ECS tasks and Kubernetes pods, across VPCs and accountsECS services in the same AWS Cloud Map namespace (one Region; the namespace can be shared through AWS RAM)Discontinued on September 30, 2026
ProxyNone to manage; VPC Lattice is the data planeECS injects and manages an Envoy-based proxy in each taskEnvoy sidecars you configure
AuthorizationIAM auth policies on the service network and each serviceNetwork controls; optional TLS with AWS Private CA
TelemetryAccess logs to CloudWatch Logs, S3 or Firehose, per-request metricsProxy metrics in the ECS and CloudWatch consoles, access logs
  • VPC Lattice building blocks: A service (listeners, rules, target groups) is associated with a service network, and client VPCs are associated with the same service network. Traffic flows over the AWS network with no VPC peering or Transit Gateway routes, and overlapping CIDRs are supported. Service networks and services are shared across accounts with AWS RAM. With auth type AWS_IAM, callers must sign requests with SigV4, and both the caller's identity policy and the auth policies must allow vpc-lattice-svcs:Invoke; conditions such as aws:PrincipalOrgID, vpc-lattice-svcs:SourceVpc, request path and method give per-route control. Security groups on the VPC association add a network layer. TCP resources such as an RDS database are exposed through a resource gateway and resource configuration (auth policies do not apply to those). On EKS, the AWS Gateway API Controller maps Kubernetes resources to Lattice.
  • Service Connect in practice: Name a port in the task definition and give the service a client alias, and tasks reach each other with short names such as http://inventory:8080. The proxy load-balances round-robin, uses outlier detection and retries, and needs no extra charge beyond the task resources it uses. It interconnects only ECS services configured in the namespace; other clients need another method. AWS points App Mesh users on ECS to Service Connect.
  • Choosing: ECS-only estate in one namespace: Service Connect. Mixed compute (EC2, Lambda, EKS, ECS), many accounts, overlapping address space or per-call IAM authorization: VPC Lattice. PrivateLink exposes one service per endpoint service and suits a provider/consumer (SaaS-style) relationship rather than a mesh of hundreds of services.
Managing images in "Amazon ECR":
  • Basic scanning uses AWS native technology and the CVE database to find operating system package vulnerabilities, on push or manually. Enhanced scanning integrates Amazon Inspector, covers OS and programming-language packages (Java, Python, Node.js libraries), and offers continuous scanning: images are re-evaluated when new CVEs are published, and findings are emitted to EventBridge (and appear in Inspector and Security Hub). Scanning is configured at the registry with repository filters; switching between basic and enhanced discards the scans set up under the other type.
  • Lifecycle policies clean up automatically within 24 hours of an image meeting the criteria. Each rule selects images by tagStatus (tagged with tagPatternList/tagPrefixList, untagged, or any) and a count type: imageCountMoreThan, sinceImagePushed or sinceImagePulled. The action is expire or transition to archive storage. All rules are evaluated, then applied by rulePriority (lowest number first); an image is acted on by at most one rule, and an image matched by a higher-priority rule cannot be taken by a lower one. A rule with tagStatus any must have the highest priority number (evaluated last). Use the preview before applying; actions are logged in CloudTrail.
  • Tag immutability stops a tag such as v1.4.2 from being overwritten with a different image, so the digest that was scanned and approved is the one that deploys.

⚠️ Exam Trap: Expecting basic scan-on-push to protect running images. It checks OS packages once, at push time; a CVE published next week in an application library is only found by enhanced scanning with continuous mode.

See how it connects
Alvin Varughese
Written byAlvin Varughese
Founder•20 professional certifications