aws-cdk-lib.aws_amplify.CfnApp.CustomRuleProperty

interface CustomRuleProperty

LanguageType name
.NETAmazon.CDK.AWS.Amplify.CfnApp.CustomRuleProperty
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsamplify#CfnApp_CustomRuleProperty
Javasoftware.amazon.awscdk.services.amplify.CfnApp.CustomRuleProperty
Pythonaws_cdk.aws_amplify.CfnApp.CustomRuleProperty
TypeScript aws-cdk-lib » aws_amplify » CfnApp » CustomRuleProperty

The CustomRule property type allows you to specify redirects, rewrites, and reverse proxies.

Redirects enable a web app to reroute navigation from one URL to another.

Example

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_amplify as amplify } from 'aws-cdk-lib';
const customRuleProperty: amplify.CfnApp.CustomRuleProperty = {
  source: 'source',
  target: 'target',

  // the properties below are optional
  condition: 'condition',
  status: 'status',
};

Properties

NameTypeDescription
sourcestringThe source pattern for a URL rewrite or redirect rule.
targetstringThe target pattern for a URL rewrite or redirect rule.
condition?stringThe condition for a URL rewrite or redirect rule, such as a country code.
status?stringThe status code for a URL rewrite or redirect rule.

source

Type: string

The source pattern for a URL rewrite or redirect rule.

Length Constraints: Minimum length of 1. Maximum length of 2048.

Pattern: (?s).+


target

Type: string

The target pattern for a URL rewrite or redirect rule.

Length Constraints: Minimum length of 1. Maximum length of 2048.

Pattern: (?s).+


condition?

Type: string (optional)

The condition for a URL rewrite or redirect rule, such as a country code.

Length Constraints: Minimum length of 0. Maximum length of 2048.

Pattern: (?s).*


status?

Type: string (optional)

The status code for a URL rewrite or redirect rule.

  • 200 - Represents a 200 rewrite rule.
  • 301 - Represents a 301 (moved pemanently) redirect rule. This and all future requests should be directed to the target URL.
  • 302 - Represents a 302 temporary redirect rule.
  • 404 - Represents a 404 redirect rule.
  • 404-200 - Represents a 404 rewrite rule.

Length Constraints: Minimum length of 3. Maximum length of 7.

Pattern: .{3,7}