# IgnoreMode

Determines the ignore behavior to use.

- Source: [`core/lib/fs/options.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/core/lib/fs/options.ts#L49)

## Example

TypeScript:

```ts
new lambda.Function(this, 'Function', {
  code: lambda.Code.fromAsset(path.join(__dirname, 'my-python-handler'), {
    exclude: ['*.ignore'],
    ignoreMode: IgnoreMode.DOCKER, // Default is IgnoreMode.GLOB
  }),
  runtime: lambda.Runtime.PYTHON_3_9,
  handler: 'index.handler',
});
```

Python:

```python
lambda_.Function(self, "Function",
    code=lambda_.Code.from_asset(path.join(__dirname, "my-python-handler"),
        exclude=["*.ignore"],
        ignore_mode=IgnoreMode.DOCKER
    ),
    runtime=lambda_.Runtime.PYTHON_3_9,
    handler="index.handler"
)
```

Java:

```java
Function.Builder.create(this, "Function")
        .code(Code.fromAsset(join(__dirname, "my-python-handler"), AssetOptions.builder()
                .exclude(List.of("*.ignore"))
                .ignoreMode(IgnoreMode.DOCKER)
                .build()))
        .runtime(Runtime.PYTHON_3_9)
        .handler("index.handler")
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
new Function(this, "Function", new FunctionProps {
    Code = Code.FromAsset(Join(__dirname, "my-python-handler"), new AssetOptions {
        Exclude = new [] { "*.ignore" },
        IgnoreMode = IgnoreMode.DOCKER
    }),
    Runtime = Runtime.PYTHON_3_9,
    Handler = "index.handler"
});
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
lambda.NewFunction(this, jsii.String("Function"), &FunctionProps{
	Code: lambda.Code_FromAsset(path.join(__dirname, jsii.String("my-python-handler")), &AssetOptions{
		Exclude: []*string{
			jsii.String("*.ignore"),
		},
		IgnoreMode: awscdk.IgnoreMode_DOCKER,
	}),
	Runtime: lambda.Runtime_PYTHON_3_9(),
	Handler: jsii.String("index.handler"),
})
```

## Members

| Member | Description |
| --- | --- |
| `GLOB` | Ignores file paths based on simple glob patterns. |
| `GIT` | Ignores file paths based on the [`.gitignore specification`](https://git-scm.com/docs/gitignore). |
| `DOCKER` | Ignores file paths based on the [`.dockerignore specification`](https://docs.docker.com/engine/reference/builder/#dockerignore-file). |

## Referenced by

- [`CopyOptions`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.CopyOptions.html).ignoreMode
- [`FileCopyOptions`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.FileCopyOptions.html).ignoreMode
