@@ -98,31 +98,31 @@ public TheStateMachineStack(final Construct scope, final String id, final StackP
98
98
99
99
// We need to give our HTTP API permission to invoke our step function
100
100
Role httpApiRole = new Role (this , "HttpApiRole" , new RoleProps .Builder ()
101
- .assumedBy (new ServicePrincipal ("apigateway.amazonaws.com" ))
102
- .inlinePolicies (Map .of ("AllowSFNExec" , new PolicyDocument (
103
- new PolicyDocumentProps .Builder ()
104
- .statements (List .of (new PolicyStatement (
105
- new PolicyStatementProps .Builder ()
106
- .effect (Effect .ALLOW )
107
- .resources (List .of (stateMachine .getStateMachineArn ()))
108
- .actions (List .of ("states:StartSyncExecution" ))
109
- .build ())))
110
- .build ())))
111
- .build ());
101
+ .assumedBy (new ServicePrincipal ("apigateway.amazonaws.com" ))
102
+ .inlinePolicies (Map .of ("AllowSFNExec" , new PolicyDocument (
103
+ new PolicyDocumentProps .Builder ()
104
+ .statements (List .of (new PolicyStatement (
105
+ new PolicyStatementProps .Builder ()
106
+ .effect (Effect .ALLOW )
107
+ .resources (List .of (stateMachine .getStateMachineArn ()))
108
+ .actions (List .of ("states:StartSyncExecution" ))
109
+ .build ())))
110
+ .build ())))
111
+ .build ());
112
112
113
113
HttpApi api = new HttpApi (this , "TheStateMachineAPI" , new HttpApiProps .Builder ().createDefaultStage (true ).build ());
114
114
115
115
CfnIntegration integration = new CfnIntegration (this , "Integration" , new CfnIntegrationProps .Builder ()
116
- .apiId (api .getHttpApiId ())
117
- .integrationType ("AWS_PROXY" )
118
- .connectionType ("INTERNET" )
119
- .integrationSubtype ("StepFunctions-StartSyncExecution" )
120
- .credentialsArn (httpApiRole .getRoleArn ())
121
- .requestParameters (Map .of ("Input" ,"$request.body" ,
122
- "StateMachineArn" ,stateMachine .getStateMachineArn ()))
123
- .payloadFormatVersion ("1.0" )
124
- .timeoutInMillis (10000 )
125
- .build ());
116
+ .apiId (api .getHttpApiId ())
117
+ .integrationType ("AWS_PROXY" )
118
+ .connectionType ("INTERNET" )
119
+ .integrationSubtype ("StepFunctions-StartSyncExecution" )
120
+ .credentialsArn (httpApiRole .getRoleArn ())
121
+ .requestParameters (Map .of ("Input" ,"$request.body" ,
122
+ "StateMachineArn" ,stateMachine .getStateMachineArn ()))
123
+ .payloadFormatVersion ("1.0" )
124
+ .timeoutInMillis (10000 )
125
+ .build ());
126
126
127
127
new CfnRoute (this , "DefaultRoute" , new CfnRouteProps .Builder ()
128
128
.apiId (api .getHttpApiId ())
0 commit comments