typescript - CDK - 无法使用 scaleOnCpuUtilization
问题描述
我正在尝试在 CDK(打字稿)中编写一些简单的东西,但无法使其正常工作:
const cluster = new eks.Cluster(this, "eksCluster", clusterProps);
// Scale up EKS Cluster when above 80% CPU
cluster.defaultCapacity!.scaleOnCpuUtilization('up', {
targetUtilizationPercent: 80
});
每次我运行cdk ls
我都会收到以下错误:
TypeError: Cannot read property 'scaleOnCpuUtilization' of undefined
我该如何解决这个问题?
解决方案
它说:
property 'scaleOnCpuUtilization' of undefined
这应该意味着cluster.defaultCapacity!
是空的。我不是 JavaScript 程序员,但这是什么!
?
推荐阅读
- amazon-web-services - 对在配置了云端的 s3 上托管的静态网站的 IP 特定限制
- javascript - 没有 index.html 的 create-react 应用程序如何工作?
- multithreading - C++ 控制台应用程序异步接受用户输入
- python - 如何从 PyInstaller .exe 恢复 .py 文件?
- python - Python Numpy如何在具有多种数据类型的一维数组中搜索一行
- python - 比较两个类对象列表的有效方法是什么
- sql-server - SSIS - 在变量中捕获“ExecutionResult”/“Data Code”?
- java - 如何使用 Jsoup 在网站上搜索字符串?
- logstash - 在 Logstash 或 filebeat 中解析日志并将其转换为 JSON 以拉取 Elasticsearch
- linux - 如何杀死端口节点 env 正在使用