【问题标题】:I am getting error while building aws cdk rds **Stack failed: ValidationError: Given input did not match expected format构建 aws cdk rds 时出现错误 **Stack failed: ValidationError: Given input does not match expected format
【发布时间】:2020-06-21 15:15:36
【问题描述】:

我在使用 typescript 语言构建 rds 实例时遇到错误: 错误 : '{ engine: DatabaseInstanceEngine; 类型的参数VPC:VPC; vpcPlacement:{子网类型:SubnetType.ISOLATED; };存储加密:真;多AZ:假;自动次要版本升级:假; ... 8 更多 ...;端口:号码; }' 不可分配给“DatabaseInstanceProps”类型的参数。对象字面量只能指定已知属性,而“DatabaseInstanceProps”类型中不存在“instanceClass”。

enter image description here

【问题讨论】:

    标签: typescript amazon-web-services amazon-rds aws-cdk


    【解决方案1】:

    您似乎使用了错误类型的属性。尝试将数据库实例属性中的属性instanceClass 替换为instanceType

    这是documentation 供您参考。

    【讨论】:

    • 工作!感谢@Dennis,但在构建和部署后它给了我错误:RDSStack failed: ValidationError: Given input does not match expected format Given input does not match expected format
    • 错误究竟发生在哪里,您尝试过什么解决方法?如果它解决了您最初的问题,请接受我的回答。
    • 我刚刚用instancetype改变了instanceclass。我已经接受了答案,但由于我没有足够的徽章,所以它仍在审核中。
    • 我能够成功构建它们但无法合成(cdk synth RDSStack)。我尝试再添加一个变量,但结果相同。
    猜你喜欢
    • 2015-08-03
    • 2022-12-05
    • 1970-01-01
    • 2013-05-14
    • 2022-12-14
    • 2022-10-13
    • 2021-07-12
    • 1970-01-01
    相关资源
    最近更新 更多