CfnSecurityGroupProps Struct
Properties for defining a CfnSecurityGroup.
Example
ts
// 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
groupDescriptionstringgroup_descriptionstrgroupDescriptionStringGroupDescriptionstringGroupDescription*stringrequired#A description for the security group.
Constraints: Up to 255 characters in length
Valid characters: a-z, A-Z, 0-9, spaces, and ._-😕()#,@[]+=&;{}!$*
groupNameoptionalstringgroup_nameoptionalstrgroupNameoptionalStringGroupNameoptionalstringGroupNameoptional*string#The name of the security group. Names are case-insensitive and must be unique within the VPC.
Constraints: Up to 255 characters in length. Can't start with sg- .
Valid characters: a-z, A-Z, 0-9, spaces, and ._-😕()#,@[]+=&;{}!$*
securityGroupEgressoptionalIResolvable | IResolvable | CfnSecurityGroup.EgressProperty[]security_group_egressoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, EgressProperty]]]securityGroupEgressoptionalIResolvableSecurityGroupEgressoptionalIResolvableSecurityGroupEgressoptionalinterface{}#The outbound rules associated with the security group.
securityGroupIngressoptionalIResolvable | IResolvable | CfnSecurityGroup.IngressProperty[]security_group_ingressoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, IngressProperty]]]securityGroupIngressoptionalIResolvableSecurityGroupIngressoptionalIResolvableSecurityGroupIngressoptionalinterface{}#The inbound rules associated with the security group.
tagsoptionalCfnTag[]tagsoptionaltyping.List[CfnTag]tagsoptionalList<CfnTag>TagsoptionalCfnTag[]Tagsoptional*[]CfnTag#Any tags assigned to the security group.
vpcIdoptionalstring | IVPCRefvpc_idoptionaltyping.Union[str, IVPCRef]vpcIdoptionalStringVpcIdoptionalstringVpcIdoptionalinterface{}#The ID of the VPC for the security group.
If you do not specify a VPC, the default is to use the default VPC for the Region. If there's no specified VPC and no default VPC, security group creation fails.