我是新的 NodeJS,并试图更改 AWS 提供的此示例以更新信誉列表,但它仅特定于 CloudFront 全球区域。
https://github.com/awslabs/aws-waf-sample/tree/master/waf-reputation-lists
我已经对 CloudFormation 进行了更改以创建区域 IPSetID,但是该函数在 IPSetID 不存在的情况下退出。我认为这是因为 SDK 正在查看全局而不是区域,即 eu-west-1,因此我在配置中设置了区域,但它仍然无法找到 IPSet。
var aws = require('aws-sdk');
// configure API retries
aws.config.update({
region:'eu-west-1',
maxRetries: 3,
retryDelayOptions: {
base: 1000
}
});
var waf = new aws.WAF();
我看到了一个最近的问题(AWS WAF 更新 ip sets and rules specific to a region from lambda),它显示了 URL 的差异,但是我不知道从哪里开始更新 URL?
Error getting IP sets { [WAFNonexistentItemException: The referenced item does not exist.]
message: 'The referenced item does not exist.',
code: 'WAFNonexistentItemException',
statusCode: 400,
retryable: false,
retryDelay: 162.11187234148383 }
Error getting ranges and/or IP sets { [WAFNonexistentItemException: The referenced item does not exist.]
message: 'The referenced item does not exist.',
code: 'WAFNonexistentItemException',
statusCode: 400,
retryable: false,
retryDelay: 162.11187234148383 }
{
"errorMessage": "The referenced item does not exist.",
"errorType": "WAFNonexistentItemException",
"stackTrace": [
"Request.extractError (/var/task/node_modules/aws-sdk/lib/protocol/json.js:48:27)",
"Request.callListeners (/var/task/node_modules/aws-sdk/lib/sequential_executor.js:105:20)",
"Request.emit (/var/task/node_modules/aws-sdk/lib/sequential_executor.js:77:10)",
"Request.emit (/var/task/node_modules/aws-sdk/lib/request.js:682:14)",
"Request.transition (/var/task/node_modules/aws-sdk/lib/request.js:22:10)",
"AcceptorStateMachine.runTo (/var/task/node_modules/aws-sdk/lib/state_machine.js:14:12)",
"/var/task/node_modules/aws-sdk/lib/state_machine.js:26:10",
"Request.<anonymous> (/var/task/node_modules/aws-sdk/lib/request.js:38:9)",
"Request.<anonymous> (/var/task/node_modules/aws-sdk/lib/request.js:684:12)",
"Request.callListeners (/var/task/node_modules/aws-sdk/lib/sequential_executor.js:115:18)"
]
}