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

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
主站蜘蛛池模板: 平定县| 青阳县| 南江县| 屏边| 马公市| 保亭| 紫阳县| 乌鲁木齐县| 甘肃省| 翁源县| 获嘉县| 长沙市| 高邑县| 贡觉县| 江西省| 邢台县| 东山县| 广汉市| 康平县| 绵阳市| 辽阳县| 安溪县| 来凤县| 同心县| 江安县| 临洮县| 嘉定区| 石台县| 新密市| 隆林| 射阳县| 琼结县| 航空| 拜泉县| 建阳市| 平阴县| 闽侯县| 白沙| 陇南市| 抚远县| 玉门市|