我正试图通过arn使用CDK导入一个现有的S3 bucket。
到目前为止,代码看起来像,
class MyStack(Stack):
def __init__(self, scope: Construct, construct_id: str, **kwargs) -> None:
super().__init__(scope, construct_id, **kwargs)
s3_bucket_arn = CfnParameter(
self,
"S3_BUCKET_ARN",
type="String"
)
s3_bucket = s3.Bucket.from_bucket_arn(
self,
"existing-bucket-from-arn",
s3_bucket_arn.to_string()
)
接下来,当我引导我的帐户时
cdk bootstrap --profile my-profile --parameters S3_BUCKET_ARN=arn:aws:s3:::my-bucket-arn
这引发了以下错误,
jsii.errors.JSIIError: ARNs must start with "arn:" and have at least 6 components: MyStack/S3_BUCKET_ARN