Certopolis

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_IAM on 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.

Written from these sources

Try 3 questions on this

Pick an answer to see why each option is right or wrong.

  1. A company publishes 15 internal services through one Amazon VPC Lattice service network whose auth type is NONE. Most clients send unsigned requests and must keep working. A new billing service must accept requests only from the orders service's IAM role. The orders tasks share subnets with other workloads, and the orders role already has an identity-based policy that allows vpc-lattice-svcs:Invoke on billing. The billing team will not change billing's code. Which combination of steps should a solutions architect take to meet these requirements? (Select TWO.)

    Right. In the game that’s Renown for your Architecture Design and Implementation Built for the Cloud building.

    Not that one: B,C is right. In the game your Architecture Design and Implementation Built for the Cloud building would lose a little Renown, and this question would come back later.

    Show the full explanation and doc quotes

    That only works if orders proves who it is, so its client must sign requests with SigV4 using the task role credentials. The service network stays at NONE, so the other 14 services keep accepting their unsigned clients, and the orders role's identity-based policy already supplies the other half of the allow.

    Written from docs.aws.amazon.com/vpc-lattice/latest/ug/auth-policies.html

  2. A networking account owns an Amazon VPC Lattice service network and shares it through AWS RAM with every account in the company's organization. A business unit's account, BU-Retail, uses the shared service network and has associated its VPC and its own services with it. BU-Retail has acquired a startup whose AWS account will stay outside the organization for a year. Clients in the startup's VPC must call services in the service network. BU-Retail sponsors the startup and has asked to run the onboarding from its own account. Which combination of steps should a solutions architect take to meet these requirements? (Select TWO.)

    Right. In the game that’s Renown for your Architecture Design and Implementation Built for the Cloud building.

    Not that one: C,E is right. In the game your Architecture Design and Implementation Built for the Cloud building would lose a little Renown, and this question would come back later.

    Show the full explanation and doc quotes

    The networking account therefore adds the startup's account ID to its own resource share, which must allow principals from outside the organization. Because the startup is outside the organization, that share reaches it as an invitation rather than being granted automatically. Once the startup accepts the invitation, it can associate its own VPC with the service network, and clients in that VPC can then reach the services, subject to any auth policies.

    Written from docs.aws.amazon.com/vpc-lattice/latest/ug/sharing.html

  3. A company's platform account runs six internal HTTP APIs: four are AWS Lambda functions and two are Amazon ECS services on AWS Fargate. Thirty product accounts in the company's organization each have one VPC whose applications call these APIs by DNS name. The platform VPC and every product VPC were created from one template and all use the 10.20.0.0/16 CIDR block. None of the VPCs can be renumbered, and the product applications must not be changed beyond the DNS names they call. Which combination of steps should a solutions architect take to meet these requirements? (Select TWO.)

    Right. In the game that’s Renown for your Architecture Design and Implementation Built for the Cloud building.

    Not that one: A,D is right. In the game your Architecture Design and Implementation Built for the Cloud building would lose a little Renown, and this question would come back later.

    Show the full explanation and doc quotes

    VPC Lattice does that. On the provider side, each API becomes a Lattice service whose target group points at its Lambda functions or ECS tasks, and the services join a service network. On the consumer side, the service network is shared through AWS RAM and each product account associates its VPC with it, after which clients in that VPC reach the services by their DNS names. Lattice handles the connectivity inside the AWS network and supports overlapping CIDRs, so no VPC is renumbered.

    Written from docs.aws.amazon.com/vpc-lattice/latest/ug/what-is-vpc-lattice.html

Ask for something