February 2018
Intermediate to advanced
200 pages
5h 51m
English
We can allocate and associate an Elastic IP address with an EC2 instance using an ec2_ip module. This will require the instance ID of the EC2 instance we want to associate this Elastic IP address with and the region of that instance as input parameters.
- name: Allocate Elastic IP and associate it with an instance ec2_eip: device_id: "{{ item }}" aws_access_key: "{{ access_key }}" aws_secret_key: "{{ secret_key }}" region: "{{ aws_region }}" with_items: - "{{ ec2_public_instance.instance_ids }}" register: elastic_ip
Read now
Unlock full access