Skip to content
v2.277.0

Experimental

@aws-cdk/aws-amplify-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.

CustomResponseHeader Struct ​

Custom response header of an Amplify App.

Example ​

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

appRootoptionalstringapp_rootoptionalstrappRootoptionalStringAppRootoptionalstringAppRootoptional*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 }headerstyping.Mapping[str, str]headersMap<String, String>HeadersIDictionary<string, string>Headers*map[string]*string required #
The map of custom headers to be applied.
patternstringpatternstrpatternStringPatternstringPattern*string required #
These custom headers will be applied to all URL file paths that match this pattern.