Skip to content
v2.277.0

IgnoreMode Enum ​

Determines the ignore behavior to use.

Example ​

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
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
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();
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"
});
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 ​

MemberDescription
GLOBIgnores file paths based on simple glob patterns.
GITIgnores file paths based on the .gitignore specification.
DOCKERIgnores file paths based on the .dockerignore specification.

Referenced by ​

  • CopyOptions.ignoreModeignore_modeignoreModeIgnoreModeIgnoreMode
  • FileCopyOptions.ignoreModeignore_modeignoreModeIgnoreModeIgnoreMode