部署堆栈时,在创建密钥和证书时出现错误。

0

【以下的问题经过翻译处理】 我正在按照官方教程:https://aws.amazon.com/de/blogs/iot/building-an-ocpp-compliant-electric-vehicle-charge-point-operator-solution-using-aws-iot-core/ 进行操作,直到需要通过npx cdk deploy部署解决方案时出了问题。

一段时间后,我收到以下错误消息:

15:27:55 | CREATE_FAILED        | Custom::AWS                                 | CreateKeysAndCertificate4D276FB5

Response object is too long.

15:28:02 | DELETE_FAILED        | Custom::AWS                                 | CreateKeysAndCertificate4D276FB5

Received response status [FAILED] from custom resource. Message returned: 2 validation errors detected: Value 'AwsOcppGatewayStack-CreateKeysAndCertificate4D276FB5-4OE0BIJZDROY' at 'certifi
cateId' failed to satisfy constraint: Member must satisfy regular expression pattern: (0x)?[a-fA-F0-9]+; Value 'AwsOcppGatewayStack-CreateKeysAndCertificate4D276FB5-4OE0BIJZDROY' at 'certif
icateId' failed to satisfy constraint: Member must have length less than or equal to 64 (RequestId: 083d3d06-5e9a-420a-9f49-abd4f86d192e)


 ❌  AwsOcppGatewayStack failed: Error: The stack named AwsOcppGatewayStack failed creation, it may need to be manually deleted from the AWS console: ROLLBACK_FAILED (The following resource(s) failed to delete: [CreateKeysAndCertificate4D276FB5]. ): Response object is too long., Received response status [FAILED] from custom resource. Message returned: 2 validation errors detected: Value 'AwsOcppGatewayStack-CreateKeysAndCertificate4D276FB5-4OE0BIJZDROY' at 'certificateId' failed to satisfy constraint: Member must satisfy regular expression pattern: (0x)?[a-fA-F0-9]+; Value 'AwsOcppGatewayStack-CreateKeysAndCertificate4D276FB5-4OE0BIJZDROY' at 'certificateId' failed to satisfy constraint: Member must have length less than or equal to 64 (RequestId: 083d3d06-5e9a-420a-9f49-abd4f86d192e)
    at FullCloudFormationDeployment.monitorDeployment (/Users/martinseubert/.npm/_npx/e72b144743208263/node_modules/aws-cdk/lib/index.js:380:10236)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async deployStack2 (/Users/martinseubert/.npm/_npx/e72b144743208263/node_modules/aws-cdk/lib/index.js:383:145458)
    at async /Users/martinseubert/.npm/_npx/e72b144743208263/node_modules/aws-cdk/lib/index.js:383:128776
    at async run (/Users/martinseubert/.npm/_npx/e72b144743208263/node_modules/aws-cdk/lib/index.js:383:126782)

 ❌ Deployment failed: Error: Stack Deployments Failed: Error: The stack named AwsOcppGatewayStack failed creation, it may need to be manually deleted from the AWS console: ROLLBACK_FAILED (The following resource(s) failed to delete: [CreateKeysAndCertificate4D276FB5]. ): Response object is too long., Received response status [FAILED] from custom resource. Message returned: 2 validation errors detected: Value 'AwsOcppGatewayStack-CreateKeysAndCertificate4D276FB5-4OE0BIJZDROY' at 'certificateId' failed to satisfy constraint: Member must satisfy regular expression pattern: (0x)?[a-fA-F0-9]+; Value 'AwsOcppGatewayStack-CreateKeysAndCertificate4D276FB5-4OE0BIJZDROY' at 'certificateId' failed to satisfy constraint: Member must have length less than or equal to 64 (RequestId: 083d3d06-5e9a-420a-9f49-abd4f86d192e)
    at deployStacks (/Users/martinseubert/.npm/_npx/e72b144743208263/node_modules/aws-cdk/lib/index.js:383:129083)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async CdkToolkit.deploy (/Users/martinseubert/.npm/_npx/e72b144743208263/node_modules/aws-cdk/lib/index.js:383:147507)
    at async exec4 (/Users/martinseubert/.npm/_npx/e72b144743208263/node_modules/aws-cdk/lib/index.js:438:51799)

Stack Deployments Failed: Error: The stack named AwsOcppGatewayStack failed creation, it may need to be manually deleted from the AWS console: ROLLBACK_FAILED (The following resource(s) failed to delete: [CreateKeysAndCertificate4D276FB5]. ): Response object is too long., Received response status [FAILED] from custom resource. Message returned: 2 validation errors detected: Value 'AwsOcppGatewayStack-CreateKeysAndCertificate4D276FB5-4OE0BIJZDROY' at 'certificateId' failed to satisfy constraint: Member must satisfy regular expression pattern: (0x)?[a-fA-F0-9]+; Value 'AwsOcppGatewayStack-CreateKeysAndCertificate4D276FB5-4OE0BIJZDROY' at 'certificateId' failed to satisfy constraint: Member must have length less than or equal to 64 (RequestId: 083d3d06-5e9a-420a-9f49-abd4f86d192e)

这里有可能是哪里出问题了?

1 回答
0

【以下的回答经过翻译处理】 通过在函数中添加outputPaths: ["certificateArn", "certificatePem", "keyPair.PublicKey", "keyPair.PrivateKey"]解决了它。

profile picture
专家
已回答 5 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则