can someone point out the error in this instantiation? I tested this rule in the console and it seems to work:
import * as xray from 'aws-cdk-lib/aws-xray';
new xray.CfnSamplingRule(this, 'ignoreHttpOptionsSamplingRule', {
ruleName: 'ignoreOptionsRequest',
samplingRule: {
fixedRate: 0,
host: '*',
httpMethod: 'OPTIONS',
priority: 9999,
reservoirSize: 0,
resourceArn: '*',
serviceName: '*',
serviceType: '*',
urlPath: '*',
version: 1,
},
});
I get the following error
Resource handler returned message: "Invalid request provided: CreateSamplingRuleRequest(SamplingRule=SamplingRule(ResourceARN=*, Priority=9999, FixedRate=0.0, ReservoirSize=0, ServiceName=*, ServiceType=*, Host=*, HTTPMethod=OPTIONS, URLPath=*, Version=1))
The comment here about cloudtrail helped me find the issue. It seems like the rule name in props is deprecated and
ruleName
is supported inside sampling rule. the final code that worked was