# 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.

- Source: Generated at build time
- Type last changed: v2.93.0 · 23 Aug 2023

## Example

TypeScript:

```ts
// 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',
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_amplify as amplify

custom_rule_property = amplify.CfnApp.CustomRuleProperty(
    source="source",
    target="target",

    # the properties below are optional
    condition="condition",
    status="status"
)
```

Java:

```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.*;

CustomRuleProperty customRuleProperty = CustomRuleProperty.builder()
        .source("source")
        .target("target")

        // the properties below are optional
        .condition("condition")
        .status("status")
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Amplify;

var customRuleProperty = new CustomRuleProperty {
    Source = "source",
    Target = "target",

    // the properties below are optional
    Condition = "condition",
    Status = "status"
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

customRuleProperty := &CustomRuleProperty{
	Source: jsii.String("source"),
	Target: jsii.String("target"),

	// the properties below are optional
	Condition: jsii.String("condition"),
	Status: jsii.String("status"),
}
```

## Properties

- `condition`: string — The condition for a URL rewrite or redirect rule, such as a country code.

- `source`: string (required) — The source pattern for a URL rewrite or redirect rule.

- `status`: string — 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.

- `target`: string (required) — The target pattern for a URL rewrite or redirect rule.
