Skip to content

Instantly share code, notes, and snippets.

@nleiva
Last active June 30, 2021 21:07
Show Gist options
  • Save nleiva/cd17336b7f2503565ff879bd645e2e59 to your computer and use it in GitHub Desktop.
Save nleiva/cd17336b7f2503565ff879bd645e2e59 to your computer and use it in GitHub Desktop.
- name: Create EC2 Security Group
amazon.aws.ec2_group:
name: "{{ ec2_resource_prefix }}-SG"
description: Security Group for Testing VM
region: "{{ ec2_region }}"
vpc_id: "{{ create_vpc.vpc.id }}"
tags:
Environment: "{{ ec2_environment }}"
rules:
- proto: tcp
to_port: 22
from_port: 22
cidr_ip: 0.0.0.0/0
rules_egress:
- proto: all
cidr_ip: 0.0.0.0/0
register: create_sg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment