From f64e80118383e0c3885b3bd84c4c1379ce7e4e5d Mon Sep 17 00:00:00 2001 From: Rob White Date: Wed, 30 Nov 2016 11:58:58 +1100 Subject: Fail if specifying an ENI as device but in_vpc is not true --- cloud/amazon/ec2_eip.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cloud/amazon/ec2_eip.py b/cloud/amazon/ec2_eip.py index 4fb7c2ae..83473044 100644 --- a/cloud/amazon/ec2_eip.py +++ b/cloud/amazon/ec2_eip.py @@ -376,6 +376,8 @@ def main(): if device_id and device_id.startswith('i-'): is_instance = True elif device_id: + if device_id.startswith('eni-') and not in_vpc: + module.fail_json(msg="If you are specifying an ENI, in_vpc must be true") is_instance = False try: -- cgit v1.2.1