How can you prevent developers from attaching an Elastic IP to production EC2 instances and ensure the security team is alerted if any production instance has an Elastic IP at any time?
Choose an answer
Tap an option to check your answer.
Correct answer: Attach an IAM policy to the developers' IAM group that denies associate-address permissions. Create a custom AWS Config rule that checks whether any instance tagged as production has an Elastic IP associated and alert the security team..
Why this is the answer
The correct option provides a robust, multi-layered solution. First, attaching an IAM policy that explicitly denies ec2:AssociateAddress permissions to developer IAM groups is a preventative measure, stopping developers from attaching Elastic IPs in the first place. Second, creating a custom AWS Config rule that specifically checks for Elastic IPs on instances tagged as "production" provides continuous auditing and detection. If an Elastic IP is found (perhaps due to a misconfiguration or an action by an authorized user), AWS Config will flag it as non-compliant and can trigger alerts to the security team, ensuring immediate notification. The other options are less effective: Querying CloudTrail logs with Athena is reactive and might have a delay in detection, and disassociating an Elastic IP via Lambda after it's been attached is a remediation step, not a prevention. Scheduling a Lambda function to periodically check is also reactive and might have a detection delay, similar to the Athena approach, and doesn't prevent the initial attachment. Verifying EC2 IAM roles deny associate-address permissions is incorrect because EC2 instance roles define permissions for the instance itself, not for users interacting with the instance. Users' IAM policies control their ability to attach Elastic IPs.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed