|
| 1 | +[**@cdklabs/generative-ai-cdk-constructs**](../README.md) |
| 2 | + |
| 3 | +*** |
| 4 | + |
| 5 | +[@cdklabs/generative-ai-cdk-constructs](../README.md) / BedrockBatchSfn |
| 6 | + |
| 7 | +# Class: BedrockBatchSfn |
| 8 | + |
| 9 | +A state machine fragment that creates a Bedrock Batch Inference Job and waits for its completion. |
| 10 | + |
| 11 | +Input schema: |
| 12 | +``` |
| 13 | +{ |
| 14 | + "job_name": string, // Required. Name of the batch inference job |
| 15 | + "manifest_keys": string[], // Required. List of S3 keys of the input manifest files |
| 16 | + "model_id": string // Required. Model ID to use. |
| 17 | +} |
| 18 | +``` |
| 19 | + |
| 20 | +Output schema: |
| 21 | +``` |
| 22 | +{ |
| 23 | + "status": string, // Required. Status of the batch job. One of: "Completed" or "PartiallyCompleted" |
| 24 | + "bucket": string, // Required. S3 bucket where the output is stored |
| 25 | + "keys": string[] // Required. Array of S3 keys for the output files |
| 26 | +} |
| 27 | +``` |
| 28 | + |
| 29 | +Error schema: |
| 30 | +``` |
| 31 | +{ |
| 32 | + "status": string, // Required. Status will be one of: "Failed", "Stopped", or "Expired" |
| 33 | + "error": string, // Required. Error code |
| 34 | + "cause": string // Required. Error message |
| 35 | +} |
| 36 | +``` |
| 37 | + |
| 38 | +## Extends |
| 39 | + |
| 40 | +- `StateMachineFragment` |
| 41 | + |
| 42 | +## Constructors |
| 43 | + |
| 44 | +### new BedrockBatchSfn() |
| 45 | + |
| 46 | +> **new BedrockBatchSfn**(`parent`, `id`, `props`): [`BedrockBatchSfn`](BedrockBatchSfn.md) |
| 47 | +
|
| 48 | +#### Parameters |
| 49 | + |
| 50 | +##### parent |
| 51 | + |
| 52 | +`Construct` |
| 53 | + |
| 54 | +##### id |
| 55 | + |
| 56 | +`string` |
| 57 | + |
| 58 | +##### props |
| 59 | + |
| 60 | +[`BedrockBatchSfnProps`](../interfaces/BedrockBatchSfnProps.md) |
| 61 | + |
| 62 | +#### Returns |
| 63 | + |
| 64 | +[`BedrockBatchSfn`](BedrockBatchSfn.md) |
| 65 | + |
| 66 | +#### Overrides |
| 67 | + |
| 68 | +`sfn.StateMachineFragment.constructor` |
| 69 | + |
| 70 | +## Properties |
| 71 | + |
| 72 | +### endStates |
| 73 | + |
| 74 | +> `readonly` **endStates**: `INextable`[] |
| 75 | +
|
| 76 | +The states to chain onto if this fragment is used |
| 77 | + |
| 78 | +#### Overrides |
| 79 | + |
| 80 | +`sfn.StateMachineFragment.endStates` |
| 81 | + |
| 82 | +*** |
| 83 | + |
| 84 | +### node |
| 85 | + |
| 86 | +> `readonly` **node**: `Node` |
| 87 | +
|
| 88 | +The tree node. |
| 89 | + |
| 90 | +#### Inherited from |
| 91 | + |
| 92 | +`sfn.StateMachineFragment.node` |
| 93 | + |
| 94 | +*** |
| 95 | + |
| 96 | +### startState |
| 97 | + |
| 98 | +> `readonly` **startState**: `State` |
| 99 | +
|
| 100 | +The start state of this state machine fragment |
| 101 | + |
| 102 | +#### Overrides |
| 103 | + |
| 104 | +`sfn.StateMachineFragment.startState` |
| 105 | + |
| 106 | +## Accessors |
| 107 | + |
| 108 | +### id |
| 109 | + |
| 110 | +#### Get Signature |
| 111 | + |
| 112 | +> **get** **id**(): `string` |
| 113 | +
|
| 114 | +Descriptive identifier for this chainable |
| 115 | + |
| 116 | +##### Returns |
| 117 | + |
| 118 | +`string` |
| 119 | + |
| 120 | +#### Inherited from |
| 121 | + |
| 122 | +`sfn.StateMachineFragment.id` |
| 123 | + |
| 124 | +## Methods |
| 125 | + |
| 126 | +### next() |
| 127 | + |
| 128 | +> **next**(`next`): `Chain` |
| 129 | +
|
| 130 | +Continue normal execution with the given state |
| 131 | + |
| 132 | +#### Parameters |
| 133 | + |
| 134 | +##### next |
| 135 | + |
| 136 | +`IChainable` |
| 137 | + |
| 138 | +#### Returns |
| 139 | + |
| 140 | +`Chain` |
| 141 | + |
| 142 | +#### Inherited from |
| 143 | + |
| 144 | +`sfn.StateMachineFragment.next` |
| 145 | + |
| 146 | +*** |
| 147 | + |
| 148 | +### prefixStates() |
| 149 | + |
| 150 | +> **prefixStates**(`prefix`?): `StateMachineFragment` |
| 151 | +
|
| 152 | +Prefix the IDs of all states in this state machine fragment |
| 153 | + |
| 154 | +Use this to avoid multiple copies of the state machine all having the |
| 155 | +same state IDs. |
| 156 | + |
| 157 | +#### Parameters |
| 158 | + |
| 159 | +##### prefix? |
| 160 | + |
| 161 | +`string` |
| 162 | + |
| 163 | +The prefix to add. Will use construct ID by default. |
| 164 | + |
| 165 | +#### Returns |
| 166 | + |
| 167 | +`StateMachineFragment` |
| 168 | + |
| 169 | +#### Inherited from |
| 170 | + |
| 171 | +`sfn.StateMachineFragment.prefixStates` |
| 172 | + |
| 173 | +*** |
| 174 | + |
| 175 | +### toSingleState() |
| 176 | + |
| 177 | +> **toSingleState**(`options`?): `Parallel` |
| 178 | +
|
| 179 | +Wrap all states in this state machine fragment up into a single state. |
| 180 | + |
| 181 | +This can be used to add retry or error handling onto this state |
| 182 | +machine fragment. |
| 183 | + |
| 184 | +Be aware that this changes the result of the inner state machine |
| 185 | +to be an array with the result of the state machine in it. Adjust |
| 186 | +your paths accordingly. For example, change 'outputPath' to |
| 187 | +'$[0]'. |
| 188 | + |
| 189 | +#### Parameters |
| 190 | + |
| 191 | +##### options? |
| 192 | + |
| 193 | +`SingleStateOptions` |
| 194 | + |
| 195 | +#### Returns |
| 196 | + |
| 197 | +`Parallel` |
| 198 | + |
| 199 | +#### Inherited from |
| 200 | + |
| 201 | +`sfn.StateMachineFragment.toSingleState` |
| 202 | + |
| 203 | +*** |
| 204 | + |
| 205 | +### toString() |
| 206 | + |
| 207 | +> **toString**(): `string` |
| 208 | +
|
| 209 | +Returns a string representation of this construct. |
| 210 | + |
| 211 | +#### Returns |
| 212 | + |
| 213 | +`string` |
| 214 | + |
| 215 | +#### Inherited from |
| 216 | + |
| 217 | +`sfn.StateMachineFragment.toString` |
| 218 | + |
| 219 | +*** |
| 220 | + |
| 221 | +### isConstruct() |
| 222 | + |
| 223 | +> `static` **isConstruct**(`x`): `x is Construct` |
| 224 | +
|
| 225 | +Checks if `x` is a construct. |
| 226 | + |
| 227 | +Use this method instead of `instanceof` to properly detect `Construct` |
| 228 | +instances, even when the construct library is symlinked. |
| 229 | + |
| 230 | +Explanation: in JavaScript, multiple copies of the `constructs` library on |
| 231 | +disk are seen as independent, completely different libraries. As a |
| 232 | +consequence, the class `Construct` in each copy of the `constructs` library |
| 233 | +is seen as a different class, and an instance of one class will not test as |
| 234 | +`instanceof` the other class. `npm install` will not create installations |
| 235 | +like this, but users may manually symlink construct libraries together or |
| 236 | +use a monorepo tool: in those cases, multiple copies of the `constructs` |
| 237 | +library can be accidentally installed, and `instanceof` will behave |
| 238 | +unpredictably. It is safest to avoid using `instanceof`, and using |
| 239 | +this type-testing method instead. |
| 240 | + |
| 241 | +#### Parameters |
| 242 | + |
| 243 | +##### x |
| 244 | + |
| 245 | +`any` |
| 246 | + |
| 247 | +Any object |
| 248 | + |
| 249 | +#### Returns |
| 250 | + |
| 251 | +`x is Construct` |
| 252 | + |
| 253 | +true if `x` is an object created from a class which extends `Construct`. |
| 254 | + |
| 255 | +#### Inherited from |
| 256 | + |
| 257 | +`sfn.StateMachineFragment.isConstruct` |
0 commit comments