Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add delete_on_termination to all EC2 root volumes #44818

Merged
merged 1 commit into from
Aug 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
image_id: "{{ ec2_ami_image[aws_region] }}"
vpc_subnet_id: "{{ testing_subnet_b.subnet.id }}"
volumes:
- device_name: /dev/sda1
ebs:
delete_on_termination: true
- device_name: /dev/sdb
ebs:
volume_size: 20
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
cpu_options:
core_count: 1
threads_per_core: 1
volumes:
- device_name: /dev/sda1
ebs:
delete_on_termination: true
<<: *aws_connection_info
register: instance_creation

Expand All @@ -38,6 +42,10 @@
TestId: "{{ resource_prefix }}"
vpc_subnet_id: "{{ testing_subnet_a.subnet.id }}"
instance_type: c4.large
volumes:
- device_name: /dev/sda1
ebs:
delete_on_termination: true
cpu_options:
core_count: 1
threads_per_core: 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
TestId: "{{ resource_prefix }}"
security_groups: "{{ sg.group_id }}"
instance_type: t2.micro
volumes:
- device_name: /dev/sda1
ebs:
delete_on_termination: true
<<: *aws_connection_info
register: in_default_vpc
- name: Terminate instance
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
availability_zone: '{{ aws_region }}b'
tags:
TestId: "{{ resource_prefix }}"
volumes:
- device_name: /dev/sda1
ebs:
delete_on_termination: true
instance_type: t2.micro
<<: *aws_connection_info
register: in_test_vpc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,15 @@

- name: Make instance with an instance_role
ec2_instance:
name: "{{ resource_prefix }}-test-default-vpc"
name: "{{ resource_prefix }}-test-instance-role"
image_id: "{{ ec2_ami_image[aws_region] }}"
security_groups: "{{ sg.group_id }}"
instance_type: t2.micro
instance_role: "{{ resource_prefix }}-test-policy"
volumes:
- device_name: /dev/sda1
ebs:
delete_on_termination: true
<<: *aws_connection_info
register: instance_with_role

Expand All @@ -46,7 +50,7 @@

- name: Update instance with new instance_role
ec2_instance:
name: "{{ resource_prefix }}-test-default-vpc"
name: "{{ resource_prefix }}-test-instance-role"
image_id: "{{ ec2_ami_image[aws_region] }}"
security_groups: "{{ sg.group_id }}"
instance_type: t2.micro
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
source_dest_check: false
vpc_subnet_id: "{{ testing_subnet_b.subnet.id }}"
instance_type: t2.micro
volumes:
- device_name: /dev/sda1
ebs:
delete_on_termination: true
<<: *aws_connection_info
register: in_test_vpc

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
vpc_subnet_id: "{{ testing_subnet_b.subnet.id }}"
termination_protection: true
instance_type: t2.micro
volumes:
- device_name: /dev/sda1
ebs:
delete_on_termination: true
<<: *aws_connection_info
register: in_test_vpc
- name: Try to terminate the instance
Expand Down