You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible/cloud/amazon
Ryan Brown f1c2739163 Handle termination_protection parameter when restarting instances (#5076)
* Restart EC2 instances with multiple network interfaces

A previous bug, #3234, caused instances with multiple ENI's to fail when being
started or stopped because sourceDestCheck is a per-interface attribute, but we
use the boto global access to it (which only works when there's a single ENI).

This patch handles a variant of that bug that only surfaced when restarting an
instance, and catches the same type of exception.

* Default termination_protection to None instead of False

AWS defaults the value of termination_protection to False, so we don't
need to explicitly send `False` when the user hasn't specified a
termination protection level. Before this patch, the below pair of tasks
would:

1. Create an instance (enabling termination_protection)
2. Restart that instance (disabling termination_protection)

Now, the default None value would prevent the restart task from
disabling termination_protection.

```
- name: make an EC2 instance
  ec2:
    vpc_subnet_id: {{ subnet  }}
    instance_type: t2.micro
    termination_protection: yes
    exact_count: 1
    count_tag:
       Name: TestInstance
    instance_tags:
       Name: TestInstance
    group_id: {{ group }}
    image: ami-7172b611
    wait: yes
- name: restart a protected EC2 instance
  ec2:
    vpc_subnet_id: {{ subnet  }}
    state: restarted
    instance_tags:
       Name: TestInstance
    group_id: {{ group }}
    image: ami-7172b611
    wait: yes
```
9 years ago
..
__init__.py added __init__.py to new cloud subcategories so builds work again 11 years ago
_ec2_ami_search.py Fix for #16518 - added missing regions 10 years ago
cloudformation.py cloudformation stack events itertools.imap bugfix (#4868) 9 years ago
ec2.py Handle termination_protection parameter when restarting instances (#5076) 9 years ago
ec2_ami.py added missing colons to documentation (#3913) 10 years ago
ec2_ami_find.py Merge pull request #3077 from jjshoe/devel 10 years ago
ec2_asg.py Typo Fix 9 years ago
ec2_eip.py Fixes #3144 (#4305) 9 years ago
ec2_elb.py Fixing error exception handling for python3. Does not need to be compa… (#3840) 10 years ago
ec2_elb_lb.py Merge pull request #4275 from shaunbrady/ec2_elb_lb_respect_vpc 10 years ago
ec2_facts.py Fix for #16518 - added missing regions 10 years ago
ec2_group.py Fix for validate rule. Ensure rule is a dict. (#4640) 9 years ago
ec2_key.py Fixing error exception handling for python3. Does not need to be compa… (#3840) 10 years ago
ec2_lc.py Improve documentation on security_groups-option 10 years ago
ec2_metric_alarm.py Fixing error exception handling for python3. Does not need to be compa… (#3840) 10 years ago
ec2_scaling_policy.py Fixing error exception handling for python3. Does not need to be compa… (#3840) 10 years ago
ec2_snapshot.py Fixing error exception handling for python3. Does not need to be compa… (#3840) 10 years ago
ec2_tag.py Add more example on how to use module ec2_tags to list tags on an ins… (#3530) 10 years ago
ec2_vol.py Fixing error exception handling for python3. Does not need to be compa… (#3840) 10 years ago
ec2_vpc.py Getting rid of a None type error when no resource tags are defined. (#4638) 9 years ago
ec2_vpc_net.py Check mode fixes for ec2_vpc_net module (#2179) 10 years ago
elasticache.py Fixing error exception handling for python3. Does not need to be compa… (#3840) 10 years ago
elasticache_subnet_group.py Fixing error exception handling for python3. Does not need to be compa… (#3840) 10 years ago
iam.py Merge pull request #3863 from ryansb/iam-pass-module 10 years ago
iam_cert.py iam_cert: remove choice list for dup_ok type bool (#4940) 9 years ago
iam_policy.py Accept JSON type as the content of policy_json parameter on `iam_policy` module 9 years ago
rds.py Add default port for aurora (#4102) 10 years ago
rds_param_group.py Add support for PostgreSQL 9.5 in rds_param_group (fix for #3846) 10 years ago
rds_subnet_group.py Fixing error exception handling for python3. Does not need to be compa… (#3840) 10 years ago
route53.py Add an example to delete Route53 alias record set (#3834) 10 years ago
s3.py Add s3_url requirement in doc when rgw support is enabled in s3.py 10 years ago