import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * Creates and manages an AWS IoT topic rule. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const mytopic = new aws.sns.Topic("mytopic", {name: "mytopic"}); * const myerrortopic = new aws.sns.Topic("myerrortopic", {name: "myerrortopic"}); * const rule = new aws.iot.TopicRule("rule", { * errorAction: { * sns: { * messageFormat: "RAW", * roleArn: role.arn, * targetArn: myerrortopic.arn, * }, * }, * sns: [{ * messageFormat: "RAW", * roleArn: role.arn, * targetArn: mytopic.arn, * }], * name: "MyRule", * description: "Example rule", * enabled: true, * sql: "SELECT * FROM 'topic/test'", * sqlVersion: "2016-03-23", * }); * const assumeRole = aws.iam.getPolicyDocument({ * statements: [{ * principals: [{ * type: "Service", * identifiers: ["iot.amazonaws.com"], * }], * effect: "Allow", * actions: ["sts:AssumeRole"], * }], * }); * const myrole = new aws.iam.Role("myrole", { * name: "myrole", * assumeRolePolicy: assumeRole.then(assumeRole => assumeRole.json), * }); * const mypolicy = aws.iam.getPolicyDocumentOutput({ * statements: [{ * effect: "Allow", * actions: ["sns:Publish"], * resources: [mytopic.arn], * }], * }); * const mypolicyRolePolicy = new aws.iam.RolePolicy("mypolicy", { * name: "mypolicy", * role: myrole.id, * policy: mypolicy.json, * }); * ``` * * ## Import * * Using `pulumi import`, import IoT Topic Rules using the `name`. For example: * * ```sh * $ pulumi import aws:iot/topicRule:TopicRule rule * ``` */ export declare class TopicRule extends pulumi.CustomResource { /** * Get an existing TopicRule resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input, state?: TopicRuleState, opts?: pulumi.CustomResourceOptions): TopicRule; /** * Returns true if the given object is an instance of TopicRule. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is TopicRule; /** * The ARN of the topic rule */ readonly arn: pulumi.Output; readonly cloudwatchAlarms: pulumi.Output; readonly cloudwatchLogs: pulumi.Output; readonly cloudwatchMetrics: pulumi.Output; /** * The description of the rule. */ readonly description: pulumi.Output; readonly dynamodbs: pulumi.Output; readonly dynamodbv2s: pulumi.Output; readonly elasticsearch: pulumi.Output; /** * Specifies whether the rule is enabled. */ readonly enabled: pulumi.Output; /** * Configuration block with error action to be associated with the rule. See the documentation for `cloudwatchAlarm`, `cloudwatchLogs`, `cloudwatchMetric`, `dynamodb`, `dynamodbv2`, `elasticsearch`, `firehose`, `http`, `iotAnalytics`, `iotEvents`, `kafka`, `kinesis`, `lambda`, `republish`, `s3`, `sns`, `sqs`, `stepFunctions`, `timestream` configuration blocks for further configuration details. */ readonly errorAction: pulumi.Output; readonly firehoses: pulumi.Output; readonly https: pulumi.Output; readonly iotAnalytics: pulumi.Output; readonly iotEvents: pulumi.Output; readonly kafkas: pulumi.Output; readonly kineses: pulumi.Output; readonly lambdas: pulumi.Output; /** * The name of the rule. */ readonly name: pulumi.Output; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ readonly region: pulumi.Output; readonly republishes: pulumi.Output; readonly s3: pulumi.Output; readonly sns: pulumi.Output; /** * 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. */ readonly sql: pulumi.Output; /** * The version of the SQL rules engine to use when evaluating the rule. */ readonly sqlVersion: pulumi.Output; readonly sqs: pulumi.Output; readonly stepFunctions: pulumi.Output; /** * Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. */ readonly tags: pulumi.Output<{ [key: string]: string; } | undefined>; /** * A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. */ readonly tagsAll: pulumi.Output<{ [key: string]: string; }>; readonly timestreams: pulumi.Output; /** * Create a TopicRule resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: TopicRuleArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering TopicRule resources. */ export interface TopicRuleState { /** * The ARN of the topic rule */ arn?: pulumi.Input; cloudwatchAlarms?: pulumi.Input[] | undefined>; cloudwatchLogs?: pulumi.Input[] | undefined>; cloudwatchMetrics?: pulumi.Input[] | undefined>; /** * The description of the rule. */ description?: pulumi.Input; dynamodbs?: pulumi.Input[] | undefined>; dynamodbv2s?: pulumi.Input[] | undefined>; elasticsearch?: pulumi.Input[] | undefined>; /** * Specifies whether the rule is enabled. */ enabled?: pulumi.Input; /** * Configuration block with error action to be associated with the rule. See the documentation for `cloudwatchAlarm`, `cloudwatchLogs`, `cloudwatchMetric`, `dynamodb`, `dynamodbv2`, `elasticsearch`, `firehose`, `http`, `iotAnalytics`, `iotEvents`, `kafka`, `kinesis`, `lambda`, `republish`, `s3`, `sns`, `sqs`, `stepFunctions`, `timestream` configuration blocks for further configuration details. */ errorAction?: pulumi.Input; firehoses?: pulumi.Input[] | undefined>; https?: pulumi.Input[] | undefined>; iotAnalytics?: pulumi.Input[] | undefined>; iotEvents?: pulumi.Input[] | undefined>; kafkas?: pulumi.Input[] | undefined>; kineses?: pulumi.Input[] | undefined>; lambdas?: pulumi.Input[] | undefined>; /** * The name of the rule. */ name?: pulumi.Input; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ region?: pulumi.Input; republishes?: pulumi.Input[] | undefined>; s3?: pulumi.Input[] | undefined>; sns?: pulumi.Input[] | undefined>; /** * 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. */ sql?: pulumi.Input; /** * The version of the SQL rules engine to use when evaluating the rule. */ sqlVersion?: pulumi.Input; sqs?: pulumi.Input[] | undefined>; stepFunctions?: pulumi.Input[] | undefined>; /** * Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. */ tags?: pulumi.Input<{ [key: string]: pulumi.Input; } | undefined>; /** * A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. */ tagsAll?: pulumi.Input<{ [key: string]: pulumi.Input; } | undefined>; timestreams?: pulumi.Input[] | undefined>; } /** * The set of arguments for constructing a TopicRule resource. */ export interface TopicRuleArgs { cloudwatchAlarms?: pulumi.Input[] | undefined>; cloudwatchLogs?: pulumi.Input[] | undefined>; cloudwatchMetrics?: pulumi.Input[] | undefined>; /** * The description of the rule. */ description?: pulumi.Input; dynamodbs?: pulumi.Input[] | undefined>; dynamodbv2s?: pulumi.Input[] | undefined>; elasticsearch?: pulumi.Input[] | undefined>; /** * Specifies whether the rule is enabled. */ enabled: pulumi.Input; /** * Configuration block with error action to be associated with the rule. See the documentation for `cloudwatchAlarm`, `cloudwatchLogs`, `cloudwatchMetric`, `dynamodb`, `dynamodbv2`, `elasticsearch`, `firehose`, `http`, `iotAnalytics`, `iotEvents`, `kafka`, `kinesis`, `lambda`, `republish`, `s3`, `sns`, `sqs`, `stepFunctions`, `timestream` configuration blocks for further configuration details. */ errorAction?: pulumi.Input; firehoses?: pulumi.Input[] | undefined>; https?: pulumi.Input[] | undefined>; iotAnalytics?: pulumi.Input[] | undefined>; iotEvents?: pulumi.Input[] | undefined>; kafkas?: pulumi.Input[] | undefined>; kineses?: pulumi.Input[] | undefined>; lambdas?: pulumi.Input[] | undefined>; /** * The name of the rule. */ name?: pulumi.Input; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ region?: pulumi.Input; republishes?: pulumi.Input[] | undefined>; s3?: pulumi.Input[] | undefined>; sns?: pulumi.Input[] | undefined>; /** * 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. */ sql: pulumi.Input; /** * The version of the SQL rules engine to use when evaluating the rule. */ sqlVersion: pulumi.Input; sqs?: pulumi.Input[] | undefined>; stepFunctions?: pulumi.Input[] | undefined>; /** * Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. */ tags?: pulumi.Input<{ [key: string]: pulumi.Input; } | undefined>; timestreams?: pulumi.Input[] | undefined>; } //# sourceMappingURL=topicRule.d.ts.map