# RepublishActionProperty

Struct · External

Describes an action to republish to another topic.

- 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_iot as iot } from 'aws-cdk-lib';
const republishActionProperty: iot.CfnTopicRule.RepublishActionProperty = {
  roleArn: 'roleArn',
  topic: 'topic',

  // the properties below are optional
  headers: {
    contentType: 'contentType',
    correlationData: 'correlationData',
    messageExpiry: 'messageExpiry',
    payloadFormatIndicator: 'payloadFormatIndicator',
    responseTopic: 'responseTopic',
    userProperties: [{
      key: 'key',
      value: 'value',
    }],
  },
  qos: 123,
};
```

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_iot as iot

republish_action_property = iot.CfnTopicRule.RepublishActionProperty(
    role_arn="roleArn",
    topic="topic",

    # the properties below are optional
    headers=iot.CfnTopicRule.RepublishActionHeadersProperty(
        content_type="contentType",
        correlation_data="correlationData",
        message_expiry="messageExpiry",
        payload_format_indicator="payloadFormatIndicator",
        response_topic="responseTopic",
        user_properties=[iot.CfnTopicRule.UserPropertyProperty(
            key="key",
            value="value"
        )]
    ),
    qos=123
)
```

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

RepublishActionProperty republishActionProperty = RepublishActionProperty.builder()
        .roleArn("roleArn")
        .topic("topic")

        // the properties below are optional
        .headers(RepublishActionHeadersProperty.builder()
                .contentType("contentType")
                .correlationData("correlationData")
                .messageExpiry("messageExpiry")
                .payloadFormatIndicator("payloadFormatIndicator")
                .responseTopic("responseTopic")
                .userProperties(List.of(UserPropertyProperty.builder()
                        .key("key")
                        .value("value")
                        .build()))
                .build())
        .qos(123)
        .build();
```

C#:

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

var republishActionProperty = new RepublishActionProperty {
    RoleArn = "roleArn",
    Topic = "topic",

    // the properties below are optional
    Headers = new RepublishActionHeadersProperty {
        ContentType = "contentType",
        CorrelationData = "correlationData",
        MessageExpiry = "messageExpiry",
        PayloadFormatIndicator = "payloadFormatIndicator",
        ResponseTopic = "responseTopic",
        UserProperties = new [] { new UserPropertyProperty {
            Key = "key",
            Value = "value"
        } }
    },
    Qos = 123
};
```

Go:

```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"

republishActionProperty := &RepublishActionProperty{
	RoleArn: jsii.String("roleArn"),
	Topic: jsii.String("topic"),

	// the properties below are optional
	Headers: &RepublishActionHeadersProperty{
		ContentType: jsii.String("contentType"),
		CorrelationData: jsii.String("correlationData"),
		MessageExpiry: jsii.String("messageExpiry"),
		PayloadFormatIndicator: jsii.String("payloadFormatIndicator"),
		ResponseTopic: jsii.String("responseTopic"),
		UserProperties: []interface{}{
			&UserPropertyProperty{
				Key: jsii.String("key"),
				Value: jsii.String("value"),
			},
		},
	},
	Qos: jsii.Number(123),
}
```

## Properties

- `headers`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnTopicRule.RepublishActionHeadersProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_iot.CfnTopicRule.RepublishActionHeadersProperty.html) — MQTT Version 5.0 headers information. For more information, see [MQTT](https://docs.aws.amazon.com//iot/latest/developerguide/mqtt.html) in the IoT Core Developer Guide.

- `qos`: number — The Quality of Service (QoS) level to use when republishing messages.

  The default value is 0.

- `roleArn`: string (required) — The ARN of the IAM role that grants access.

- `topic`: string (required) — The name of the MQTT topic.
