Skip to content

Commit

Permalink
Merge pull request #1864 from quixoticmonk/d-improve-awscc_iot_topic_…
Browse files Browse the repository at this point in the history
…rule

docs: added example for awscc_iot_topic_rule
  • Loading branch information
justinretzolk authored Jul 19, 2024
2 parents 78af834 + 0aeec36 commit cfeae70
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 3 deletions.
28 changes: 25 additions & 3 deletions docs/resources/iot_topic_rule.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "awscc_iot_topic_rule Resource - terraform-provider-awscc"
subcategory: ""
description: |-
Expand All @@ -10,7 +9,30 @@ description: |-

Resource Type definition for AWS::IoT::TopicRule


## Example Usage

```terraform
resource "awscc_iot_topic_rule" "example" {
rule_name = "example_rule"
topic_rule_payload = {
sql = "SELECT temp FROM 'SomeTopic' WHERE temp > 60"
description = "example"
actions = [{
s3 = {
bucket_name = "example-bucket"
key = "key.txt"
role_arn = awscc_iam_role.example.arn
}
}]
}
tags = [{
key = "Modified By"
value = "AWSCC"
}]
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down Expand Up @@ -993,4 +1015,4 @@ Import is supported using the following syntax:

```shell
$ terraform import awscc_iot_topic_rule.example <resource ID>
```
```
20 changes: 20 additions & 0 deletions examples/resources/awscc_iot_topic_rule/iot_topic_rule.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
resource "awscc_iot_topic_rule" "example" {
rule_name = "example_rule"
topic_rule_payload = {
sql = "SELECT temp FROM 'SomeTopic' WHERE temp > 60"
description = "example"
actions = [{
s3 = {
bucket_name = "example-bucket"
key = "key.txt"
role_arn = awscc_iam_role.example.arn
}
}]
}

tags = [{
key = "Modified By"
value = "AWSCC"
}]

}
25 changes: 25 additions & 0 deletions templates/resources/iot_topic_rule.md.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}"
subcategory: ""
description: |-
{{ .Description | plainmarkdown | trimspace | prefixlines " " }}
---

# {{.Name}} ({{.Type}})

{{ .Description | trimspace }}

## Example Usage

{{ tffile (printf "examples/resources/%s/iot_topic_rule.tf" .Name)}}

{{ .SchemaMarkdown | trimspace }}
{{- if .HasImport }}

## Import

Import is supported using the following syntax:

{{ codefile "shell" .ImportFile }}

{{- end }}

0 comments on commit cfeae70

Please sign in to comment.