|
144 | 144 | ],
|
145 | 145 | "UpdateReplacePolicy": "Delete",
|
146 | 146 | "DeletionPolicy": "Delete"
|
| 147 | + }, |
| 148 | + "LlamaStateMachineRoleA1E51172": { |
| 149 | + "Type": "AWS::IAM::Role", |
| 150 | + "Properties": { |
| 151 | + "AssumeRolePolicyDocument": { |
| 152 | + "Statement": [ |
| 153 | + { |
| 154 | + "Action": "sts:AssumeRole", |
| 155 | + "Effect": "Allow", |
| 156 | + "Principal": { |
| 157 | + "Service": "states.amazonaws.com" |
| 158 | + } |
| 159 | + } |
| 160 | + ], |
| 161 | + "Version": "2012-10-17" |
| 162 | + } |
| 163 | + } |
| 164 | + }, |
| 165 | + "LlamaStateMachineRoleDefaultPolicy36666B63": { |
| 166 | + "Type": "AWS::IAM::Policy", |
| 167 | + "Properties": { |
| 168 | + "PolicyDocument": { |
| 169 | + "Statement": [ |
| 170 | + { |
| 171 | + "Action": "bedrock:InvokeModel", |
| 172 | + "Effect": "Allow", |
| 173 | + "Resource": [ |
| 174 | + { |
| 175 | + "Fn::Join": [ |
| 176 | + "", |
| 177 | + [ |
| 178 | + "arn:", |
| 179 | + { |
| 180 | + "Ref": "AWS::Partition" |
| 181 | + }, |
| 182 | + ":bedrock:", |
| 183 | + { |
| 184 | + "Ref": "AWS::Region" |
| 185 | + }, |
| 186 | + "::foundation-model/meta.llama3-2-11b-instruct-v1:0" |
| 187 | + ] |
| 188 | + ] |
| 189 | + }, |
| 190 | + { |
| 191 | + "Fn::Join": [ |
| 192 | + "", |
| 193 | + [ |
| 194 | + "arn:", |
| 195 | + { |
| 196 | + "Ref": "AWS::Partition" |
| 197 | + }, |
| 198 | + ":bedrock:", |
| 199 | + { |
| 200 | + "Ref": "AWS::Region" |
| 201 | + }, |
| 202 | + "::foundation-model/meta.llama3-2-1b-instruct-v1:0" |
| 203 | + ] |
| 204 | + ] |
| 205 | + }, |
| 206 | + { |
| 207 | + "Fn::Join": [ |
| 208 | + "", |
| 209 | + [ |
| 210 | + "arn:", |
| 211 | + { |
| 212 | + "Ref": "AWS::Partition" |
| 213 | + }, |
| 214 | + ":bedrock:", |
| 215 | + { |
| 216 | + "Ref": "AWS::Region" |
| 217 | + }, |
| 218 | + "::foundation-model/meta.llama3-2-3b-instruct-v1:0" |
| 219 | + ] |
| 220 | + ] |
| 221 | + }, |
| 222 | + { |
| 223 | + "Fn::Join": [ |
| 224 | + "", |
| 225 | + [ |
| 226 | + "arn:", |
| 227 | + { |
| 228 | + "Ref": "AWS::Partition" |
| 229 | + }, |
| 230 | + ":bedrock:", |
| 231 | + { |
| 232 | + "Ref": "AWS::Region" |
| 233 | + }, |
| 234 | + "::foundation-model/meta.llama3-2-90b-instruct-v1:0" |
| 235 | + ] |
| 236 | + ] |
| 237 | + } |
| 238 | + ] |
| 239 | + }, |
| 240 | + { |
| 241 | + "Action": [ |
| 242 | + "s3:GetObject", |
| 243 | + "s3:PutObject" |
| 244 | + ], |
| 245 | + "Effect": "Allow", |
| 246 | + "Resource": { |
| 247 | + "Fn::Join": [ |
| 248 | + "", |
| 249 | + [ |
| 250 | + "arn:", |
| 251 | + { |
| 252 | + "Ref": "AWS::Partition" |
| 253 | + }, |
| 254 | + ":s3:::*" |
| 255 | + ] |
| 256 | + ] |
| 257 | + } |
| 258 | + } |
| 259 | + ], |
| 260 | + "Version": "2012-10-17" |
| 261 | + }, |
| 262 | + "PolicyName": "LlamaStateMachineRoleDefaultPolicy36666B63", |
| 263 | + "Roles": [ |
| 264 | + { |
| 265 | + "Ref": "LlamaStateMachineRoleA1E51172" |
| 266 | + } |
| 267 | + ] |
| 268 | + } |
| 269 | + }, |
| 270 | + "LlamaStateMachineD0B74BA3": { |
| 271 | + "Type": "AWS::StepFunctions::StateMachine", |
| 272 | + "Properties": { |
| 273 | + "DefinitionString": { |
| 274 | + "Fn::Join": [ |
| 275 | + "", |
| 276 | + [ |
| 277 | + "{\"StartAt\":\"LlamaPrompt1\",\"States\":{\"LlamaPrompt1\":{\"Next\":\"LlamaPrompt2\",\"Type\":\"Task\",\"ResultPath\":\"$\",\"ResultSelector\":{\"names.$\":\"$.Body.results[0].outputText\"},\"Resource\":\"arn:", |
| 278 | + { |
| 279 | + "Ref": "AWS::Partition" |
| 280 | + }, |
| 281 | + ":states:::bedrock:invokeModel\",\"Parameters\":{\"ModelId\":\"arn:", |
| 282 | + { |
| 283 | + "Ref": "AWS::Partition" |
| 284 | + }, |
| 285 | + ":bedrock:", |
| 286 | + { |
| 287 | + "Ref": "AWS::Region" |
| 288 | + }, |
| 289 | + "::foundation-model/meta.llama3-2-1b-instruct-v1:0\",\"Body\":{\"inputText\":\"Generate a list of five first names.\",\"textGenerationConfig\":{\"maxTokenCount\":100,\"temperature\":1}}}},\"LlamaPrompt2\":{\"Next\":\"LlamaPrompt3\",\"Type\":\"Task\",\"ResultPath\":\"$\",\"ResultSelector\":{\"names.$\":\"$.Body.results[0].outputText\"},\"Resource\":\"arn:", |
| 290 | + { |
| 291 | + "Ref": "AWS::Partition" |
| 292 | + }, |
| 293 | + ":states:::bedrock:invokeModel\",\"Parameters\":{\"ModelId\":\"arn:", |
| 294 | + { |
| 295 | + "Ref": "AWS::Partition" |
| 296 | + }, |
| 297 | + ":bedrock:", |
| 298 | + { |
| 299 | + "Ref": "AWS::Region" |
| 300 | + }, |
| 301 | + "::foundation-model/meta.llama3-2-3b-instruct-v1:0\",\"Body\":{\"inputText.$\":\"States.Format('Alphabetize this list of first names:/n{}', $.names)\",\"textGenerationConfig\":{\"maxTokenCount\":100,\"temperature\":1}}}},\"LlamaPrompt3\":{\"Next\":\"LlamaPrompt4\",\"Type\":\"Task\",\"OutputPath\":\"$.Body.results[0].outputText\",\"Resource\":\"arn:", |
| 302 | + { |
| 303 | + "Ref": "AWS::Partition" |
| 304 | + }, |
| 305 | + ":states:::bedrock:invokeModel\",\"Parameters\":{\"ModelId\":\"arn:", |
| 306 | + { |
| 307 | + "Ref": "AWS::Partition" |
| 308 | + }, |
| 309 | + ":bedrock:", |
| 310 | + { |
| 311 | + "Ref": "AWS::Region" |
| 312 | + }, |
| 313 | + "::foundation-model/meta.llama3-2-11b-instruct-v1:0\",\"Body\":{\"inputText.$\":\"States.Format('Echo list of first names: {}', $.names)\",\"textGenerationConfig\":{\"maxTokenCount\":100,\"temperature\":1}}}},\"LlamaPrompt4\":{\"End\":true,\"Type\":\"Task\",\"Resource\":\"arn:", |
| 314 | + { |
| 315 | + "Ref": "AWS::Partition" |
| 316 | + }, |
| 317 | + ":states:::bedrock:invokeModel\",\"Parameters\":{\"ModelId\":\"arn:", |
| 318 | + { |
| 319 | + "Ref": "AWS::Partition" |
| 320 | + }, |
| 321 | + ":bedrock:", |
| 322 | + { |
| 323 | + "Ref": "AWS::Region" |
| 324 | + }, |
| 325 | + "::foundation-model/meta.llama3-2-90b-instruct-v1:0\",\"Input\":{\"S3Uri\":\"$.names\"},\"Output\":{\"S3Uri\":\"$.names\"}}}},\"TimeoutSeconds\":30}" |
| 326 | + ] |
| 327 | + ] |
| 328 | + }, |
| 329 | + "RoleArn": { |
| 330 | + "Fn::GetAtt": [ |
| 331 | + "LlamaStateMachineRoleA1E51172", |
| 332 | + "Arn" |
| 333 | + ] |
| 334 | + } |
| 335 | + }, |
| 336 | + "DependsOn": [ |
| 337 | + "LlamaStateMachineRoleDefaultPolicy36666B63", |
| 338 | + "LlamaStateMachineRoleA1E51172" |
| 339 | + ], |
| 340 | + "UpdateReplacePolicy": "Delete", |
| 341 | + "DeletionPolicy": "Delete" |
147 | 342 | }
|
148 | 343 | },
|
149 | 344 | "Parameters": {
|
|
0 commit comments