github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/iot/topicRule.go (about)

     1  // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
     2  // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
     3  
     4  package iot
     5  
     6  import (
     7  	"context"
     8  	"reflect"
     9  
    10  	"errors"
    11  	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
    12  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    13  )
    14  
    15  // Creates and manages an AWS IoT topic rule.
    16  //
    17  // ## Example Usage
    18  //
    19  // <!--Start PulumiCodeChooser -->
    20  // ```go
    21  // package main
    22  //
    23  // import (
    24  //
    25  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/iam"
    26  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/iot"
    27  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/sns"
    28  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    29  //
    30  // )
    31  // func main() {
    32  // pulumi.Run(func(ctx *pulumi.Context) error {
    33  // mytopic, err := sns.NewTopic(ctx, "mytopic", &sns.TopicArgs{
    34  // Name: pulumi.String("mytopic"),
    35  // })
    36  // if err != nil {
    37  // return err
    38  // }
    39  // myerrortopic, err := sns.NewTopic(ctx, "myerrortopic", &sns.TopicArgs{
    40  // Name: pulumi.String("myerrortopic"),
    41  // })
    42  // if err != nil {
    43  // return err
    44  // }
    45  // _, err = iot.NewTopicRule(ctx, "rule", &iot.TopicRuleArgs{
    46  // Name: pulumi.String("MyRule"),
    47  // Description: pulumi.String("Example rule"),
    48  // Enabled: pulumi.Bool(true),
    49  // Sql: pulumi.String("SELECT * FROM 'topic/test'"),
    50  // SqlVersion: pulumi.String("2016-03-23"),
    51  // Sns: iot.TopicRuleSnsArray{
    52  // &iot.TopicRuleSnsArgs{
    53  // MessageFormat: pulumi.String("RAW"),
    54  // RoleArn: pulumi.Any(role.Arn),
    55  // TargetArn: mytopic.Arn,
    56  // },
    57  // },
    58  // ErrorAction: &iot.TopicRuleErrorActionArgs{
    59  // Sns: &iot.TopicRuleErrorActionSnsArgs{
    60  // MessageFormat: pulumi.String("RAW"),
    61  // RoleArn: pulumi.Any(role.Arn),
    62  // TargetArn: myerrortopic.Arn,
    63  // },
    64  // },
    65  // })
    66  // if err != nil {
    67  // return err
    68  // }
    69  // assumeRole, err := iam.GetPolicyDocument(ctx, &iam.GetPolicyDocumentArgs{
    70  // Statements: []iam.GetPolicyDocumentStatement{
    71  // {
    72  // Effect: pulumi.StringRef("Allow"),
    73  // Principals: []iam.GetPolicyDocumentStatementPrincipal{
    74  // {
    75  // Type: "Service",
    76  // Identifiers: []string{
    77  // "iot.amazonaws.com",
    78  // },
    79  // },
    80  // },
    81  // Actions: []string{
    82  // "sts:AssumeRole",
    83  // },
    84  // },
    85  // },
    86  // }, nil);
    87  // if err != nil {
    88  // return err
    89  // }
    90  // myrole, err := iam.NewRole(ctx, "myrole", &iam.RoleArgs{
    91  // Name: pulumi.String("myrole"),
    92  // AssumeRolePolicy: pulumi.String(assumeRole.Json),
    93  // })
    94  // if err != nil {
    95  // return err
    96  // }
    97  // mypolicy := mytopic.Arn.ApplyT(func(arn string) (iam.GetPolicyDocumentResult, error) {
    98  // return iam.GetPolicyDocumentOutput(ctx, iam.GetPolicyDocumentOutputArgs{
    99  // Statements: []iam.GetPolicyDocumentStatement{
   100  // {
   101  // Effect: "Allow",
   102  // Actions: []string{
   103  // "sns:Publish",
   104  // },
   105  // Resources: interface{}{
   106  // arn,
   107  // },
   108  // },
   109  // },
   110  // }, nil), nil
   111  // }).(iam.GetPolicyDocumentResultOutput)
   112  // _, err = iam.NewRolePolicy(ctx, "mypolicy", &iam.RolePolicyArgs{
   113  // Name: pulumi.String("mypolicy"),
   114  // Role: myrole.ID(),
   115  // Policy: mypolicy.ApplyT(func(mypolicy iam.GetPolicyDocumentResult) (*string, error) {
   116  // return &mypolicy.Json, nil
   117  // }).(pulumi.StringPtrOutput),
   118  // })
   119  // if err != nil {
   120  // return err
   121  // }
   122  // return nil
   123  // })
   124  // }
   125  // ```
   126  // <!--End PulumiCodeChooser -->
   127  //
   128  // ## Import
   129  //
   130  // Using `pulumi import`, import IoT Topic Rules using the `name`. For example:
   131  //
   132  // ```sh
   133  // $ pulumi import aws:iot/topicRule:TopicRule rule <name>
   134  // ```
   135  type TopicRule struct {
   136  	pulumi.CustomResourceState
   137  
   138  	// The ARN of the topic rule
   139  	Arn               pulumi.StringOutput                  `pulumi:"arn"`
   140  	CloudwatchAlarms  TopicRuleCloudwatchAlarmArrayOutput  `pulumi:"cloudwatchAlarms"`
   141  	CloudwatchLogs    TopicRuleCloudwatchLogArrayOutput    `pulumi:"cloudwatchLogs"`
   142  	CloudwatchMetrics TopicRuleCloudwatchMetricArrayOutput `pulumi:"cloudwatchMetrics"`
   143  	// The description of the rule.
   144  	Description   pulumi.StringPtrOutput            `pulumi:"description"`
   145  	Dynamodbs     TopicRuleDynamodbArrayOutput      `pulumi:"dynamodbs"`
   146  	Dynamodbv2s   TopicRuleDynamodbv2ArrayOutput    `pulumi:"dynamodbv2s"`
   147  	Elasticsearch TopicRuleElasticsearchArrayOutput `pulumi:"elasticsearch"`
   148  	// Specifies whether the rule is enabled.
   149  	Enabled pulumi.BoolOutput `pulumi:"enabled"`
   150  	// 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.
   151  	ErrorAction  TopicRuleErrorActionPtrOutput   `pulumi:"errorAction"`
   152  	Firehoses    TopicRuleFirehoseArrayOutput    `pulumi:"firehoses"`
   153  	Https        TopicRuleHttpArrayOutput        `pulumi:"https"`
   154  	IotAnalytics TopicRuleIotAnalyticArrayOutput `pulumi:"iotAnalytics"`
   155  	IotEvents    TopicRuleIotEventArrayOutput    `pulumi:"iotEvents"`
   156  	Kafkas       TopicRuleKafkaArrayOutput       `pulumi:"kafkas"`
   157  	Kineses      TopicRuleKinesisArrayOutput     `pulumi:"kineses"`
   158  	Lambdas      TopicRuleLambdaArrayOutput      `pulumi:"lambdas"`
   159  	// The name of the rule.
   160  	Name        pulumi.StringOutput           `pulumi:"name"`
   161  	Republishes TopicRuleRepublishArrayOutput `pulumi:"republishes"`
   162  	S3          TopicRuleS3ArrayOutput        `pulumi:"s3"`
   163  	Sns         TopicRuleSnsArrayOutput       `pulumi:"sns"`
   164  	// 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.
   165  	Sql pulumi.StringOutput `pulumi:"sql"`
   166  	// The version of the SQL rules engine to use when evaluating the rule.
   167  	SqlVersion    pulumi.StringOutput              `pulumi:"sqlVersion"`
   168  	Sqs           TopicRuleSqsArrayOutput          `pulumi:"sqs"`
   169  	StepFunctions TopicRuleStepFunctionArrayOutput `pulumi:"stepFunctions"`
   170  	// 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.
   171  	Tags pulumi.StringMapOutput `pulumi:"tags"`
   172  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   173  	//
   174  	// Deprecated: Please use `tags` instead.
   175  	TagsAll     pulumi.StringMapOutput         `pulumi:"tagsAll"`
   176  	Timestreams TopicRuleTimestreamArrayOutput `pulumi:"timestreams"`
   177  }
   178  
   179  // NewTopicRule registers a new resource with the given unique name, arguments, and options.
   180  func NewTopicRule(ctx *pulumi.Context,
   181  	name string, args *TopicRuleArgs, opts ...pulumi.ResourceOption) (*TopicRule, error) {
   182  	if args == nil {
   183  		return nil, errors.New("missing one or more required arguments")
   184  	}
   185  
   186  	if args.Enabled == nil {
   187  		return nil, errors.New("invalid value for required argument 'Enabled'")
   188  	}
   189  	if args.Sql == nil {
   190  		return nil, errors.New("invalid value for required argument 'Sql'")
   191  	}
   192  	if args.SqlVersion == nil {
   193  		return nil, errors.New("invalid value for required argument 'SqlVersion'")
   194  	}
   195  	opts = internal.PkgResourceDefaultOpts(opts)
   196  	var resource TopicRule
   197  	err := ctx.RegisterResource("aws:iot/topicRule:TopicRule", name, args, &resource, opts...)
   198  	if err != nil {
   199  		return nil, err
   200  	}
   201  	return &resource, nil
   202  }
   203  
   204  // GetTopicRule gets an existing TopicRule resource's state with the given name, ID, and optional
   205  // state properties that are used to uniquely qualify the lookup (nil if not required).
   206  func GetTopicRule(ctx *pulumi.Context,
   207  	name string, id pulumi.IDInput, state *TopicRuleState, opts ...pulumi.ResourceOption) (*TopicRule, error) {
   208  	var resource TopicRule
   209  	err := ctx.ReadResource("aws:iot/topicRule:TopicRule", name, id, state, &resource, opts...)
   210  	if err != nil {
   211  		return nil, err
   212  	}
   213  	return &resource, nil
   214  }
   215  
   216  // Input properties used for looking up and filtering TopicRule resources.
   217  type topicRuleState struct {
   218  	// The ARN of the topic rule
   219  	Arn               *string                     `pulumi:"arn"`
   220  	CloudwatchAlarms  []TopicRuleCloudwatchAlarm  `pulumi:"cloudwatchAlarms"`
   221  	CloudwatchLogs    []TopicRuleCloudwatchLog    `pulumi:"cloudwatchLogs"`
   222  	CloudwatchMetrics []TopicRuleCloudwatchMetric `pulumi:"cloudwatchMetrics"`
   223  	// The description of the rule.
   224  	Description   *string                  `pulumi:"description"`
   225  	Dynamodbs     []TopicRuleDynamodb      `pulumi:"dynamodbs"`
   226  	Dynamodbv2s   []TopicRuleDynamodbv2    `pulumi:"dynamodbv2s"`
   227  	Elasticsearch []TopicRuleElasticsearch `pulumi:"elasticsearch"`
   228  	// Specifies whether the rule is enabled.
   229  	Enabled *bool `pulumi:"enabled"`
   230  	// 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.
   231  	ErrorAction  *TopicRuleErrorAction  `pulumi:"errorAction"`
   232  	Firehoses    []TopicRuleFirehose    `pulumi:"firehoses"`
   233  	Https        []TopicRuleHttp        `pulumi:"https"`
   234  	IotAnalytics []TopicRuleIotAnalytic `pulumi:"iotAnalytics"`
   235  	IotEvents    []TopicRuleIotEvent    `pulumi:"iotEvents"`
   236  	Kafkas       []TopicRuleKafka       `pulumi:"kafkas"`
   237  	Kineses      []TopicRuleKinesis     `pulumi:"kineses"`
   238  	Lambdas      []TopicRuleLambda      `pulumi:"lambdas"`
   239  	// The name of the rule.
   240  	Name        *string              `pulumi:"name"`
   241  	Republishes []TopicRuleRepublish `pulumi:"republishes"`
   242  	S3          []TopicRuleS3        `pulumi:"s3"`
   243  	Sns         []TopicRuleSns       `pulumi:"sns"`
   244  	// 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.
   245  	Sql *string `pulumi:"sql"`
   246  	// The version of the SQL rules engine to use when evaluating the rule.
   247  	SqlVersion    *string                 `pulumi:"sqlVersion"`
   248  	Sqs           []TopicRuleSqs          `pulumi:"sqs"`
   249  	StepFunctions []TopicRuleStepFunction `pulumi:"stepFunctions"`
   250  	// 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.
   251  	Tags map[string]string `pulumi:"tags"`
   252  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   253  	//
   254  	// Deprecated: Please use `tags` instead.
   255  	TagsAll     map[string]string     `pulumi:"tagsAll"`
   256  	Timestreams []TopicRuleTimestream `pulumi:"timestreams"`
   257  }
   258  
   259  type TopicRuleState struct {
   260  	// The ARN of the topic rule
   261  	Arn               pulumi.StringPtrInput
   262  	CloudwatchAlarms  TopicRuleCloudwatchAlarmArrayInput
   263  	CloudwatchLogs    TopicRuleCloudwatchLogArrayInput
   264  	CloudwatchMetrics TopicRuleCloudwatchMetricArrayInput
   265  	// The description of the rule.
   266  	Description   pulumi.StringPtrInput
   267  	Dynamodbs     TopicRuleDynamodbArrayInput
   268  	Dynamodbv2s   TopicRuleDynamodbv2ArrayInput
   269  	Elasticsearch TopicRuleElasticsearchArrayInput
   270  	// Specifies whether the rule is enabled.
   271  	Enabled pulumi.BoolPtrInput
   272  	// 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.
   273  	ErrorAction  TopicRuleErrorActionPtrInput
   274  	Firehoses    TopicRuleFirehoseArrayInput
   275  	Https        TopicRuleHttpArrayInput
   276  	IotAnalytics TopicRuleIotAnalyticArrayInput
   277  	IotEvents    TopicRuleIotEventArrayInput
   278  	Kafkas       TopicRuleKafkaArrayInput
   279  	Kineses      TopicRuleKinesisArrayInput
   280  	Lambdas      TopicRuleLambdaArrayInput
   281  	// The name of the rule.
   282  	Name        pulumi.StringPtrInput
   283  	Republishes TopicRuleRepublishArrayInput
   284  	S3          TopicRuleS3ArrayInput
   285  	Sns         TopicRuleSnsArrayInput
   286  	// 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.
   287  	Sql pulumi.StringPtrInput
   288  	// The version of the SQL rules engine to use when evaluating the rule.
   289  	SqlVersion    pulumi.StringPtrInput
   290  	Sqs           TopicRuleSqsArrayInput
   291  	StepFunctions TopicRuleStepFunctionArrayInput
   292  	// 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.
   293  	Tags pulumi.StringMapInput
   294  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   295  	//
   296  	// Deprecated: Please use `tags` instead.
   297  	TagsAll     pulumi.StringMapInput
   298  	Timestreams TopicRuleTimestreamArrayInput
   299  }
   300  
   301  func (TopicRuleState) ElementType() reflect.Type {
   302  	return reflect.TypeOf((*topicRuleState)(nil)).Elem()
   303  }
   304  
   305  type topicRuleArgs struct {
   306  	CloudwatchAlarms  []TopicRuleCloudwatchAlarm  `pulumi:"cloudwatchAlarms"`
   307  	CloudwatchLogs    []TopicRuleCloudwatchLog    `pulumi:"cloudwatchLogs"`
   308  	CloudwatchMetrics []TopicRuleCloudwatchMetric `pulumi:"cloudwatchMetrics"`
   309  	// The description of the rule.
   310  	Description   *string                  `pulumi:"description"`
   311  	Dynamodbs     []TopicRuleDynamodb      `pulumi:"dynamodbs"`
   312  	Dynamodbv2s   []TopicRuleDynamodbv2    `pulumi:"dynamodbv2s"`
   313  	Elasticsearch []TopicRuleElasticsearch `pulumi:"elasticsearch"`
   314  	// Specifies whether the rule is enabled.
   315  	Enabled bool `pulumi:"enabled"`
   316  	// 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.
   317  	ErrorAction  *TopicRuleErrorAction  `pulumi:"errorAction"`
   318  	Firehoses    []TopicRuleFirehose    `pulumi:"firehoses"`
   319  	Https        []TopicRuleHttp        `pulumi:"https"`
   320  	IotAnalytics []TopicRuleIotAnalytic `pulumi:"iotAnalytics"`
   321  	IotEvents    []TopicRuleIotEvent    `pulumi:"iotEvents"`
   322  	Kafkas       []TopicRuleKafka       `pulumi:"kafkas"`
   323  	Kineses      []TopicRuleKinesis     `pulumi:"kineses"`
   324  	Lambdas      []TopicRuleLambda      `pulumi:"lambdas"`
   325  	// The name of the rule.
   326  	Name        *string              `pulumi:"name"`
   327  	Republishes []TopicRuleRepublish `pulumi:"republishes"`
   328  	S3          []TopicRuleS3        `pulumi:"s3"`
   329  	Sns         []TopicRuleSns       `pulumi:"sns"`
   330  	// 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.
   331  	Sql string `pulumi:"sql"`
   332  	// The version of the SQL rules engine to use when evaluating the rule.
   333  	SqlVersion    string                  `pulumi:"sqlVersion"`
   334  	Sqs           []TopicRuleSqs          `pulumi:"sqs"`
   335  	StepFunctions []TopicRuleStepFunction `pulumi:"stepFunctions"`
   336  	// 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.
   337  	Tags        map[string]string     `pulumi:"tags"`
   338  	Timestreams []TopicRuleTimestream `pulumi:"timestreams"`
   339  }
   340  
   341  // The set of arguments for constructing a TopicRule resource.
   342  type TopicRuleArgs struct {
   343  	CloudwatchAlarms  TopicRuleCloudwatchAlarmArrayInput
   344  	CloudwatchLogs    TopicRuleCloudwatchLogArrayInput
   345  	CloudwatchMetrics TopicRuleCloudwatchMetricArrayInput
   346  	// The description of the rule.
   347  	Description   pulumi.StringPtrInput
   348  	Dynamodbs     TopicRuleDynamodbArrayInput
   349  	Dynamodbv2s   TopicRuleDynamodbv2ArrayInput
   350  	Elasticsearch TopicRuleElasticsearchArrayInput
   351  	// Specifies whether the rule is enabled.
   352  	Enabled pulumi.BoolInput
   353  	// 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.
   354  	ErrorAction  TopicRuleErrorActionPtrInput
   355  	Firehoses    TopicRuleFirehoseArrayInput
   356  	Https        TopicRuleHttpArrayInput
   357  	IotAnalytics TopicRuleIotAnalyticArrayInput
   358  	IotEvents    TopicRuleIotEventArrayInput
   359  	Kafkas       TopicRuleKafkaArrayInput
   360  	Kineses      TopicRuleKinesisArrayInput
   361  	Lambdas      TopicRuleLambdaArrayInput
   362  	// The name of the rule.
   363  	Name        pulumi.StringPtrInput
   364  	Republishes TopicRuleRepublishArrayInput
   365  	S3          TopicRuleS3ArrayInput
   366  	Sns         TopicRuleSnsArrayInput
   367  	// 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.
   368  	Sql pulumi.StringInput
   369  	// The version of the SQL rules engine to use when evaluating the rule.
   370  	SqlVersion    pulumi.StringInput
   371  	Sqs           TopicRuleSqsArrayInput
   372  	StepFunctions TopicRuleStepFunctionArrayInput
   373  	// 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.
   374  	Tags        pulumi.StringMapInput
   375  	Timestreams TopicRuleTimestreamArrayInput
   376  }
   377  
   378  func (TopicRuleArgs) ElementType() reflect.Type {
   379  	return reflect.TypeOf((*topicRuleArgs)(nil)).Elem()
   380  }
   381  
   382  type TopicRuleInput interface {
   383  	pulumi.Input
   384  
   385  	ToTopicRuleOutput() TopicRuleOutput
   386  	ToTopicRuleOutputWithContext(ctx context.Context) TopicRuleOutput
   387  }
   388  
   389  func (*TopicRule) ElementType() reflect.Type {
   390  	return reflect.TypeOf((**TopicRule)(nil)).Elem()
   391  }
   392  
   393  func (i *TopicRule) ToTopicRuleOutput() TopicRuleOutput {
   394  	return i.ToTopicRuleOutputWithContext(context.Background())
   395  }
   396  
   397  func (i *TopicRule) ToTopicRuleOutputWithContext(ctx context.Context) TopicRuleOutput {
   398  	return pulumi.ToOutputWithContext(ctx, i).(TopicRuleOutput)
   399  }
   400  
   401  // TopicRuleArrayInput is an input type that accepts TopicRuleArray and TopicRuleArrayOutput values.
   402  // You can construct a concrete instance of `TopicRuleArrayInput` via:
   403  //
   404  //	TopicRuleArray{ TopicRuleArgs{...} }
   405  type TopicRuleArrayInput interface {
   406  	pulumi.Input
   407  
   408  	ToTopicRuleArrayOutput() TopicRuleArrayOutput
   409  	ToTopicRuleArrayOutputWithContext(context.Context) TopicRuleArrayOutput
   410  }
   411  
   412  type TopicRuleArray []TopicRuleInput
   413  
   414  func (TopicRuleArray) ElementType() reflect.Type {
   415  	return reflect.TypeOf((*[]*TopicRule)(nil)).Elem()
   416  }
   417  
   418  func (i TopicRuleArray) ToTopicRuleArrayOutput() TopicRuleArrayOutput {
   419  	return i.ToTopicRuleArrayOutputWithContext(context.Background())
   420  }
   421  
   422  func (i TopicRuleArray) ToTopicRuleArrayOutputWithContext(ctx context.Context) TopicRuleArrayOutput {
   423  	return pulumi.ToOutputWithContext(ctx, i).(TopicRuleArrayOutput)
   424  }
   425  
   426  // TopicRuleMapInput is an input type that accepts TopicRuleMap and TopicRuleMapOutput values.
   427  // You can construct a concrete instance of `TopicRuleMapInput` via:
   428  //
   429  //	TopicRuleMap{ "key": TopicRuleArgs{...} }
   430  type TopicRuleMapInput interface {
   431  	pulumi.Input
   432  
   433  	ToTopicRuleMapOutput() TopicRuleMapOutput
   434  	ToTopicRuleMapOutputWithContext(context.Context) TopicRuleMapOutput
   435  }
   436  
   437  type TopicRuleMap map[string]TopicRuleInput
   438  
   439  func (TopicRuleMap) ElementType() reflect.Type {
   440  	return reflect.TypeOf((*map[string]*TopicRule)(nil)).Elem()
   441  }
   442  
   443  func (i TopicRuleMap) ToTopicRuleMapOutput() TopicRuleMapOutput {
   444  	return i.ToTopicRuleMapOutputWithContext(context.Background())
   445  }
   446  
   447  func (i TopicRuleMap) ToTopicRuleMapOutputWithContext(ctx context.Context) TopicRuleMapOutput {
   448  	return pulumi.ToOutputWithContext(ctx, i).(TopicRuleMapOutput)
   449  }
   450  
   451  type TopicRuleOutput struct{ *pulumi.OutputState }
   452  
   453  func (TopicRuleOutput) ElementType() reflect.Type {
   454  	return reflect.TypeOf((**TopicRule)(nil)).Elem()
   455  }
   456  
   457  func (o TopicRuleOutput) ToTopicRuleOutput() TopicRuleOutput {
   458  	return o
   459  }
   460  
   461  func (o TopicRuleOutput) ToTopicRuleOutputWithContext(ctx context.Context) TopicRuleOutput {
   462  	return o
   463  }
   464  
   465  // The ARN of the topic rule
   466  func (o TopicRuleOutput) Arn() pulumi.StringOutput {
   467  	return o.ApplyT(func(v *TopicRule) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   468  }
   469  
   470  func (o TopicRuleOutput) CloudwatchAlarms() TopicRuleCloudwatchAlarmArrayOutput {
   471  	return o.ApplyT(func(v *TopicRule) TopicRuleCloudwatchAlarmArrayOutput { return v.CloudwatchAlarms }).(TopicRuleCloudwatchAlarmArrayOutput)
   472  }
   473  
   474  func (o TopicRuleOutput) CloudwatchLogs() TopicRuleCloudwatchLogArrayOutput {
   475  	return o.ApplyT(func(v *TopicRule) TopicRuleCloudwatchLogArrayOutput { return v.CloudwatchLogs }).(TopicRuleCloudwatchLogArrayOutput)
   476  }
   477  
   478  func (o TopicRuleOutput) CloudwatchMetrics() TopicRuleCloudwatchMetricArrayOutput {
   479  	return o.ApplyT(func(v *TopicRule) TopicRuleCloudwatchMetricArrayOutput { return v.CloudwatchMetrics }).(TopicRuleCloudwatchMetricArrayOutput)
   480  }
   481  
   482  // The description of the rule.
   483  func (o TopicRuleOutput) Description() pulumi.StringPtrOutput {
   484  	return o.ApplyT(func(v *TopicRule) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
   485  }
   486  
   487  func (o TopicRuleOutput) Dynamodbs() TopicRuleDynamodbArrayOutput {
   488  	return o.ApplyT(func(v *TopicRule) TopicRuleDynamodbArrayOutput { return v.Dynamodbs }).(TopicRuleDynamodbArrayOutput)
   489  }
   490  
   491  func (o TopicRuleOutput) Dynamodbv2s() TopicRuleDynamodbv2ArrayOutput {
   492  	return o.ApplyT(func(v *TopicRule) TopicRuleDynamodbv2ArrayOutput { return v.Dynamodbv2s }).(TopicRuleDynamodbv2ArrayOutput)
   493  }
   494  
   495  func (o TopicRuleOutput) Elasticsearch() TopicRuleElasticsearchArrayOutput {
   496  	return o.ApplyT(func(v *TopicRule) TopicRuleElasticsearchArrayOutput { return v.Elasticsearch }).(TopicRuleElasticsearchArrayOutput)
   497  }
   498  
   499  // Specifies whether the rule is enabled.
   500  func (o TopicRuleOutput) Enabled() pulumi.BoolOutput {
   501  	return o.ApplyT(func(v *TopicRule) pulumi.BoolOutput { return v.Enabled }).(pulumi.BoolOutput)
   502  }
   503  
   504  // 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.
   505  func (o TopicRuleOutput) ErrorAction() TopicRuleErrorActionPtrOutput {
   506  	return o.ApplyT(func(v *TopicRule) TopicRuleErrorActionPtrOutput { return v.ErrorAction }).(TopicRuleErrorActionPtrOutput)
   507  }
   508  
   509  func (o TopicRuleOutput) Firehoses() TopicRuleFirehoseArrayOutput {
   510  	return o.ApplyT(func(v *TopicRule) TopicRuleFirehoseArrayOutput { return v.Firehoses }).(TopicRuleFirehoseArrayOutput)
   511  }
   512  
   513  func (o TopicRuleOutput) Https() TopicRuleHttpArrayOutput {
   514  	return o.ApplyT(func(v *TopicRule) TopicRuleHttpArrayOutput { return v.Https }).(TopicRuleHttpArrayOutput)
   515  }
   516  
   517  func (o TopicRuleOutput) IotAnalytics() TopicRuleIotAnalyticArrayOutput {
   518  	return o.ApplyT(func(v *TopicRule) TopicRuleIotAnalyticArrayOutput { return v.IotAnalytics }).(TopicRuleIotAnalyticArrayOutput)
   519  }
   520  
   521  func (o TopicRuleOutput) IotEvents() TopicRuleIotEventArrayOutput {
   522  	return o.ApplyT(func(v *TopicRule) TopicRuleIotEventArrayOutput { return v.IotEvents }).(TopicRuleIotEventArrayOutput)
   523  }
   524  
   525  func (o TopicRuleOutput) Kafkas() TopicRuleKafkaArrayOutput {
   526  	return o.ApplyT(func(v *TopicRule) TopicRuleKafkaArrayOutput { return v.Kafkas }).(TopicRuleKafkaArrayOutput)
   527  }
   528  
   529  func (o TopicRuleOutput) Kineses() TopicRuleKinesisArrayOutput {
   530  	return o.ApplyT(func(v *TopicRule) TopicRuleKinesisArrayOutput { return v.Kineses }).(TopicRuleKinesisArrayOutput)
   531  }
   532  
   533  func (o TopicRuleOutput) Lambdas() TopicRuleLambdaArrayOutput {
   534  	return o.ApplyT(func(v *TopicRule) TopicRuleLambdaArrayOutput { return v.Lambdas }).(TopicRuleLambdaArrayOutput)
   535  }
   536  
   537  // The name of the rule.
   538  func (o TopicRuleOutput) Name() pulumi.StringOutput {
   539  	return o.ApplyT(func(v *TopicRule) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
   540  }
   541  
   542  func (o TopicRuleOutput) Republishes() TopicRuleRepublishArrayOutput {
   543  	return o.ApplyT(func(v *TopicRule) TopicRuleRepublishArrayOutput { return v.Republishes }).(TopicRuleRepublishArrayOutput)
   544  }
   545  
   546  func (o TopicRuleOutput) S3() TopicRuleS3ArrayOutput {
   547  	return o.ApplyT(func(v *TopicRule) TopicRuleS3ArrayOutput { return v.S3 }).(TopicRuleS3ArrayOutput)
   548  }
   549  
   550  func (o TopicRuleOutput) Sns() TopicRuleSnsArrayOutput {
   551  	return o.ApplyT(func(v *TopicRule) TopicRuleSnsArrayOutput { return v.Sns }).(TopicRuleSnsArrayOutput)
   552  }
   553  
   554  // 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.
   555  func (o TopicRuleOutput) Sql() pulumi.StringOutput {
   556  	return o.ApplyT(func(v *TopicRule) pulumi.StringOutput { return v.Sql }).(pulumi.StringOutput)
   557  }
   558  
   559  // The version of the SQL rules engine to use when evaluating the rule.
   560  func (o TopicRuleOutput) SqlVersion() pulumi.StringOutput {
   561  	return o.ApplyT(func(v *TopicRule) pulumi.StringOutput { return v.SqlVersion }).(pulumi.StringOutput)
   562  }
   563  
   564  func (o TopicRuleOutput) Sqs() TopicRuleSqsArrayOutput {
   565  	return o.ApplyT(func(v *TopicRule) TopicRuleSqsArrayOutput { return v.Sqs }).(TopicRuleSqsArrayOutput)
   566  }
   567  
   568  func (o TopicRuleOutput) StepFunctions() TopicRuleStepFunctionArrayOutput {
   569  	return o.ApplyT(func(v *TopicRule) TopicRuleStepFunctionArrayOutput { return v.StepFunctions }).(TopicRuleStepFunctionArrayOutput)
   570  }
   571  
   572  // 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.
   573  func (o TopicRuleOutput) Tags() pulumi.StringMapOutput {
   574  	return o.ApplyT(func(v *TopicRule) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   575  }
   576  
   577  // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   578  //
   579  // Deprecated: Please use `tags` instead.
   580  func (o TopicRuleOutput) TagsAll() pulumi.StringMapOutput {
   581  	return o.ApplyT(func(v *TopicRule) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   582  }
   583  
   584  func (o TopicRuleOutput) Timestreams() TopicRuleTimestreamArrayOutput {
   585  	return o.ApplyT(func(v *TopicRule) TopicRuleTimestreamArrayOutput { return v.Timestreams }).(TopicRuleTimestreamArrayOutput)
   586  }
   587  
   588  type TopicRuleArrayOutput struct{ *pulumi.OutputState }
   589  
   590  func (TopicRuleArrayOutput) ElementType() reflect.Type {
   591  	return reflect.TypeOf((*[]*TopicRule)(nil)).Elem()
   592  }
   593  
   594  func (o TopicRuleArrayOutput) ToTopicRuleArrayOutput() TopicRuleArrayOutput {
   595  	return o
   596  }
   597  
   598  func (o TopicRuleArrayOutput) ToTopicRuleArrayOutputWithContext(ctx context.Context) TopicRuleArrayOutput {
   599  	return o
   600  }
   601  
   602  func (o TopicRuleArrayOutput) Index(i pulumi.IntInput) TopicRuleOutput {
   603  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *TopicRule {
   604  		return vs[0].([]*TopicRule)[vs[1].(int)]
   605  	}).(TopicRuleOutput)
   606  }
   607  
   608  type TopicRuleMapOutput struct{ *pulumi.OutputState }
   609  
   610  func (TopicRuleMapOutput) ElementType() reflect.Type {
   611  	return reflect.TypeOf((*map[string]*TopicRule)(nil)).Elem()
   612  }
   613  
   614  func (o TopicRuleMapOutput) ToTopicRuleMapOutput() TopicRuleMapOutput {
   615  	return o
   616  }
   617  
   618  func (o TopicRuleMapOutput) ToTopicRuleMapOutputWithContext(ctx context.Context) TopicRuleMapOutput {
   619  	return o
   620  }
   621  
   622  func (o TopicRuleMapOutput) MapIndex(k pulumi.StringInput) TopicRuleOutput {
   623  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *TopicRule {
   624  		return vs[0].(map[string]*TopicRule)[vs[1].(string)]
   625  	}).(TopicRuleOutput)
   626  }
   627  
   628  func init() {
   629  	pulumi.RegisterInputType(reflect.TypeOf((*TopicRuleInput)(nil)).Elem(), &TopicRule{})
   630  	pulumi.RegisterInputType(reflect.TypeOf((*TopicRuleArrayInput)(nil)).Elem(), TopicRuleArray{})
   631  	pulumi.RegisterInputType(reflect.TypeOf((*TopicRuleMapInput)(nil)).Elem(), TopicRuleMap{})
   632  	pulumi.RegisterOutputType(TopicRuleOutput{})
   633  	pulumi.RegisterOutputType(TopicRuleArrayOutput{})
   634  	pulumi.RegisterOutputType(TopicRuleMapOutput{})
   635  }