# FingerprintOptions

Options related to calculating source hash.

Extends: [CopyOptions](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.CopyOptions.html)
Used as argument in: [FileSystem.fingerprint](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.FileSystem.html#fingerprint)

- 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#L202)
- Type last changed: v2.278.0 · 20 Nov 2026

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
const fingerprintOptions: cdk.FingerprintOptions = {
  exclude: ['exclude'],
  extraHash: 'extraHash',
  follow: cdk.SymlinkFollowMode.NEVER,
  ignoreMode: cdk.IgnoreMode.GLOB,
};
```

Python:

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

fingerprint_options = cdk.FingerprintOptions(
    exclude=["exclude"],
    extra_hash="extraHash",
    follow=cdk.SymlinkFollowMode.NEVER,
    ignore_mode=cdk.IgnoreMode.GLOB
)
```

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.*;

FingerprintOptions fingerprintOptions = FingerprintOptions.builder()
        .exclude(List.of("exclude"))
        .extraHash("extraHash")
        .follow(SymlinkFollowMode.NEVER)
        .ignoreMode(IgnoreMode.GLOB)
        .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;

var fingerprintOptions = new FingerprintOptions {
    Exclude = new [] { "exclude" },
    ExtraHash = "extraHash",
    Follow = SymlinkFollowMode.NEVER,
    IgnoreMode = IgnoreMode.GLOB
};
```

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"

fingerprintOptions := &FingerprintOptions{
	Exclude: []*string{
		jsii.String("exclude"),
	},
	ExtraHash: jsii.String("extraHash"),
	Follow: cdk.SymlinkFollowMode_NEVER,
	IgnoreMode: cdk.IgnoreMode_GLOB,
}
```

## Properties

- `exclude`: string[] — File paths matching the patterns will be excluded. See `ignoreMode` to set the matching behavior.

  **Default:** nothing is excluded

  ## Without bundling

  When used without the `bundling` property, the asset is just a regular file
  copy operation. In that case, this controls the files that will be included
  in the copy. Files matching the `exclude` patterns will not be included in
  the copy.

  ## With bundling

  When used with the `bundling` property, the asset is produced by a
  bundling operation. In that case, the value of `exclude` is only meaningful
  if the `assetHashType` is set to `AssetHashType.SOURCE`, and ignored for
  other asset hash types. The `exclude` patterns will be used to determine
  which files contribute to the asset, and the bundling command is skipped
  if the source files have not changed since the last bundling operation.

  **NOTE:** The bundling operation still has access to all files in the source path,
  regardless of the `exclude` patterns. It is your responsibility to ensure
  the `exclude` pattern accurately matches the files the bundling operation
  will *actually* access and base its final output on.

  For `OUTPUT` or `CUSTOM` asset hash types, the `exclude` pattern is ignored.

- `extraHash`: string — Extra information to encode into the fingerprint (e.g. build instructions and other inputs).

  **Default:** hash is only based on the file fingerprint

- `follow`: [SymlinkFollowMode](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.SymlinkFollowMode.html) = SymlinkFollowMode.EXTERNAL — A strategy for how to handle symlinks.

  Symlinks may be copied, materialized or rejected. Note that if symlinks are
  copied they should be relative; absolute symlinks will lose their
  meaning if the cloud assembly is moved to another machine.

  ## Without bundling

  When used without the `bundling` property, the asset is just a regular file
  copy operation. In that case, symlinks are materialized or blocked with respect
  to the source path root as they are being copied.

  ## With bundling

  When used with the `bundling` property, the asset is produced by a
  bundling operation. In that case, the bundling command is fully
  in charge of producing a set of files in an output directory, and
  the `AssetStaging` construct will never affect symlink materialization.

  If the `assetHashType` is `AssetHashType.SOURCE`, this flag affects what
  the source hash is based on, and the recommended value is one of
  `SymlinkFollowMode.EXTERNAL` or `SymlinkFollowMode.BLOCK_EXTERNAL`.

  If the `SymlinkFollowMode.BLOCK_EXTERNAL` mode is used:

  - Symlinks pointing outside the source tree will be blocked, but only
    if using `AssetHashType.SOURCE` (not for any of the other asset hash types).
  - Symlinks pointing outside the bundle output will be blocked.

- `ignoreMode`: [IgnoreMode](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IgnoreMode.html) — What syntax the `exclude` patterns are written in.

  **Default:** IgnoreMode.GLOB for file assets, `IgnoreMode.DOCKER` for image assets (requires that the `@aws-cdk/aws-ecr-assets:dockerIgnoreSupport` feature flag is set, which is recommended)
