I am creating a CfnDeliveryStream in CDK and I would like to use the ARN later in an IAM role. I found the attribute attrArn, but it is undocumented. My question is: how do I access the ARN of a delivery stream (similar to what is available in S3 constructs).
Thanks, Benni
You can use the following syntax -
const resourceARN = cdk.Fn.getAtt(%ID_YOU_WANT_TO_GET%, "Arn").toString();
Usage:
    const lambdaFunction = new sam.CfnFunction(scope, "myLambdaID", {
      functionName: name,
      runtime: 'nodejs10.x',
      codeUri: {
        bucket: lambdaAssest.s3BucketName,
        key: lambdaAssest.s3ObjectKey
      },
      handler: handler,
      timeout: timeout,
      autoPublishAlias : `current`
    });
    const lambdaARN = cdk.Fn.getAtt( lambdaFunction.logicalId, "Arn").toString();
To verify the ARN, use cdk.CfnOutput -
new cdk.CfnOutput(scope, `output-arn`, { value: lambdaARN });
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With