Class CustomRule
(experimental) Custom rewrite/redirect rule for an Amplify App.
Inheritance
Namespace: Amazon.CDK.AWS.Amplify
Assembly: Amazon.CDK.AWS.Amplify.dll
Syntax (csharp)
public class CustomRule : DeputyBase
Syntax (vb)
Public Class CustomRule
Inherits DeputyBase
Remarks
Stability: Experimental
See: https://docs.aws.amazon.com/amplify/latest/userguide/redirects.html
ExampleMetadata: infused
Examples
App amplifyApp;
amplifyApp.AddCustomRule(new Dictionary<string, object> {
{ "source", "/docs/specific-filename.html" },
{ "target", "/documents/different-filename.html" },
{ "status", RedirectStatus.TEMPORARY_REDIRECT }
});
Synopsis
Constructors
CustomRule(ICustomRuleOptions) | |
CustomRule(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
CustomRule(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Properties
Condition | (experimental) The condition for a URL rewrite or redirect rule, e.g. country code. |
SINGLE_PAGE_APPLICATION_REDIRECT | (experimental) Sets up a 200 rewrite for all paths to |
Source | (experimental) The source pattern for a URL rewrite or redirect rule. |
Status | (experimental) The status code for a URL rewrite or redirect rule. |
Target | (experimental) The target pattern for a URL rewrite or redirect rule. |
Constructors
CustomRule(ICustomRuleOptions)
public CustomRule(ICustomRuleOptions options)
Parameters
- options ICustomRuleOptions
Remarks
Stability: Experimental
CustomRule(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected CustomRule(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
CustomRule(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected CustomRule(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Properties
Condition
(experimental) The condition for a URL rewrite or redirect rule, e.g. country code.
public virtual string Condition { get; }
Property Value
System.String
Remarks
Default: - no condition
Stability: Experimental
See: https://docs.aws.amazon.com/amplify/latest/userguide/redirects.html
SINGLE_PAGE_APPLICATION_REDIRECT
(experimental) Sets up a 200 rewrite for all paths to index.html
except for path containing a file extension.
public static CustomRule SINGLE_PAGE_APPLICATION_REDIRECT { get; }
Property Value
Remarks
Stability: Experimental
Source
(experimental) The source pattern for a URL rewrite or redirect rule.
public virtual string Source { get; }
Property Value
System.String
Remarks
Stability: Experimental
See: https://docs.aws.amazon.com/amplify/latest/userguide/redirects.html
Status
(experimental) The status code for a URL rewrite or redirect rule.
public virtual Nullable<RedirectStatus> Status { get; }
Property Value
System.Nullable<RedirectStatus>
Remarks
Default: PERMANENT_REDIRECT
Stability: Experimental
See: https://docs.aws.amazon.com/amplify/latest/userguide/redirects.html
Target
(experimental) The target pattern for a URL rewrite or redirect rule.
public virtual string Target { get; }
Property Value
System.String
Remarks
Stability: Experimental
See: https://docs.aws.amazon.com/amplify/latest/userguide/redirects.html