Skip to content

Commit

Permalink
docs : add example for awscc_stepfunctions_state_machine_version
Browse files Browse the repository at this point in the history
  • Loading branch information
awsdannyc committed Aug 13, 2024
1 parent fca777a commit 9ca6d56
Show file tree
Hide file tree
Showing 3 changed files with 116 additions and 1 deletion.
48 changes: 47 additions & 1 deletion docs/resources/stepfunctions_state_machine_version.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_stepfunctions_state_machine_version Resource - terraform-provider-awscc"
subcategory: ""
description: |-
Expand All @@ -10,7 +9,54 @@ description: |-

Resource schema for StateMachineVersion

## Example Usage
In this example, we create a version of a state machine. The example includes the necessary code to create a basic state machine.
```terraform
resource "awscc_iam_role" "main" {
description = "AWS IAM role for a step function"
assume_role_policy_document = jsonencode({
Version = "2012-10-17"
Statement = [
{
Action = "sts:AssumeRole"
Effect = "Allow"
Sid = ""
Principal = {
Service = "states.amazonaws.com"
}
},
]
})
}
resource "awscc_stepfunctions_state_machine" "sfn_stepmachine" {
role_arn = awscc_iam_role.main.arn
state_machine_type = "STANDARD"
definition_string = <<EOT
{
"StartAt": "FirstState",
"States": {
"FirstState": {
"Type": "Pass",
"Result": "Hello World!",
"End": true
}
}
}
EOT
tags = [
{
key = "Modified By"
value = "AWSCC"
}
]
}
resource "awscc_stepfunctions_state_machine_version" "version" {
description = "State machine version description"
state_machine_arn = awscc_stepfunctions_state_machine.sfn_stepmachine.arn
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
resource "awscc_iam_role" "main" {
description = "AWS IAM role for a step function"
assume_role_policy_document = jsonencode({
Version = "2012-10-17"
Statement = [
{
Action = "sts:AssumeRole"
Effect = "Allow"
Sid = ""
Principal = {
Service = "states.amazonaws.com"
}
},
]
})
}

resource "awscc_stepfunctions_state_machine" "sfn_stepmachine" {
role_arn = awscc_iam_role.main.arn
state_machine_type = "STANDARD"
definition_string = <<EOT
{
"StartAt": "FirstState",
"States": {
"FirstState": {
"Type": "Pass",
"Result": "Hello World!",
"End": true
}
}
}
EOT
tags = [
{
key = "Modified By"
value = "AWSCC"
}
]
}

resource "awscc_stepfunctions_state_machine_version" "version" {
description = "State machine version description"
state_machine_arn = awscc_stepfunctions_state_machine.sfn_stepmachine.arn
}
25 changes: 25 additions & 0 deletions templates/resources/stepfunctions_state_machine_version.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
In this example, we create a version of a state machine. The example includes the necessary code to create a basic state machine.
{{ tffile (printf "examples/resources/%s/stepfunctions_state_machine_version.tf" .Name)}}

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

## Import

Import is supported using the following syntax:

{{ codefile "shell" .ImportFile }}

{{- end }}

0 comments on commit 9ca6d56

Please sign in to comment.