Skip to content

Instantly share code, notes, and snippets.

@li0nel
Created December 10, 2017 12:19
Show Gist options
  • Save li0nel/b9748c2495437c846035452b5183ccd0 to your computer and use it in GitHub Desktop.
Save li0nel/b9748c2495437c846035452b5183ccd0 to your computer and use it in GitHub Desktop.
RDS security group
# This security group defines who/where is allowed to access the RDS instance.
# Only instances associated with our ECS security group can reach to the database endpoint.
DBSecurityGroup:
Type: AWS::EC2::SecurityGroup
Properties:
GroupDescription: Open database for access
VpcId: !Ref VPC
SecurityGroupIngress:
- IpProtocol: tcp
FromPort: '3306'
ToPort: '3306'
SourceSecurityGroupId: !Ref ECSSecurityGroup
Tags:
- Key: Name
Value: !Sub ${EnvironmentName}-DB-Host
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment