I have an AWS REST API hosted in AWS Account A, which is accessible from AWS Account B. I need to block access only for a specific EC2 instance in Account B, while ensuring that the API remains accessible from other sources.
What I’ve Tried So Far:
AWS WAF: Applied rules but couldn't effectively block the requests.ALB Rule (Timeout Response): Did not work as expected.Security Group Changes: Had no impact on restricting API access for just this server.NACLs: Blocks traffic for all instances but I need to target only one EC2.
Key Constraints which are making me stuck are:✅ The API and server configuration in Account B cannot be changed.✅ The API should remain accessible for other servers.✅ Security groups in Account B cannot be updated.
Any suggestion would be helpful.