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.

RedirectStatus Enum ​

The status code for a URL rewrite or redirect rule.

Example ​

ts
import { CustomRule } from '@aws-cdk/aws-amplify-alpha';

declare const amplifyApp: amplify.App;
amplifyApp.addCustomRule(new CustomRule({
  source: '/docs/specific-filename.html',
  target: '/documents/different-filename.html',
  status: amplify.RedirectStatus.TEMPORARY_REDIRECT,
}));
python
from aws_cdk.aws_amplify_alpha import CustomRule

# amplify_app: amplify.App

amplify_app.add_custom_rule(CustomRule(
    source="/docs/specific-filename.html",
    target="/documents/different-filename.html",
    status=amplify.RedirectStatus.TEMPORARY_REDIRECT
))
java
import software.amazon.awscdk.services.amplify.alpha.CustomRule;

App amplifyApp;

amplifyApp.addCustomRule(CustomRule.Builder.create()
        .source("/docs/specific-filename.html")
        .target("/documents/different-filename.html")
        .status(RedirectStatus.TEMPORARY_REDIRECT)
        .build());
csharp
// Install: dotnet add package Amazon.CDK.AWS.Amplify.Alpha
using Amazon.CDK.AWS.Amplify.Alpha;

App amplifyApp;

amplifyApp.AddCustomRule(new CustomRule(new CustomRuleOptions {
    Source = "/docs/specific-filename.html",
    Target = "/documents/different-filename.html",
    Status = RedirectStatus.TEMPORARY_REDIRECT
}));
go
// Install: go get github.com/aws/aws-cdk-go/awscdkamplifyalpha/v2
import "github.com/aws/aws-cdk-go/awscdkamplifyalpha"

var amplifyApp App

amplifyApp.AddCustomRule(awscdkamplifyalpha.NewCustomRule(&CustomRuleOptions{
	Source: jsii.String("/docs/specific-filename.html"),
	Target: jsii.String("/documents/different-filename.html"),
	Status: amplify.RedirectStatus_TEMPORARY_REDIRECT,
}))

Members ​

MemberDescription
REWRITERewrite (200).
PERMANENT_REDIRECTPermanent redirect (301).
TEMPORARY_REDIRECTTemporary redirect (302).
NOT_FOUNDNot found (404).
NOT_FOUND_REWRITENot found rewrite (404).

Referenced by ​