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

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
主站蜘蛛池模板: 仁怀市| 互助| 鄂托克旗| 青州市| 蒲江县| 桓仁| 且末县| 浪卡子县| 台湾省| 宣汉县| 平利县| 图木舒克市| 连城县| 睢宁县| 昂仁县| 格尔木市| 农安县| 酉阳| 宁陵县| 建阳市| 喀喇沁旗| 秭归县| 屏东县| 达日县| 青州市| 和平区| 重庆市| 兴宁市| 霍林郭勒市| 五寨县| 九龙城区| 嘉善县| 永寿县| 潮安县| 定西市| 耒阳市| 浦江县| 砚山县| 堆龙德庆县| 阳信县| 武汉市|