# BundlingFileAccess

The access mechanism used to make source files available to the bundling container and to return the bundling output back to the host.

- Source: [`core/lib/bundling.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/core/lib/bundling.ts#L204)
- Type last changed: v2.63.0 · 31 Jan 2023

## Example

TypeScript:

```ts
new go.GoFunction(this, 'GoFunction', {
 entry: 'app/cmd/api',
 bundling: {
      bundlingFileAccess: BundlingFileAccess.VOLUME_COPY,
  },
});
```

Python:

```python
go.GoFunction(self, "GoFunction",
    entry="app/cmd/api",
    bundling=go.BundlingOptions(
        bundling_file_access=BundlingFileAccess.VOLUME_COPY
    )
)
```

Java:

```java
GoFunction.Builder.create(this, "GoFunction")
        .entry("app/cmd/api")
        .bundling(BundlingOptions.builder()
                .bundlingFileAccess(BundlingFileAccess.VOLUME_COPY)
                .build())
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
new GoFunction(this, "GoFunction", new GoFunctionProps {
    Entry = "app/cmd/api",
    Bundling = new BundlingOptions {
        BundlingFileAccess = BundlingFileAccess.VOLUME_COPY
    }
});
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
go.NewGoFunction(this, jsii.String("GoFunction"), &GoFunctionProps{
	Entry: jsii.String("app/cmd/api"),
	Bundling: &BundlingOptions{
		BundlingFileAccess: awscdk.BundlingFileAccess_VOLUME_COPY,
	},
})
```

## Members

| Member | Description |
| --- | --- |
| `VOLUME_COPY` | Creates temporary volumes and containers to copy files from the host to the bundling container and back. |
| `BIND_MOUNT` | The source and output folders will be mounted as bind mount from the host system This is faster and simpler, but less portable than `VOLUME_COPY`. |

## Referenced by

- [`BundlingOptions`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.BundlingOptions.html).bundlingFileAccess
- [`BundlingOptions`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda_nodejs.BundlingOptions.html).bundlingFileAccess
- [`BundlingOptions`](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-lambda-go-alpha.BundlingOptions.html).bundlingFileAccess
- [`BundlingOptions`](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-lambda-python-alpha.BundlingOptions.html).bundlingFileAccess
