pulumi-aws: Invalid ARN when creating aws.wafv2.WebAclLoggingConfiguration
When trying to create aws.wafv2.WebAclLoggingConfiguration it fails with The ARN isn’t valid. A valid ARN begins with arn: and includes other information separated by colons or slashes. Thing is that the arn format its ok, spoke with AWS support and they said that all the setup was made properly for aws and api calls so it seems to be a pulumi issue.
Here is the example code from @pulumi/aws module:
const example = new aws.wafv2.WebAclLoggingConfiguration("example", {
logDestinationConfigs: [aws_kinesis_firehose_delivery_stream.example.arn],
resourceArn: aws_wafv2_web_acl.example.arn,
redactedFields: [{
singleHeader: {
name: "user-agent",
},
}],
});
And this is my code:
const waflogging = new aws.wafv2.WebAclLoggingConfiguration("model-builder-waflogging", {
logDestinationConfigs: [kinesisStream.arn],
resourceArn: wafwebacl.arn // I tried to manually add as string but same issue.
}, { dependsOn: kinesisStream });
When I run Pulumi, I have the following error:
* error putting WAFv2 Logging Configuration for resource (arn:aws:wafv2:us-east-1:796031763495:global/webacl/modelbuilderCF/80986c63-50d8-4775-b82e-91339616cc81): WAFInvalidParameterException: Error reason: The ARN isn't valid. A valid ARN begins with arn: and includes other information separated by colons or slashes., field: RESOURCE_ARN, parameter: arn:aws:wafv2:us-east-1:796031763495:global/webacl/modelbuilderCF/80986c63-50d8-4775-b82e-91339616cc81
{
RespMetadata: {
StatusCode: 400,
RequestID: "79d08de5-b145-4eb5-9f35-c67ef076f3ac"
},
Field: "RESOURCE_ARN",
Message_: "Error reason: The ARN isn't valid. A valid ARN begins with arn: and includes other information separated by colons or slashes., field: RESOURCE_ARN, parameter: arn:aws:wafv2:us-east-1:796031763495:global/webacl/modelbuilderCF/80986c63-50d8-4775-b82e-91339616cc81",
Parameter: "arn:aws:wafv2:us-east-1:796031763495:global/webacl/modelbuilderCF/80986c63-50d8-4775-b82e-91339616cc81",
Reason: "The ARN isn't valid. A valid ARN begins with arn: and includes other information separated by colons or slashes."
}
For now I had to manually enable logging to my webacl v2 but It will be nice to have it all done from Pulumi. Please advise if its something I do wrong or is there any other constructor that I can use to configure logging. I tried to add the ARN as string but same outcome.
Thanks
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 1
- Comments: 25 (3 by maintainers)
You need to ensure your delivery stream’s name begins with
aws-waf-logs-.I got this error:
I fix this issue, for CloudWatch logging by adding at the beginning, in the name of the
aws_cloudwatch_log_group, the prefixaws-waf-logsNot only for Kinesis logging, but it goes the same for CloudWatch logging.
What an absolute scam
This was fixed by doing the following:
Closing issue.
Hi @emiioan - I had this same issue but when using Terraform, which led me here, and as it turns out the issue was in between the chair and the keyboard, as I forgot to set the region to us-east-1 for this resource creation, hence the ARN validation error 😃 Hopefully this helps!
It’s been 4 years and this problem still hasn’t been fixed 😒
Even I was facing the same issue with TF, dropped by here. Tried adding region under provider section and this worked.
ah no sorry, my problem was the missing alias configuration
you need to replace “global” in the arn string to “regional”
Just want to add that aws.kinesis.FirehoseDeliveryStream(“aws-waf-logs-modelbuilderStream”) was created in us-east-1 for waf logging as the waf is assigned to CloudFront and the name is prefixed with ‘aws-waf-logs-’ as aws recommends (https://docs.aws.amazon.com/waf/latest/developerguide/logging.html)