aws-cdk-lib.aws_ec2.CfnSecurityGroupProps

interface CfnSecurityGroupProps

LanguageType name
.NETAmazon.CDK.AWS.EC2.CfnSecurityGroupProps
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsec2#CfnSecurityGroupProps
Javasoftware.amazon.awscdk.services.ec2.CfnSecurityGroupProps
Pythonaws_cdk.aws_ec2.CfnSecurityGroupProps
TypeScript aws-cdk-lib » aws_ec2 » CfnSecurityGroupProps

Properties for defining a CfnSecurityGroup.

Example

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_ec2 as ec2 } from 'aws-cdk-lib';
const cfnSecurityGroupProps: ec2.CfnSecurityGroupProps = {
  groupDescription: 'groupDescription',

  // the properties below are optional
  groupName: 'groupName',
  securityGroupEgress: [{
    ipProtocol: 'ipProtocol',

    // the properties below are optional
    cidrIp: 'cidrIp',
    cidrIpv6: 'cidrIpv6',
    description: 'description',
    destinationPrefixListId: 'destinationPrefixListId',
    destinationSecurityGroupId: 'destinationSecurityGroupId',
    fromPort: 123,
    toPort: 123,
  }],
  securityGroupIngress: [{
    ipProtocol: 'ipProtocol',

    // the properties below are optional
    cidrIp: 'cidrIp',
    cidrIpv6: 'cidrIpv6',
    description: 'description',
    fromPort: 123,
    sourcePrefixListId: 'sourcePrefixListId',
    sourceSecurityGroupId: 'sourceSecurityGroupId',
    sourceSecurityGroupName: 'sourceSecurityGroupName',
    sourceSecurityGroupOwnerId: 'sourceSecurityGroupOwnerId',
    toPort: 123,
  }],
  tags: [{
    key: 'key',
    value: 'value',
  }],
  vpcId: 'vpcId',
};

Properties

NameTypeDescription
groupDescriptionstringA description for the security group.
groupName?stringThe name of the security group.
securityGroupEgress?IResolvable | IResolvable | EgressProperty[]The outbound rules associated with the security group.
securityGroupIngress?IResolvable | IResolvable | IngressProperty[]The inbound rules associated with the security group.
tags?CfnTag[]Any tags assigned to the security group.
vpcId?stringThe ID of the VPC for the security group.

groupDescription

Type: string

A description for the security group.

Constraints: Up to 255 characters in length

Valid characters: a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=&;{}!$*


groupName?

Type: string (optional)

The name of the security group.

Constraints: Up to 255 characters in length. Cannot start with sg- .

Valid characters: a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=&;{}!$*


securityGroupEgress?

Type: IResolvable | IResolvable | EgressProperty[] (optional)

The outbound rules associated with the security group.

There is a short interruption during which you cannot connect to the security group.


securityGroupIngress?

Type: IResolvable | IResolvable | IngressProperty[] (optional)

The inbound rules associated with the security group.

There is a short interruption during which you cannot connect to the security group.


tags?

Type: CfnTag[] (optional)

Any tags assigned to the security group.


vpcId?

Type: string (optional)

The ID of the VPC for the security group.