> **Experimental**
>
> `@aws-cdk/aws-amplify-alpha` is an [**experimental**](/stability) (alpha) package: its API may change in any release, without a major version bump.
# CustomResponseHeader

Custom response header of an Amplify App.

- Stability: [Experimental](/cdk/api/stability.html)
- Source: [`lib/app.ts`](https://github.com/aws/aws-cdk/blob/v2.277.0/packages/@aws-cdk/aws-amplify-alpha/lib/app.ts#L587)

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as amplify_alpha from '@aws-cdk/aws-amplify-alpha';
const customResponseHeader: amplify_alpha.CustomResponseHeader = {
  headers: {
    headersKey: 'headers',
  },
  pattern: 'pattern',

  // the properties below are optional
  appRoot: 'appRoot',
};
```

Python:

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

custom_response_header = amplify_alpha.CustomResponseHeader(
    headers={
        "headers_key": "headers"
    },
    pattern="pattern",

    # the properties below are optional
    app_root="appRoot"
)
```

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

CustomResponseHeader customResponseHeader = CustomResponseHeader.builder()
        .headers(Map.of(
                "headersKey", "headers"))
        .pattern("pattern")

        // the properties below are optional
        .appRoot("appRoot")
        .build();
```

C# / .NET:

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

var customResponseHeader = new CustomResponseHeader {
    Headers = new Dictionary<string, string> {
        { "headersKey", "headers" }
    },
    Pattern = "pattern",

    // the properties below are optional
    AppRoot = "appRoot"
};
```

Golang:

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

customResponseHeader := &CustomResponseHeader{
	Headers: map[string]*string{
		"headersKey": jsii.String("headers"),
	},
	Pattern: jsii.String("pattern"),

	// the properties below are optional
	AppRoot: jsii.String("appRoot"),
}
```

## Properties

- `appRoot`: string — If the app uses a monorepo structure, the appRoot from the build spec to apply the custom headers to.

  **Default:** The appRoot is omitted in the custom headers output.

- `headers`: { [key: string]: string } (required) — The map of custom headers to be applied.

- `pattern`: string (required) — These custom headers will be applied to all URL file paths that match this pattern.
