Skip to content

How to Create an AWS Security Group in CloudFormation

Below is a simple CloudFormation script block to create a Security Group in AWS.

Resources: SampleAppAppstreamSG: Type: AWS::EC2::SecurityGroup Properties: GroupDescription: Inbound and outbound traffic for service GroupName: 'sampleappsg-123' VpcId: !Ref vpcid Tags: - Key: "Name" Value: "Sample App Security Group" SecurityGroupEgress: - IpProtocol: "-1" FromPort: ToPort: CidrIp: 10.0../8 SecurityGroupIngress: - IpProtocol: "-1" FromPort: ToPort: CidrIp: 10.0../8
Code language: YAML (yaml)

You can read up more about all the possible arguments in the AWS Security Group CloudFormation Reference.

See also  [Solved] The provided execution role does not have permissions to call CreateNetworkInterface on EC2
Tags:
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x