Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs : add example for awscc_stepfunctions_state_machine_version #1957

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 }}