# Ec2ConfigProperty

The subnet and security groups that AWS DataSync uses to connect to one of your Amazon EFS file system's [mount targets](https://docs.aws.amazon.com/efs/latest/ug/accessing-fs.html) .

- Source: Generated at build time
- Type last changed: v2.93.0 · 23 Aug 2023

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_datasync as datasync } from 'aws-cdk-lib';
const ec2ConfigProperty: datasync.CfnLocationEFS.Ec2ConfigProperty = {
  securityGroupArns: ['securityGroupArns'],
  subnetArn: 'subnetArn',
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_datasync as datasync

ec2_config_property = datasync.CfnLocationEFS.Ec2ConfigProperty(
    security_group_arns=["securityGroupArns"],
    subnet_arn="subnetArn"
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.datasync.*;

Ec2ConfigProperty ec2ConfigProperty = Ec2ConfigProperty.builder()
        .securityGroupArns(List.of("securityGroupArns"))
        .subnetArn("subnetArn")
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.DataSync;

var ec2ConfigProperty = new Ec2ConfigProperty {
    SecurityGroupArns = new [] { "securityGroupArns" },
    SubnetArn = "subnetArn"
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

ec2ConfigProperty := &Ec2ConfigProperty{
	SecurityGroupArns: []*string{
		jsii.String("securityGroupArns"),
	},
	SubnetArn: jsii.String("subnetArn"),
}
```

## Properties

- `securityGroupArns`: string[] (required) — Specifies the Amazon Resource Names (ARNs) of the security groups associated with an Amazon EFS file system's mount target.

- `subnetArn`: string (required) — Specifies the ARN of a subnet where DataSync creates the [network interfaces](https://docs.aws.amazon.com/datasync/latest/userguide/datasync-network.html#required-network-interfaces.html) for managing traffic during your transfer.

  The subnet must be located:

  - In the same virtual private cloud (VPC) as the Amazon EFS file system.
  - In the same Availability Zone as at least one mount target for the Amazon EFS file system.

  > You don't need to specify a subnet that includes a file system mount target.
