1 Answer
- Newest
- Most votes
- Most comments
0
Hello.
Is it possible for you to share the entire code?
I suspect that "cdk" may not be imported as shown below.
import aws_cdk as cdk
Relevant content
- asked 2 years ago
- asked 7 months ago
- Accepted Answerasked 10 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
Hi Riku
The full code is below. I take your point and the S3 module is imported as s3, and I have changed the code to reflect this, now get the following error:
'aws_cdk.aws_s3' has no attribute 'RemovalPolicy'
import aws_cdk.aws_s3 as s3 def init(self, scope: Construct, construct_id: str, **kwargs) -> None: super().init(scope, construct_id, **kwargs) bucket = s3.Bucket(self, "MyBucket", bucket_name="test-bucket", versioned=False, encryption=s3.BucketEncryption.S3_MANAGED, removal_policy=s3.RemovalPolicy.DESTROY, auto_delete_objects=True
Please try the code below.