官术网_书友最值得收藏!

How to do it...

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
主站蜘蛛池模板: 呼伦贝尔市| 盘锦市| 郁南县| 扶沟县| 尚志市| 博客| 克拉玛依市| 镇巴县| 东源县| 松溪县| 怀柔区| 皋兰县| 垫江县| 贵阳市| 北流市| 阿鲁科尔沁旗| 鄂托克旗| 唐海县| 措美县| 夏津县| 湾仔区| 塔河县| 巴东县| 洛南县| 沭阳县| 张家界市| 原平市| 浮梁县| 湖州市| 镶黄旗| 如皋市| 兰州市| 通河县| 沁水县| 庆城县| 雷山县| 汶川县| 竹溪县| 仪征市| 荃湾区| 信宜市|