# SecurityGroupImportOptions

Additional options for imported security groups.

Used as argument in: [SecurityGroup.fromSecurityGroupId](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.SecurityGroup.html#fromsecuritygroupid)

- Source: [`aws-ec2/lib/security-group.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-ec2/lib/security-group.ts#L319)
- Type last changed: v2.45.0 · 6 Oct 2022

## Example

TypeScript:

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

Python:

```python
security_group = ec2.SecurityGroup.from_security_group_id(self, "SG", "sg-12345",
    mutable=False
)
```

Java:

```java
ISecurityGroup securityGroup = SecurityGroup.fromSecurityGroupId(this, "SG", "sg-12345", SecurityGroupImportOptions.builder()
        .mutable(false)
        .build());
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
var securityGroup = SecurityGroup.FromSecurityGroupId(this, "SG", "sg-12345", new SecurityGroupImportOptions {
    Mutable = false
});
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
securityGroup := ec2.SecurityGroup_FromSecurityGroupId(this, jsii.String("SG"), jsii.String("sg-12345"), &SecurityGroupImportOptions{
	Mutable: jsii.Boolean(false),
})
```

## Properties

- `allowAllIpv6Outbound`: boolean = 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`: boolean = 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`: boolean = 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.
