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
TopicRule
Inherited Members
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()
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
View Source
CloudwatchMetric
Declaration
public Output<TopicRuleCloudwatchMetric> CloudwatchMetric { get; }
Property Value
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
View Source
Dynamodbv2s
Declaration
public Output<ImmutableArray<TopicRuleDynamodbv2>> Dynamodbv2s { get; }
Property Value
View Source
Elasticsearch
Declaration
public Output<TopicRuleElasticsearch> Elasticsearch { get; }
Property Value
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
View Source
IotAnalytics
Declaration
public Output<ImmutableArray<TopicRuleIotAnalytic>> IotAnalytics { get; }
Property Value
View Source
IotEvents
Declaration
public Output<ImmutableArray<TopicRuleIotEvent>> IotEvents { get; }
Property Value
View Source
Kinesis
Declaration
public Output<TopicRuleKinesis> Kinesis { get; }
Property Value
View Source
Lambda
Declaration
public Output<TopicRuleLambda> Lambda { get; }
Property Value
View Source
Name
Declaration
public Output<string> Name { get; }
Property Value
| Type |
Description |
| Output<System.String> |
|
View Source
Republish
Declaration
public Output<TopicRuleRepublish> Republish { get; }
Property Value
View Source
S3
Declaration
public Output<TopicRuleS3> S3 { get; }
Property Value
View Source
Sns
Declaration
public Output<TopicRuleSns> Sns { get; }
Property Value
View Source
Sql
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
View Source
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 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