How to refer arn for an S3 bucket created using cfn resource in cdk python ?

0

I have created an s3 bucket using CfnBucket construct like below. I am using cfn constructs due to strict requirement.

`bucket=s3.CfnBucket(
            self,
            "someId",
            bucket_name="some_name"
)`

How to I refer to this bucket's arn in some other construct ? For eg I am trying something like below to refer to this bucket's arn in a firehose stream I am trying to create.

kinesisfirehose.CfnDeliveryStream(
            self, "SomeId",
       s3_destination_configuration=kinesisfirehose.CfnDeliveryStream.S3DestinationConfigurationProperty(
                bucket_arn=f"arn:aws:s3:::{ksuite_analytic_bucket}",
            )
        )
)

This is not working and I am getting an error that s3 arn is not valid.

What's the correct way of doing this ?

Naxi
已提問 2 年前檢視次數 1646 次
1 個回答
0

There's an attribute called attr_arn that returns the ARN of the bucket. You could simply pass bucket.attr_arn as a parameter. See the CDK python documentation about the attribute.

profile pictureAWS
專家
Tasio
已回答 2 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南