File tree Expand file tree Collapse file tree 4 files changed +110
-89
lines changed
internal/service/sfn/testdata/StateMachine Expand file tree Collapse file tree 4 files changed +110
-89
lines changed Original file line number Diff line number Diff line change 1
1
# Copyright (c) HashiCorp, Inc.
2
2
# SPDX-License-Identifier: MPL-2.0
3
3
4
+ resource "aws_sfn_state_machine" "test" {
5
+ name = var. rName
6
+ role_arn = aws_iam_role. for_sfn . arn
7
+
8
+ definition = << EOF
9
+ {
10
+ "Comment": "A Hello World example of the Amazon States Language using an AWS Lambda Function",
11
+ "StartAt": "HelloWorld",
12
+ "States": {
13
+ "HelloWorld": {
14
+ "Type": "Task",
15
+ "Resource": "${ aws_lambda_function . test . arn } ",
16
+ "Retry": [
17
+ {
18
+ "ErrorEquals": [
19
+ "States.ALL"
20
+ ],
21
+ "IntervalSeconds": 5,
22
+ "MaxAttempts": 5,
23
+ "BackoffRate": 8
24
+ }
25
+ ],
26
+ "End": true
27
+ }
28
+ }
29
+ }
30
+ EOF
31
+ }
32
+
4
33
resource "aws_iam_role_policy" "for_lambda" {
5
34
name = " ${ var . rName } -lambda"
6
35
role = aws_iam_role. for_lambda . id
@@ -98,35 +127,6 @@ resource "aws_iam_role" "for_sfn" {
98
127
}
99
128
EOF
100
129
}
101
-
102
- resource "aws_sfn_state_machine" "test" {
103
- name = var. rName
104
- role_arn = aws_iam_role. for_sfn . arn
105
-
106
- definition = << EOF
107
- {
108
- "Comment": "A Hello World example of the Amazon States Language using an AWS Lambda Function",
109
- "StartAt": "HelloWorld",
110
- "States": {
111
- "HelloWorld": {
112
- "Type": "Task",
113
- "Resource": "${ aws_lambda_function . test . arn } ",
114
- "Retry": [
115
- {
116
- "ErrorEquals": [
117
- "States.ALL"
118
- ],
119
- "IntervalSeconds": 5,
120
- "MaxAttempts": 5,
121
- "BackoffRate": 8
122
- }
123
- ],
124
- "End": true
125
- }
126
- }
127
- }
128
- EOF
129
- }
130
130
variable "rName" {
131
131
description = " Name for resource"
132
132
type = string
Original file line number Diff line number Diff line change 1
1
# Copyright (c) HashiCorp, Inc.
2
2
# SPDX-License-Identifier: MPL-2.0
3
3
4
+ resource "aws_sfn_state_machine" "test" {
5
+ name = var. rName
6
+ role_arn = aws_iam_role. for_sfn . arn
7
+
8
+ definition = << EOF
9
+ {
10
+ "Comment": "A Hello World example of the Amazon States Language using an AWS Lambda Function",
11
+ "StartAt": "HelloWorld",
12
+ "States": {
13
+ "HelloWorld": {
14
+ "Type": "Task",
15
+ "Resource": "${ aws_lambda_function . test . arn } ",
16
+ "Retry": [
17
+ {
18
+ "ErrorEquals": [
19
+ "States.ALL"
20
+ ],
21
+ "IntervalSeconds": 5,
22
+ "MaxAttempts": 5,
23
+ "BackoffRate": 8
24
+ }
25
+ ],
26
+ "End": true
27
+ }
28
+ }
29
+ }
30
+ EOF
31
+ }
32
+
4
33
resource "aws_iam_role_policy" "for_lambda" {
5
34
name = " ${ var . rName } -lambda"
6
35
role = aws_iam_role. for_lambda . id
@@ -98,35 +127,6 @@ resource "aws_iam_role" "for_sfn" {
98
127
}
99
128
EOF
100
129
}
101
-
102
- resource "aws_sfn_state_machine" "test" {
103
- name = var. rName
104
- role_arn = aws_iam_role. for_sfn . arn
105
-
106
- definition = << EOF
107
- {
108
- "Comment": "A Hello World example of the Amazon States Language using an AWS Lambda Function",
109
- "StartAt": "HelloWorld",
110
- "States": {
111
- "HelloWorld": {
112
- "Type": "Task",
113
- "Resource": "${ aws_lambda_function . test . arn } ",
114
- "Retry": [
115
- {
116
- "ErrorEquals": [
117
- "States.ALL"
118
- ],
119
- "IntervalSeconds": 5,
120
- "MaxAttempts": 5,
121
- "BackoffRate": 8
122
- }
123
- ],
124
- "End": true
125
- }
126
- }
127
- }
128
- EOF
129
- }
130
130
variable "rName" {
131
131
description = " Name for resource"
132
132
type = string
Original file line number Diff line number Diff line change 1
1
# Copyright (c) HashiCorp, Inc.
2
2
# SPDX-License-Identifier: MPL-2.0
3
3
4
+ resource "aws_sfn_state_machine" "test" {
5
+ region = var. region
6
+
7
+ name = var. rName
8
+ role_arn = aws_iam_role. for_sfn . arn
9
+
10
+ definition = << EOF
11
+ {
12
+ "Comment": "A Hello World example of the Amazon States Language using an AWS Lambda Function",
13
+ "StartAt": "HelloWorld",
14
+ "States": {
15
+ "HelloWorld": {
16
+ "Type": "Task",
17
+ "Resource": "${ aws_lambda_function . test . arn } ",
18
+ "Retry": [
19
+ {
20
+ "ErrorEquals": [
21
+ "States.ALL"
22
+ ],
23
+ "IntervalSeconds": 5,
24
+ "MaxAttempts": 5,
25
+ "BackoffRate": 8
26
+ }
27
+ ],
28
+ "End": true
29
+ }
30
+ }
31
+ }
32
+ EOF
33
+ }
34
+
4
35
resource "aws_iam_role_policy" "for_lambda" {
5
36
name = " ${ var . rName } -lambda"
6
37
role = aws_iam_role. for_lambda . id
@@ -102,37 +133,6 @@ resource "aws_iam_role" "for_sfn" {
102
133
}
103
134
EOF
104
135
}
105
-
106
- resource "aws_sfn_state_machine" "test" {
107
- region = var. region
108
-
109
- name = var. rName
110
- role_arn = aws_iam_role. for_sfn . arn
111
-
112
- definition = << EOF
113
- {
114
- "Comment": "A Hello World example of the Amazon States Language using an AWS Lambda Function",
115
- "StartAt": "HelloWorld",
116
- "States": {
117
- "HelloWorld": {
118
- "Type": "Task",
119
- "Resource": "${ aws_lambda_function . test . arn } ",
120
- "Retry": [
121
- {
122
- "ErrorEquals": [
123
- "States.ALL"
124
- ],
125
- "IntervalSeconds": 5,
126
- "MaxAttempts": 5,
127
- "BackoffRate": 8
128
- }
129
- ],
130
- "End": true
131
- }
132
- }
133
- }
134
- EOF
135
- }
136
136
variable "rName" {
137
137
description = " Name for resource"
138
138
type = string
Original file line number Diff line number Diff line change @@ -209,6 +209,27 @@ This resource exports the following attributes in addition to the arguments abov
209
209
210
210
## Import
211
211
212
+ In Terraform v1.12.0 and later, the [ ` import ` block] ( https://developer.hashicorp.com/terraform/language/import ) can be used with the ` identity ` attribute. For example:
213
+
214
+ ``` terraform
215
+ import {
216
+ to = aws_sfn_state_machine.example
217
+ identity = {
218
+ "arn" = "arn:aws:states:us-east-1:123456789012:stateMachine:MyWorkflow-2024-09-17-a7b3c8f1"
219
+ }
220
+ }
221
+
222
+ resource "aws_sfn_state_machine" "example" {
223
+ ### Configuration omitted for brevity ###
224
+ }
225
+ ```
226
+
227
+ ### Identity Schema
228
+
229
+ #### Required
230
+
231
+ - ` arn ` (String) ARN of the certificate.
232
+
212
233
In Terraform v1.5.0 and later, use an [ ` import ` block] ( https://developer.hashicorp.com/terraform/language/import ) to import State Machines using the ` arn ` . For example:
213
234
214
235
``` terraform
You can’t perform that action at this time.
0 commit comments