Skip to content

Commit 9a0f12c

Browse files
committed
Revert "AWS support for existing EIP (revised) (trailofbits#1292)"
This reverts commit e3a6170.
1 parent 59a5f7f commit 9a0f12c

File tree

5 files changed

+3
-45
lines changed

5 files changed

+3
-45
lines changed

config.cfg

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,9 @@ cloud_providers:
131131
size: s-1vcpu-1gb
132132
image: "ubuntu-18-04-x64"
133133
ec2:
134-
# Change the encrypted flag to "true" to enable AWS volume encryption, for encryption of data at rest.
135-
# Warning: the Algo script will take approximately 6 minutes longer to complete.
134+
# Change the encrypted flag to "true" to enable AWS volume encryption, for encryption of data at rest.
135+
# Warning: the Algo script will take approximately 6 minutes longer to complete.
136136
encrypted: false
137-
# Set use_existing_eip to "true" if you want to use a pre-allocated Elastic IP
138-
# Additional prompt will be raised to determine which IP to use
139-
use_existing_eip: true
140137
size: t2.micro
141138
image:
142139
name: "ubuntu-bionic-18.04"

roles/cloud-ec2/defaults/main.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@ ec2_vpc_nets:
55
cidr_block: 172.16.0.0/16
66
subnet_cidr: 172.16.254.0/23
77
ec2_venv: "{{ playbook_dir }}/configs/.venvs/aws"
8-
existing_eip: ""

roles/cloud-ec2/files/stack.yaml

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,6 @@ Parameters:
1111
Type: String
1212
WireGuardPort:
1313
Type: String
14-
UseThisElasticIP:
15-
Type: String
16-
Default: ''
17-
Conditions:
18-
AllocateNewEIP: !Equals [!Ref UseThisElasticIP, '']
19-
AssociateExistingEIP: !Not [!Equals [!Ref UseThisElasticIP, '']]
2014
Resources:
2115
VPC:
2216
Type: AWS::EC2::VPC
@@ -181,22 +175,13 @@ Resources:
181175

182176
ElasticIP:
183177
Type: AWS::EC2::EIP
184-
Condition: AllocateNewEIP
185178
Properties:
186179
Domain: vpc
187180
InstanceId: !Ref EC2Instance
188181
DependsOn:
189182
- EC2Instance
190183
- VPCGatewayAttachment
191184

192-
ElasticIPAssociation:
193-
Type: AWS::EC2::EIPAssociation
194-
Condition: AssociateExistingEIP
195-
Properties:
196-
AllocationId: !Ref UseThisElasticIP
197-
InstanceId: !Ref EC2Instance
198-
199-
200185
Outputs:
201186
ElasticIP:
202-
Value: !GetAtt [EC2Instance, PublicIp]
187+
Value: !Ref ElasticIP

roles/cloud-ec2/tasks/cloudformation.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
PublicSSHKeyParameter: "{{ lookup('file', SSH_keys.public) }}"
1313
ImageIdParameter: "{{ ami_image }}"
1414
WireGuardPort: "{{ wireguard_port }}"
15-
UseThisElasticIP: "{{ existing_eip }}"
1615
tags:
1716
Environment: Algo
1817
register: stack

roles/cloud-ec2/tasks/prompts.yml

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -53,25 +53,3 @@
5353
[{{ default_region }}]
5454
register: _algo_region
5555
when: region is undefined
56-
57-
- block:
58-
- name: Get existing available Elastic IPs
59-
ec2_eip_facts:
60-
register: raw_eip_addresses
61-
62-
- set_fact:
63-
available_eip_addresses: "{{ raw_eip_addresses.addresses | selectattr('association_id', 'undefined') | list }}"
64-
65-
- pause:
66-
prompt: >-
67-
What Elastic IP would you like to use?
68-
{% for eip in available_eip_addresses %}
69-
{{ loop.index }}. {{ eip['public_ip'] }}
70-
{% endfor %}
71-
72-
Enter the number of your desired Elastic IP
73-
register: _use_existing_eip
74-
75-
- set_fact:
76-
existing_eip: "{{ available_eip_addresses[_use_existing_eip.user_input | int -1 ]['allocation_id'] }}"
77-
when: cloud_providers.ec2.use_existing_eip

0 commit comments

Comments
 (0)