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년 전1648회 조회
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년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠