Show / Hide Table of Contents

Class TopicRule

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
public MyStack()
{
    var mytopic = new Aws.Sns.Topic("mytopic", new Aws.Sns.TopicArgs
    {
    });
    var role = new Aws.Iam.Role("role", new Aws.Iam.RoleArgs
    {
        AssumeRolePolicy = @"{
""Version"": ""2012-10-17"",
""Statement"": [
{
  ""Effect"": ""Allow"",
  ""Principal"": {
    ""Service"": ""iot.amazonaws.com""
  },
  ""Action"": ""sts:AssumeRole""
}
]
}

",
    });
    var rule = new Aws.Iot.TopicRule("rule", new Aws.Iot.TopicRuleArgs
    {
        Description = "Example rule",
        Enabled = true,
        Sns = new Aws.Iot.Inputs.TopicRuleSnsArgs
        {
            Sns = "RAW",
            Sns = role.Arn,
            Sns = mytopic.Arn,
        },
        Sql = "SELECT * FROM 'topic/test'",
        SqlVersion = "2016-03-23",
    });
    var iamPolicyForLambda = new Aws.Iam.RolePolicy("iamPolicyForLambda", new Aws.Iam.RolePolicyArgs
    {
        Policy = mytopic.Arn.Apply(arn => @$"{{
""Version"": ""2012-10-17"",
""Statement"": [
{{
    ""Effect"": ""Allow"",
    ""Action"": [
        ""sns:Publish""
    ],
    ""Resource"": ""{arn}""
}}
]
}}

"),
        Role = role.Id,
    });
}

}
Inheritance
System.Object
Resource
CustomResource
TopicRule
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.Aws.Iot
Assembly: Pulumi.Aws.dll
Syntax
public class TopicRule : CustomResource

Constructors

View Source

TopicRule(String, TopicRuleArgs, CustomResourceOptions)

Create a TopicRule resource with the given unique name, arguments, and options.

Declaration
public TopicRule(string name, TopicRuleArgs args, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resource

TopicRuleArgs args

The arguments used to populate this resource's properties

CustomResourceOptions options

A bag of options that control this resource's behavior

Properties

View Source

Arn

The ARN of the topic rule

Declaration
public Output<string> Arn { get; }
Property Value
Type Description
Output<System.String>
View Source

CloudwatchAlarm

Declaration
public Output<TopicRuleCloudwatchAlarm> CloudwatchAlarm { get; }
Property Value
Type Description
Output<TopicRuleCloudwatchAlarm>
View Source

CloudwatchMetric

Declaration
public Output<TopicRuleCloudwatchMetric> CloudwatchMetric { get; }
Property Value
Type Description
Output<TopicRuleCloudwatchMetric>
View Source

Description

The description of the rule.

Declaration
public Output<string> Description { get; }
Property Value
Type Description
Output<System.String>
View Source

Dynamodb

Declaration
public Output<TopicRuleDynamodb> Dynamodb { get; }
Property Value
Type Description
Output<TopicRuleDynamodb>
View Source

Dynamodbv2s

Declaration
public Output<ImmutableArray<TopicRuleDynamodbv2>> Dynamodbv2s { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<TopicRuleDynamodbv2>>
View Source

Elasticsearch

Declaration
public Output<TopicRuleElasticsearch> Elasticsearch { get; }
Property Value
Type Description
Output<TopicRuleElasticsearch>
View Source

Enabled

Specifies whether the rule is enabled.

Declaration
public Output<bool> Enabled { get; }
Property Value
Type Description
Output<System.Boolean>
View Source

Firehose

Declaration
public Output<TopicRuleFirehose> Firehose { get; }
Property Value
Type Description
Output<TopicRuleFirehose>
View Source

IotAnalytics

Declaration
public Output<ImmutableArray<TopicRuleIotAnalytic>> IotAnalytics { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<TopicRuleIotAnalytic>>
View Source

IotEvents

Declaration
public Output<ImmutableArray<TopicRuleIotEvent>> IotEvents { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<TopicRuleIotEvent>>
View Source

Kinesis

Declaration
public Output<TopicRuleKinesis> Kinesis { get; }
Property Value
Type Description
Output<TopicRuleKinesis>
View Source

Lambda

Declaration
public Output<TopicRuleLambda> Lambda { get; }
Property Value
Type Description
Output<TopicRuleLambda>
View Source

Name

The name of the rule.

Declaration
public Output<string> Name { get; }
Property Value
Type Description
Output<System.String>
View Source

Republish

Declaration
public Output<TopicRuleRepublish> Republish { get; }
Property Value
Type Description
Output<TopicRuleRepublish>
View Source

S3

Declaration
public Output<TopicRuleS3> S3 { get; }
Property Value
Type Description
Output<TopicRuleS3>
View Source

Sns

Declaration
public Output<TopicRuleSns> Sns { get; }
Property Value
Type Description
Output<TopicRuleSns>
View Source

Sql

The SQL statement used to query the topic. For more information, see AWS IoT SQL Reference (http://docs.aws.amazon.com/iot/latest/developerguide/iot-rules.html#aws-iot-sql-reference) in the AWS IoT Developer Guide.

Declaration
public Output<string> Sql { get; }
Property Value
Type Description
Output<System.String>
View Source

SqlVersion

The version of the SQL rules engine to use when evaluating the rule.

Declaration
public Output<string> SqlVersion { get; }
Property Value
Type Description
Output<System.String>
View Source

Sqs

Declaration
public Output<TopicRuleSqs> Sqs { get; }
Property Value
Type Description
Output<TopicRuleSqs>
View Source

Tags

Key-value map of resource tags

Declaration
public Output<ImmutableDictionary<string, object>> Tags { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.Object>>

Methods

View Source

Get(String, Input<String>, TopicRuleState, CustomResourceOptions)

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

Declaration
public static TopicRule Get(string name, Input<string> id, TopicRuleState state = null, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resulting resource.

Input<System.String> id

The unique provider ID of the resource to lookup.

TopicRuleState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

Returns
Type Description
TopicRule
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.