CustomRuleOptions

class aws_cdk.aws_amplify_alpha.CustomRuleOptions(*, source, target, condition=None, status=None)

Bases: object

(experimental) Options for a custom rewrite/redirect rule for an Amplify App.

Parameters:
  • source (str) – (experimental) The source pattern for a URL rewrite or redirect rule.

  • target (str) – (experimental) The target pattern for a URL rewrite or redirect rule.

  • condition (Optional[str]) – (experimental) The condition for a URL rewrite or redirect rule, e.g. country code. Default: - no condition

  • status (Optional[RedirectStatus]) – (experimental) The status code for a URL rewrite or redirect rule. Default: PERMANENT_REDIRECT

Stability:

experimental

ExampleMetadata:

fixture=_generated

Example:

# 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_rule_options = amplify_alpha.CustomRuleOptions(
    source="source",
    target="target",

    # the properties below are optional
    condition="condition",
    status=amplify_alpha.RedirectStatus.REWRITE
)

Attributes

condition

(experimental) The condition for a URL rewrite or redirect rule, e.g. country code.

Default:
  • no condition

See:

https://docs.aws.amazon.com/amplify/latest/userguide/redirects.html

Stability:

experimental

source

(experimental) The source pattern for a URL rewrite or redirect rule.

See:

https://docs.aws.amazon.com/amplify/latest/userguide/redirects.html

Stability:

experimental

status

(experimental) The status code for a URL rewrite or redirect rule.

Default:

PERMANENT_REDIRECT

See:

https://docs.aws.amazon.com/amplify/latest/userguide/redirects.html

Stability:

experimental

target

(experimental) The target pattern for a URL rewrite or redirect rule.

See:

https://docs.aws.amazon.com/amplify/latest/userguide/redirects.html

Stability:

experimental