# HttpRetryPolicyProperty

An object that represents a retry policy.

Specify at least one value for at least one of the types of `RetryEvents` , a value for `maxRetries` , and a value for `perRetryTimeout` . Both `server-error` and `gateway-error` under `httpRetryEvents` include the Envoy `reset` policy. For more information on the `reset` policy, see the [Envoy documentation](https://docs.aws.amazon.com/https://www.envoyproxy.io/docs/envoy/latest/configuration/http/http_filters/router_filter#x-envoy-retry-on) .

- 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_appmesh as appmesh } from 'aws-cdk-lib';
const httpRetryPolicyProperty: appmesh.CfnRoute.HttpRetryPolicyProperty = {
  maxRetries: 123,
  perRetryTimeout: {
    unit: 'unit',
    value: 123,
  },

  // the properties below are optional
  httpRetryEvents: ['httpRetryEvents'],
  tcpRetryEvents: ['tcpRetryEvents'],
};
```

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_appmesh as appmesh

http_retry_policy_property = appmesh.CfnRoute.HttpRetryPolicyProperty(
    max_retries=123,
    per_retry_timeout=appmesh.CfnRoute.DurationProperty(
        unit="unit",
        value=123
    ),

    # the properties below are optional
    http_retry_events=["httpRetryEvents"],
    tcp_retry_events=["tcpRetryEvents"]
)
```

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

HttpRetryPolicyProperty httpRetryPolicyProperty = HttpRetryPolicyProperty.builder()
        .maxRetries(123)
        .perRetryTimeout(DurationProperty.builder()
                .unit("unit")
                .value(123)
                .build())

        // the properties below are optional
        .httpRetryEvents(List.of("httpRetryEvents"))
        .tcpRetryEvents(List.of("tcpRetryEvents"))
        .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.AppMesh;

var httpRetryPolicyProperty = new HttpRetryPolicyProperty {
    MaxRetries = 123,
    PerRetryTimeout = new DurationProperty {
        Unit = "unit",
        Value = 123
    },

    // the properties below are optional
    HttpRetryEvents = new [] { "httpRetryEvents" },
    TcpRetryEvents = new [] { "tcpRetryEvents" }
};
```

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"

httpRetryPolicyProperty := &HttpRetryPolicyProperty{
	MaxRetries: jsii.Number(123),
	PerRetryTimeout: &DurationProperty{
		Unit: jsii.String("unit"),
		Value: jsii.Number(123),
	},

	// the properties below are optional
	HttpRetryEvents: []*string{
		jsii.String("httpRetryEvents"),
	},
	TcpRetryEvents: []*string{
		jsii.String("tcpRetryEvents"),
	},
}
```

## Properties

- `httpRetryEvents`: string[] — Specify at least one of the following values.

  - *server-error* – HTTP status codes 500, 501, 502, 503, 504, 505, 506, 507, 508, 510, and 511
  - *gateway-error* – HTTP status codes 502, 503, and 504
  - *client-error* – HTTP status code 409
  - *stream-error* – Retry on refused stream

- `maxRetries`: number (required) — The maximum number of retry attempts.

- `perRetryTimeout`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnRoute.DurationProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_appmesh.CfnRoute.DurationProperty.html) (required) — The timeout for each retry attempt.

- `tcpRetryEvents`: string[] — Specify a valid value.

  The event occurs before any processing of a request has started and is encountered when the upstream is temporarily or permanently unavailable.
