ruby - 为什么 Inspec 在检查 aws_elbs 端口时返回“expected [] to include”?
问题描述
这是一个检查特定网络负载均衡器的 VPC-Id、端口、子网和可用区的 Inspec 控件:
control 'Loadbalancer Config' do
title 'Checks for correct configuration of LBs'
describe aws_elbs.where(arn: 'arn:aws:elasticloadbalancing:eu-central-1:123456789:loadbalancer/app/web-app-alb/1d234567890d') do
its('vpc_ids') { should include 'vpc-a12345678' }
its('subnet_ids') { should include 'subnet-12345678' }
its('internal_ports') { should include 443 }
its('availability_zones') { should include 'eu-central-1a' }
end
end
执行时,测试失败,我得到
预计 [] 将包括“vpc-a12345678”
预计 [] 包括 443
预计 [] 将包括“subnet-12345678”
预计 [] 将包括“eu-central-1a”
我仔细检查了负载均衡器的 ARN,但我总是得到这个空的结果数组。
解决方案
我现在很确定会发生这种情况,因为Inspec 不支持 Network Load Balancers。如果有人遇到同样的问题,将把它留在这里。
推荐阅读
- c# - TypeForwardedTo,显式实现的接口和事件
- python - 使用 Starlette 和 Uvicorn 进行 Python 日志记录时,文件句柄过多(在 lsof 上)
- amazon-web-services - AWS Elastic Beanstalk 中的 Cron 来触发 js 文件
- javascript - 如何使用 React apollo-client 缓存搜索数组?
- powershell - 如何在 PowerShell 中创建目录和文件数组?
- c# - 将异步任务中声明的变量带到不同的类
- python - 具有基于多个日期的计算值的 Pandas DataFrame
- javascript - 优化 JavaScript 中的否定 OR 和运算符查询(Filter 方法)
- python - 使用 python/pandas 将任意多列转换为键值对
- python - 按数据框访问分组中的聚合值