Which solution will meet these requirements?
Set up an API Gateway private integration to restrict access to a predefined set of IP addresses.
Create a resource policy for the API that denies access to any IP address that is not specifically allowed.
Directly deploy the API in a private subnet. Create a network ACL. Set up rules to allow the traffic from specific IP addresses.
Modify the security group that is attached to API Gateway to allow inbound traffic from only the trusted IP addresses.
Explanations:
API Gateway private integration is used to access resources in a VPC privately, but it does not restrict access to specific IP addresses from the internet.
A resource policy can restrict access to the API based on specific IP addresses, effectively limiting access to trusted internal network addresses.
API Gateway does not support deployment in a private subnet. Network ACLs apply to VPCs, not to API Gateway, which is publicly accessible by default.
Security groups cannot be directly attached to API Gateway. Instead, API Gateway access control is managed by resource policies and IAM policies.