aws-cdk-lib.aws_ec2.SecurityGroupImportOptions

interface SecurityGroupImportOptions

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

Additional options for imported security groups.

Example

const securityGroup = ec2.SecurityGroup.fromSecurityGroupId(this, 'SG', 'sg-12345', {
  mutable: false
});

Properties

NameTypeDescription
allowAllIpv6Outbound?booleanMark the SecurityGroup as having been created allowing all outbound ipv6 traffic.
allowAllOutbound?booleanMark the SecurityGroup as having been created allowing all outbound traffic.
mutable?booleanIf a SecurityGroup is mutable CDK can add rules to existing groups.

allowAllIpv6Outbound?

Type: boolean (optional, default: false)

Mark the SecurityGroup as having been created allowing all outbound ipv6 traffic.

Only if this is set to false will egress rules for ipv6 be added to this security group. Be aware, this would undo any potential "all outbound traffic" default.


allowAllOutbound?

Type: boolean (optional, default: true)

Mark the SecurityGroup as having been created allowing all outbound traffic.

Only if this is set to false will egress rules be added to this security group. Be aware, this would undo any potential "all outbound traffic" default.


mutable?

Type: boolean (optional, default: true)

If a SecurityGroup is mutable CDK can add rules to existing groups.

Beware that making a SecurityGroup immutable might lead to issue due to missing ingress/egress rules for new resources.