diff --git a/docs/resources/iot_topic_rule.md b/docs/resources/iot_topic_rule.md index 714cf06037..c73f04ba6f 100644 --- a/docs/resources/iot_topic_rule.md +++ b/docs/resources/iot_topic_rule.md @@ -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: |- @@ -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 @@ -993,4 +1015,4 @@ Import is supported using the following syntax: ```shell $ terraform import awscc_iot_topic_rule.example -``` +``` \ No newline at end of file diff --git a/examples/resources/awscc_iot_topic_rule/iot_topic_rule.tf b/examples/resources/awscc_iot_topic_rule/iot_topic_rule.tf new file mode 100644 index 0000000000..863fd4eb3b --- /dev/null +++ b/examples/resources/awscc_iot_topic_rule/iot_topic_rule.tf @@ -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" + }] + +} \ No newline at end of file diff --git a/templates/resources/iot_topic_rule.md.tmpl b/templates/resources/iot_topic_rule.md.tmpl new file mode 100644 index 0000000000..c68a6fbe97 --- /dev/null +++ b/templates/resources/iot_topic_rule.md.tmpl @@ -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 }} \ No newline at end of file