From 9ca6d562a87935737d103fc56784c3e1cd4011bb Mon Sep 17 00:00:00 2001 From: Danny Cartagena Date: Tue, 13 Aug 2024 11:34:31 -0500 Subject: [PATCH] docs : add example for awscc_stepfunctions_state_machine_version --- .../stepfunctions_state_machine_version.md | 48 ++++++++++++++++++- .../stepfunctions_state_machine_version.tf | 44 +++++++++++++++++ ...tepfunctions_state_machine_version.md.tmpl | 25 ++++++++++ 3 files changed, 116 insertions(+), 1 deletion(-) create mode 100644 examples/resources/awscc_stepfunctions_state_machine_version/stepfunctions_state_machine_version.tf create mode 100644 templates/resources/stepfunctions_state_machine_version.md.tmpl diff --git a/docs/resources/stepfunctions_state_machine_version.md b/docs/resources/stepfunctions_state_machine_version.md index 193399652..fab72177e 100644 --- a/docs/resources/stepfunctions_state_machine_version.md +++ b/docs/resources/stepfunctions_state_machine_version.md @@ -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: |- @@ -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 = < ## Schema diff --git a/examples/resources/awscc_stepfunctions_state_machine_version/stepfunctions_state_machine_version.tf b/examples/resources/awscc_stepfunctions_state_machine_version/stepfunctions_state_machine_version.tf new file mode 100644 index 000000000..adeb3dec2 --- /dev/null +++ b/examples/resources/awscc_stepfunctions_state_machine_version/stepfunctions_state_machine_version.tf @@ -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 = <