resource "aws_iot_topic_rule_destination" "example" {
vpc_configuration {
role_arn = aws_iam_role.example.arn
security_groups = [aws_security_group.example.id]
subnet_ids = aws_subnet.example[*].id
vpc_id = aws_vpc.example.id
}
}
enabled
- (Optional) Whether or not to enable the destination. Default: true
.vpc_configuration
- (Required) Configuration of the virtual private cloud (VPC) connection. For more info, see the AWS documentation.The vpc_configuration
object takes the following arguments:
role_arn
- (Required) The ARN of a role that has permission to create and attach to elastic network interfaces (ENIs).security_groups
- (Optional) The security groups of the VPC destination.subnet_ids
- (Required) The subnet IDs of the VPC destination.vpc_id
- (Required) The ID of the VPC.This resource exports the following attributes in addition to the arguments above:
arn
- The ARN of the topic rule destinationIn Terraform v1.5.0 and later, use an import
block to import IoT topic rule destinations using the arn
. For example:
import {
to = aws_iot_topic_rule_destination.example
id = "arn:aws:iot:us-west-2:123456789012:ruledestination/vpc/2ce781c8-68a6-4c52-9c62-63fe489ecc60"
}
Using terraform import
, import IoT topic rule destinations using the arn
. For example:
% terraform import aws_iot_topic_rule_destination.example arn:aws:iot:us-west-2:123456789012:ruledestination/vpc/2ce781c8-68a6-4c52-9c62-63fe489ecc60