Interface CfnSecurityGroupProps
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
CfnSecurityGroupProps.Jsii$Proxy
@Generated(value="jsii-pacmak/1.116.0 (build 0eddcff)",
date="2025-10-29T11:15:37.256Z")
@Stability(Stable)
public interface CfnSecurityGroupProps
extends software.amazon.jsii.JsiiSerializable
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 software.amazon.awscdk.services.ec2.*;
CfnSecurityGroupProps cfnSecurityGroupProps = CfnSecurityGroupProps.builder()
.groupDescription("groupDescription")
// the properties below are optional
.groupName("groupName")
.securityGroupEgress(List.of(EgressProperty.builder()
.ipProtocol("ipProtocol")
// the properties below are optional
.cidrIp("cidrIp")
.cidrIpv6("cidrIpv6")
.description("description")
.destinationPrefixListId("destinationPrefixListId")
.destinationSecurityGroupId("destinationSecurityGroupId")
.fromPort(123)
.toPort(123)
.build()))
.securityGroupIngress(List.of(IngressProperty.builder()
.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)
.build()))
.tags(List.of(CfnTag.builder()
.key("key")
.value("value")
.build()))
.vpcId("vpcId")
.build();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forCfnSecurityGroupPropsstatic final classAn implementation forCfnSecurityGroupProps -
Method Summary
Modifier and TypeMethodDescriptionbuilder()A description for the security group.default StringThe name of the security group.default ObjectThe outbound rules associated with the security group.default ObjectThe inbound rules associated with the security group.getTags()Any tags assigned to the security group.default StringgetVpcId()The ID of the VPC for the security group.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getGroupDescription
A description for the security group.Constraints: Up to 255 characters in length
Valid characters: a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=&;{}!$*
- See Also:
-
getGroupName
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 ._-:/()#,@[]+=&;{}!$*
- See Also:
-
getSecurityGroupEgress
The outbound rules associated with the security group.Returns union: either
IResolvableor Listinvalid input: '<'eitherIResolvableorCfnSecurityGroup.EgressProperty>- See Also:
-
getSecurityGroupIngress
The inbound rules associated with the security group.Returns union: either
IResolvableor Listinvalid input: '<'eitherIResolvableorCfnSecurityGroup.IngressProperty>- See Also:
-
getTags
Any tags assigned to the security group.- See Also:
-
getVpcId
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.
- See Also:
-
builder
- Returns:
- a
CfnSecurityGroupProps.BuilderofCfnSecurityGroupProps
-