Hi, I am looking for a (right) way to create resso...
# help
l
Hi, I am looking for a (right) way to create ressources from the CDK sdk (when you need a construct which is not available from the SST CDK wrapper) I am pretty sure it is possible but i didn't find any documentation about it (i have found https://docs.serverless-stack.com/faq#can-i-use-all-the-cdk-constructs-in-sst which confirm this, but i am wondering how i should access the cdk ressources within an SST project) In my case, i would like to create and attach a Web ACL to my Cloudfront districution (created from ReactStaticSite), and we can't do that directly from
@serverless-stack/resources
as far as i know
f
Thanks @Gabriel Bleu!
@Ludovic VUE the code would look something like this in ur Stack code:
Copy code
import { CfnWebACL } from "aws-cdk-lib/aws_waf";

const cfnWebACL = new CfnWebACL(stack, 'MyCfnWebACL', {
  ...
});
Let me know if that works for you.
l
Hi Franck, thanks for your reply! I will try it in the next hours and let you know!
Actually i got this error
Error: construct does not have an associated node. All constructs must extend the "Construct" base class
Just trying:
Copy code
import { aws_wafv2 as wafv2 } from "aws-cdk-lib"; 

const cfnIPSet = new wafv2.CfnIPSet(stack, "MyCfnIPSet", {
    addresses: [
      "2a01:0e0a:*****************/128",
    ],
    ipAddressVersion: "IPV6",
    scope: "CLOUDFRONT",
    description: "description",
    name: "test-cdk",
  });