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

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
主站蜘蛛池模板: 华蓥市| 承德市| 上林县| 连州市| 章丘市| 玛沁县| 迁安市| 吉安市| 会同县| 霍城县| 西盟| 历史| 龙泉市| 海丰县| 临武县| 玛沁县| 得荣县| 红原县| 蒲江县| 信阳市| 北安市| 永昌县| 老河口市| 祁连县| 怀柔区| 安岳县| 古丈县| 沙河市| 惠东县| 包头市| 华蓥市| 宁陕县| 陈巴尔虎旗| 平乡县| 淮北市| 独山县| 铁力市| 醴陵市| 务川| 信丰县| 桃园市|