AWS Certified Solutions Architect – Professional
VPC Lattice service networks and auth policies for SAP-C03
The Amazon VPC Lattice guide describes a service network as a logical boundary for a group of services. Clients in a connected VPC call those services by DNS name, and overlapping CIDR blocks are supported. Auth policies are IAM policy documents attached to a service network or a service, and they need SigV4-signed requests to identify a caller.
Services, service networks and VPC connections
A Lattice service has listeners, rules and target groups. Targets can be EC2 instances, IP addresses, Lambda functions, Application Load Balancers, Amazon ECS tasks and Kubernetes Pods. The service is associated with one or more service networks.
A client must be in a VPC that is connected to the service network, either through a VPC association or through a VPC endpoint of type service network. A VPC can have only one service network association. To reach more than one service network, use endpoints. The endpoint also gives access from on premises over Direct Connect or VPN.
Clients call a service by its DNS name, and DNS directs the traffic to the VPC Lattice endpoint. Lattice supports overlapping CIDR blocks, so it fits accounts whose VPCs all use the same range and cannot be peered. Without a VPC connection and a service association, a client cannot reach a service. A security group can be attached to the VPC association as a second layer.
Sharing across accounts with AWS RAM
Services, service networks and resource configurations are shared through AWS Resource Access Manager (AWS RAM). You can share only an entity that your account owns. An entity that was shared with you cannot be shared on by you. In a central-network design, only the account that owns the service network can add a new consumer.
Consumers can be accounts inside or outside the organization, an OU, or the whole organization. They cannot be individual IAM users or roles. Inside an organization with sharing enabled, consumers get access automatically. Any other consumer receives an invitation and gets access after accepting it.
A consumer of a shared service network can associate its own VPCs and its own services with it. The service network owner can remove any of those associations. If sharing stops, existing associations persist and new ones are not allowed.
Auth types and how policies are evaluated
A service network and a service each have an auth type, NONE or AWS_IAM, and each can have one auth policy. With AWS_IAM and no auth policy, all traffic gets an access denied error. Deleting an auth policy fails unless the auth type is changed to NONE first.
With AWS_IAM, requests are implicitly denied by default. Lattice checks that the caller's identity-based policy allows the operation, then the service network's auth policy, then the service's auth policy. A level with auth type NONE is passed over. Both the identity-based policy and the auth policies need explicit allow statements.
RAM sharing works at the account level, so limiting access to one role is the auth policy's job. To restrict one service and leave the others open, set AWS_IAM and an auth policy on that service and leave the service network at NONE. The caller must then sign its requests with Signature Version 4. Callers that do not sign are anonymous principals. They get through only where a policy allows unauthenticated requests. AWS evaluates the policies when the service receives the request, so the check is not written into the service's code.
A service network's auth policy does not apply to resource configurations in the network.
Where the exam catches people
- Believing AWS RAM can share a service with a single IAM role: sharing targets accounts, OUs or an organization. Use an auth policy to narrow access to a role.
- Believing an account that received a shared service network can share it with another account: only the owner can share an entity.
- Believing a role can be allowed in an auth policy while its client sends unsigned requests: unsigned callers are anonymous, so the client must sign with SigV4.
- Believing one restricted service requires
AWS_IAMon the whole service network: auth type and auth policy can be set on the single service. - Believing an account outside the organization gets a shared service network automatically: it receives an invitation and must accept it.