# FileSystemAttributes

Properties that describe an existing EFS file system.

- Source: [`aws-efs/lib/efs-file-system.ts`](https://github.com/aws/aws-cdk/blob/v2.277.0/packages/aws-cdk-lib/aws-efs/lib/efs-file-system.ts#L349)

## Example

TypeScript:

```ts
import * as iam from 'aws-cdk-lib/aws-iam';

const importedFileSystem = efs.FileSystem.fromFileSystemAttributes(this, 'existingFS', {
  fileSystemId: 'fs-12345678', // You can also use fileSystemArn instead of fileSystemId.
  securityGroup: ec2.SecurityGroup.fromSecurityGroupId(this, 'SG', 'sg-123456789', {
    allowAllOutbound: false,
  }),
});
```

Python:

```python
import aws_cdk.aws_iam as iam

imported_file_system = efs.FileSystem.from_file_system_attributes(self, "existingFS",
    file_system_id="fs-12345678",  # You can also use fileSystemArn instead of fileSystemId.
    security_group=ec2.SecurityGroup.from_security_group_id(self, "SG", "sg-123456789",
        allow_all_outbound=False
    )
)
```

Java:

```java
import software.amazon.awscdk.services.iam.*;

IFileSystem importedFileSystem = FileSystem.fromFileSystemAttributes(this, "existingFS", FileSystemAttributes.builder()
        .fileSystemId("fs-12345678") // You can also use fileSystemArn instead of fileSystemId.
        .securityGroup(SecurityGroup.fromSecurityGroupId(this, "SG", "sg-123456789", SecurityGroupImportOptions.builder()
                .allowAllOutbound(false)
                .build()))
        .build());
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
using Amazon.CDK.AWS.IAM;

var importedFileSystem = FileSystem.FromFileSystemAttributes(this, "existingFS", new FileSystemAttributes {
    FileSystemId = "fs-12345678",  // You can also use fileSystemArn instead of fileSystemId.
    SecurityGroup = SecurityGroup.FromSecurityGroupId(this, "SG", "sg-123456789", new SecurityGroupImportOptions {
        AllowAllOutbound = false
    })
});
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
import iam "github.com/aws/aws-cdk-go/awscdk"

importedFileSystem := efs.FileSystem_FromFileSystemAttributes(this, jsii.String("existingFS"), &FileSystemAttributes{
	FileSystemId: jsii.String("fs-12345678"),
	 // You can also use fileSystemArn instead of fileSystemId.
	SecurityGroup: ec2.SecurityGroup_FromSecurityGroupId(this, jsii.String("SG"), jsii.String("sg-123456789"), &SecurityGroupImportOptions{
		AllowAllOutbound: jsii.Boolean(false),
	}),
})
```

## Properties

- `fileSystemArn`: string — The File System's Arn.

  **Default:** determined based on fileSystemId

- `fileSystemId`: string — The File System's ID.

  **Default:** determined based on fileSystemArn

- `securityGroup`: [ISecurityGroup](/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.ISecurityGroup.html) (required) — The security group of the file system.
