导入
形状验证设置
了解形状验证设置。
No configuration found for ID: 0901c6e67afe18658e0ba985f78397d1a091f1297b0aac577ab3350378659246
1custom: 2... 3 sweetShapes: '["Circle","Square","Triangle"]'
1resources: 2 Resources: 3 ... 4 SweetShapesSecret: 5 Type: 'AWS::SecretsManager::Secret' 6 Properties: 7 Name: ${self:service}-${self:provider.stage}-sweet-shapes 8 SecretString: ${self:custom.sweetShapes}
1service: sweet-factory 2frameworkVersion: "3" 3 4provider: 5 name: aws 6 runtime: nodejs18.x 7 stage: dev 8 region: us-east-1 9 iam: 10 role: 11 statements: 12 - Effect: Allow 13 Action: 14 - dynamodb:GetItem 15 - dynamodb:UpdateItem 16 Resource: 17 - !GetAtt InventoryTable.Arn 18 19functions: 20 ingredientPreparation: 21 handler: handlers/ingredientPreparation.handler 22 environment: 23 INVENTORY_TABLE: ${self:resources.Resources.InventoryTable.Properties.TableName} 24 mixIngredient: 25 handler: handlers/mixIngredient.handler 26 shaping: 27 handler: handlers/shaping.handler 28 29plugins: 30 - serverless-esbuild 31 - serverless-step-functions 32 33stepFunctions: 34 stateMachines: 35 productionLineStateMachine: 36 name: productionLineStateMachine 37 definition: 38 StartAt: IngredientPreparation 39 States: 40 IngredientPreparation: 41 Type: Task 42 Resource: 43 Fn::GetAtt: [ingredientPreparation, Arn] 44 Retry: 45 - ErrorEquals: 46 - States.TaskFailed 47 IntervalSeconds: 10 48 MaxAttempts: 3 49 Next: CheckIngredients 50 CheckIngredients: 51 Type: Choice 52 Choices: 53 - Variable: "$.statusCode" 54 NumericEquals: 200 55 Next: MixingIngredients 56 Default: InsufficientIngredients 57 InsufficientIngredients: 58 Type: Fail 59 Cause: "Insufficient ingredients to proceed with the mixing process." 60 MixingIngredients: 61 Type: Map 62 InputPath: "$.body.ingredients" 63 Iterator: 64 StartAt: MixIngredient 65 States: 66 MixIngredient: 67 Type: Task 68 ResultPath: "$.mixResult" 69 Resource: 70 Fn::GetAtt: [mixIngredient, Arn] 71 Next: WaitForMixing 72 WaitForMixing: 73 Type: Wait 74 SecondsPath: "$.mixResult.body.waitTime" 75 End: true 76 Next: Shaping 77 Shaping: 78 Type: Task 79 Resource: 80 Fn::GetAtt: [shaping, Arn] 81 Retry: 82 - ErrorEquals: 83 - States.TaskFailed 84 IntervalSeconds: 10 85 MaxAttempts: 3 86 End: true 87 88resources: 89 Resources: 90 SweetShapesSecret: 91 Type: "AWS::SecretsManager::Secret" 92 Properties: 93 Name: ${self:service}-${self:provider.stage}-sweet-shapes 94 SecretString: ${self:custom.sweetShapes} 95 InventoryTable: 96 Type: AWS::DynamoDB::Table 97 Properties: 98 TableName: ${self:service}-inventory-${self:provider.stage} 99 AttributeDefinitions: 100 - AttributeName: ingredient 101 AttributeType: S 102 KeySchema: 103 - AttributeName: ingredient 104 KeyType: HASH 105 ProvisionedThroughput: 106 ReadCapacityUnits: 1 107 WriteCapacityUnits: 1 108 109custom: 110 esbuild: 111 bundle: true 112 exclude: [] 113 sweetShapes: '["Circle","Square","Triangle"]'