AWS Fundamentals Logo
AWS Fundamentals
L2 Construct

SecurityGroup

A security group controlling inbound and outbound network traffic

Import

import { SecurityGroup } from 'aws-cdk-lib/aws-ec2';

Or use the module namespace:

import * as ec2 from 'aws-cdk-lib/aws-ec2';
// ec2.SecurityGroup

Underlying CloudFormation Resources

This L2 construct creates and manages the following CloudFormation resources.

Get the Amazon EC2 Cheat Sheet

Everything you need to know about Amazon EC2 on one page. HD quality, print-friendly.

Download Free Infographic