Skip to content

Instantly share code, notes, and snippets.

@nleiva
Created June 30, 2021 21:13
Show Gist options
  • Save nleiva/fdc9f31b78cce983be258838776ff79f to your computer and use it in GitHub Desktop.
Save nleiva/fdc9f31b78cce983be258838776ff79f to your computer and use it in GitHub Desktop.
- name: Provision EC2 instance
community.aws.ec2_instance:
name: "{{ ec2_name_tag }}"
region: "{{ ec2_region }}"
instance_type: "{{ ec2_instance_type }}"
image_id: "{{ ec2_ami_id }}"
key_name: "{{ ec2_resource_prefix }}-key"
vpc_subnet_id: "{{ create_subnet.subnet.id }}"
network:
assign_public_ip: true
security_group: "{{ ec2_resource_prefix }}-SG"
wait: yes
volumes: "{{ ec2_volume }}"
tags:
Environment: "{{ ec2_environment }}"
register: ec2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment