I am new to using CloudFormation / CDK and am having trouble figuring out to deploy my stacks without error. Currently I am using the python CDK to create a bucket. This bucket will hold model files and I need to ensure that the bucket deployed in this stack retains data over time / new deployments. From my initial tests, it seems that if bucket_name is not specified, the CDK will randomly generate a new bucket name on deployment, which is not ideal.
Here is the snippet used to create the bucket:
bucket = aws_s3.Bucket(self, "smartsearch-bucket", bucket_name= 'mybucketname')
The first time I run cdk deploy, there are no problems and the bucket is created. The second time I run cdk deploy, I get an error stating that my S3 bucket already exists. What else is needed so that I can redeploy my stack using a predetermined S3 bucket name?
