1. Packages
  2. AWS
  3. API Docs
  4. iot
  5. TopicRuleDestination
AWS v6.77.0 published on Wednesday, Apr 9, 2025 by Pulumi

aws.iot.TopicRuleDestination

Explore with Pulumi AI

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.iot.TopicRuleDestination("example", {vpcConfiguration: {
    roleArn: exampleAwsIamRole.arn,
    securityGroups: [exampleAwsSecurityGroup.id],
    subnetIds: exampleAwsSubnet.map(__item => __item.id),
    vpcId: exampleAwsVpc.id,
}});
Copy
import pulumi
import pulumi_aws as aws

example = aws.iot.TopicRuleDestination("example", vpc_configuration={
    "role_arn": example_aws_iam_role["arn"],
    "security_groups": [example_aws_security_group["id"]],
    "subnet_ids": [__item["id"] for __item in example_aws_subnet],
    "vpc_id": example_aws_vpc["id"],
})
Copy
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/iot"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := iot.NewTopicRuleDestination(ctx, "example", &iot.TopicRuleDestinationArgs{
VpcConfiguration: &iot.TopicRuleDestinationVpcConfigurationArgs{
RoleArn: pulumi.Any(exampleAwsIamRole.Arn),
SecurityGroups: pulumi.StringArray{
exampleAwsSecurityGroup.Id,
},
SubnetIds: []pulumi.String(%!v(PANIC=Format method: fatal: A failure has occurred: unlowered splat expression @ example.pp:4,22-44)),
VpcId: pulumi.Any(exampleAwsVpc.Id),
},
})
if err != nil {
return err
}
return nil
})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var example = new Aws.Iot.TopicRuleDestination("example", new()
    {
        VpcConfiguration = new Aws.Iot.Inputs.TopicRuleDestinationVpcConfigurationArgs
        {
            RoleArn = exampleAwsIamRole.Arn,
            SecurityGroups = new[]
            {
                exampleAwsSecurityGroup.Id,
            },
            SubnetIds = exampleAwsSubnet.Select(__item => __item.Id).ToList(),
            VpcId = exampleAwsVpc.Id,
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.iot.TopicRuleDestination;
import com.pulumi.aws.iot.TopicRuleDestinationArgs;
import com.pulumi.aws.iot.inputs.TopicRuleDestinationVpcConfigurationArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var example = new TopicRuleDestination("example", TopicRuleDestinationArgs.builder()
            .vpcConfiguration(TopicRuleDestinationVpcConfigurationArgs.builder()
                .roleArn(exampleAwsIamRole.arn())
                .securityGroups(exampleAwsSecurityGroup.id())
                .subnetIds(exampleAwsSubnet.stream().map(element -> element.id()).collect(toList()))
                .vpcId(exampleAwsVpc.id())
                .build())
            .build());

    }
}
Copy
Coming soon!

Create TopicRuleDestination Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new TopicRuleDestination(name: string, args: TopicRuleDestinationArgs, opts?: CustomResourceOptions);
@overload
def TopicRuleDestination(resource_name: str,
                         args: TopicRuleDestinationArgs,
                         opts: Optional[ResourceOptions] = None)

@overload
def TopicRuleDestination(resource_name: str,
                         opts: Optional[ResourceOptions] = None,
                         vpc_configuration: Optional[TopicRuleDestinationVpcConfigurationArgs] = None,
                         enabled: Optional[bool] = None)
func NewTopicRuleDestination(ctx *Context, name string, args TopicRuleDestinationArgs, opts ...ResourceOption) (*TopicRuleDestination, error)
public TopicRuleDestination(string name, TopicRuleDestinationArgs args, CustomResourceOptions? opts = null)
public TopicRuleDestination(String name, TopicRuleDestinationArgs args)
public TopicRuleDestination(String name, TopicRuleDestinationArgs args, CustomResourceOptions options)
type: aws:iot:TopicRuleDestination
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. TopicRuleDestinationArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. TopicRuleDestinationArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. TopicRuleDestinationArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. TopicRuleDestinationArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. TopicRuleDestinationArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var topicRuleDestinationResource = new Aws.Iot.TopicRuleDestination("topicRuleDestinationResource", new()
{
    VpcConfiguration = new Aws.Iot.Inputs.TopicRuleDestinationVpcConfigurationArgs
    {
        RoleArn = "string",
        SubnetIds = new[]
        {
            "string",
        },
        VpcId = "string",
        SecurityGroups = new[]
        {
            "string",
        },
    },
    Enabled = false,
});
Copy
example, err := iot.NewTopicRuleDestination(ctx, "topicRuleDestinationResource", &iot.TopicRuleDestinationArgs{
	VpcConfiguration: &iot.TopicRuleDestinationVpcConfigurationArgs{
		RoleArn: pulumi.String("string"),
		SubnetIds: pulumi.StringArray{
			pulumi.String("string"),
		},
		VpcId: pulumi.String("string"),
		SecurityGroups: pulumi.StringArray{
			pulumi.String("string"),
		},
	},
	Enabled: pulumi.Bool(false),
})
Copy
var topicRuleDestinationResource = new TopicRuleDestination("topicRuleDestinationResource", TopicRuleDestinationArgs.builder()
    .vpcConfiguration(TopicRuleDestinationVpcConfigurationArgs.builder()
        .roleArn("string")
        .subnetIds("string")
        .vpcId("string")
        .securityGroups("string")
        .build())
    .enabled(false)
    .build());
Copy
topic_rule_destination_resource = aws.iot.TopicRuleDestination("topicRuleDestinationResource",
    vpc_configuration={
        "role_arn": "string",
        "subnet_ids": ["string"],
        "vpc_id": "string",
        "security_groups": ["string"],
    },
    enabled=False)
Copy
const topicRuleDestinationResource = new aws.iot.TopicRuleDestination("topicRuleDestinationResource", {
    vpcConfiguration: {
        roleArn: "string",
        subnetIds: ["string"],
        vpcId: "string",
        securityGroups: ["string"],
    },
    enabled: false,
});
Copy
type: aws:iot:TopicRuleDestination
properties:
    enabled: false
    vpcConfiguration:
        roleArn: string
        securityGroups:
            - string
        subnetIds:
            - string
        vpcId: string
Copy

TopicRuleDestination Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The TopicRuleDestination resource accepts the following input properties:

VpcConfiguration
This property is required.
Changes to this property will trigger replacement.
TopicRuleDestinationVpcConfiguration
Configuration of the virtual private cloud (VPC) connection. For more info, see the AWS documentation.
Enabled bool
Whether or not to enable the destination. Default: true.
VpcConfiguration
This property is required.
Changes to this property will trigger replacement.
TopicRuleDestinationVpcConfigurationArgs
Configuration of the virtual private cloud (VPC) connection. For more info, see the AWS documentation.
Enabled bool
Whether or not to enable the destination. Default: true.
vpcConfiguration
This property is required.
Changes to this property will trigger replacement.
TopicRuleDestinationVpcConfiguration
Configuration of the virtual private cloud (VPC) connection. For more info, see the AWS documentation.
enabled Boolean
Whether or not to enable the destination. Default: true.
vpcConfiguration
This property is required.
Changes to this property will trigger replacement.
TopicRuleDestinationVpcConfiguration
Configuration of the virtual private cloud (VPC) connection. For more info, see the AWS documentation.
enabled boolean
Whether or not to enable the destination. Default: true.
vpc_configuration
This property is required.
Changes to this property will trigger replacement.
TopicRuleDestinationVpcConfigurationArgs
Configuration of the virtual private cloud (VPC) connection. For more info, see the AWS documentation.
enabled bool
Whether or not to enable the destination. Default: true.
vpcConfiguration
This property is required.
Changes to this property will trigger replacement.
Property Map
Configuration of the virtual private cloud (VPC) connection. For more info, see the AWS documentation.
enabled Boolean
Whether or not to enable the destination. Default: true.

Outputs

All input properties are implicitly available as output properties. Additionally, the TopicRuleDestination resource produces the following output properties:

Arn string
The ARN of the topic rule destination
Id string
The provider-assigned unique ID for this managed resource.
Arn string
The ARN of the topic rule destination
Id string
The provider-assigned unique ID for this managed resource.
arn String
The ARN of the topic rule destination
id String
The provider-assigned unique ID for this managed resource.
arn string
The ARN of the topic rule destination
id string
The provider-assigned unique ID for this managed resource.
arn str
The ARN of the topic rule destination
id str
The provider-assigned unique ID for this managed resource.
arn String
The ARN of the topic rule destination
id String
The provider-assigned unique ID for this managed resource.

Look up Existing TopicRuleDestination Resource

Get an existing TopicRuleDestination resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: TopicRuleDestinationState, opts?: CustomResourceOptions): TopicRuleDestination
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        arn: Optional[str] = None,
        enabled: Optional[bool] = None,
        vpc_configuration: Optional[TopicRuleDestinationVpcConfigurationArgs] = None) -> TopicRuleDestination
func GetTopicRuleDestination(ctx *Context, name string, id IDInput, state *TopicRuleDestinationState, opts ...ResourceOption) (*TopicRuleDestination, error)
public static TopicRuleDestination Get(string name, Input<string> id, TopicRuleDestinationState? state, CustomResourceOptions? opts = null)
public static TopicRuleDestination get(String name, Output<String> id, TopicRuleDestinationState state, CustomResourceOptions options)
resources:  _:    type: aws:iot:TopicRuleDestination    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
Arn string
The ARN of the topic rule destination
Enabled bool
Whether or not to enable the destination. Default: true.
VpcConfiguration Changes to this property will trigger replacement. TopicRuleDestinationVpcConfiguration
Configuration of the virtual private cloud (VPC) connection. For more info, see the AWS documentation.
Arn string
The ARN of the topic rule destination
Enabled bool
Whether or not to enable the destination. Default: true.
VpcConfiguration Changes to this property will trigger replacement. TopicRuleDestinationVpcConfigurationArgs
Configuration of the virtual private cloud (VPC) connection. For more info, see the AWS documentation.
arn String
The ARN of the topic rule destination
enabled Boolean
Whether or not to enable the destination. Default: true.
vpcConfiguration Changes to this property will trigger replacement. TopicRuleDestinationVpcConfiguration
Configuration of the virtual private cloud (VPC) connection. For more info, see the AWS documentation.
arn string
The ARN of the topic rule destination
enabled boolean
Whether or not to enable the destination. Default: true.
vpcConfiguration Changes to this property will trigger replacement. TopicRuleDestinationVpcConfiguration
Configuration of the virtual private cloud (VPC) connection. For more info, see the AWS documentation.
arn str
The ARN of the topic rule destination
enabled bool
Whether or not to enable the destination. Default: true.
vpc_configuration Changes to this property will trigger replacement. TopicRuleDestinationVpcConfigurationArgs
Configuration of the virtual private cloud (VPC) connection. For more info, see the AWS documentation.
arn String
The ARN of the topic rule destination
enabled Boolean
Whether or not to enable the destination. Default: true.
vpcConfiguration Changes to this property will trigger replacement. Property Map
Configuration of the virtual private cloud (VPC) connection. For more info, see the AWS documentation.

Supporting Types

TopicRuleDestinationVpcConfiguration
, TopicRuleDestinationVpcConfigurationArgs

RoleArn
This property is required.
Changes to this property will trigger replacement.
string
The ARN of a role that has permission to create and attach to elastic network interfaces (ENIs).
SubnetIds
This property is required.
Changes to this property will trigger replacement.
List<string>
The subnet IDs of the VPC destination.
VpcId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the VPC.
SecurityGroups Changes to this property will trigger replacement. List<string>
The security groups of the VPC destination.
RoleArn
This property is required.
Changes to this property will trigger replacement.
string
The ARN of a role that has permission to create and attach to elastic network interfaces (ENIs).
SubnetIds
This property is required.
Changes to this property will trigger replacement.
[]string
The subnet IDs of the VPC destination.
VpcId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the VPC.
SecurityGroups Changes to this property will trigger replacement. []string
The security groups of the VPC destination.
roleArn
This property is required.
Changes to this property will trigger replacement.
String
The ARN of a role that has permission to create and attach to elastic network interfaces (ENIs).
subnetIds
This property is required.
Changes to this property will trigger replacement.
List<String>
The subnet IDs of the VPC destination.
vpcId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the VPC.
securityGroups Changes to this property will trigger replacement. List<String>
The security groups of the VPC destination.
roleArn
This property is required.
Changes to this property will trigger replacement.
string
The ARN of a role that has permission to create and attach to elastic network interfaces (ENIs).
subnetIds
This property is required.
Changes to this property will trigger replacement.
string[]
The subnet IDs of the VPC destination.
vpcId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the VPC.
securityGroups Changes to this property will trigger replacement. string[]
The security groups of the VPC destination.
role_arn
This property is required.
Changes to this property will trigger replacement.
str
The ARN of a role that has permission to create and attach to elastic network interfaces (ENIs).
subnet_ids
This property is required.
Changes to this property will trigger replacement.
Sequence[str]
The subnet IDs of the VPC destination.
vpc_id
This property is required.
Changes to this property will trigger replacement.
str
The ID of the VPC.
security_groups Changes to this property will trigger replacement. Sequence[str]
The security groups of the VPC destination.
roleArn
This property is required.
Changes to this property will trigger replacement.
String
The ARN of a role that has permission to create and attach to elastic network interfaces (ENIs).
subnetIds
This property is required.
Changes to this property will trigger replacement.
List<String>
The subnet IDs of the VPC destination.
vpcId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the VPC.
securityGroups Changes to this property will trigger replacement. List<String>
The security groups of the VPC destination.

Import

Using pulumi import, import IoT topic rule destinations using the arn. For example:

$ pulumi import aws:iot/topicRuleDestination:TopicRuleDestination example arn:aws:iot:us-west-2:123456789012:ruledestination/vpc/2ce781c8-68a6-4c52-9c62-63fe489ecc60
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
AWS Classic pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.