Hey guys, I have a bucket declared like: ``` re...
# sst
a
Hey guys, I have a bucket declared like:
Copy code
return new Bucket(this, 'my-bucket', {
      bucketName,
      cors: [
        {
          allowedOrigins: [allowedOrigin],
          allowedMethods: [HttpMethods.GET, HttpMethods.HEAD],
        },
      ],
      lifecycleRules: [
        {
          expiration: Duration.days(1),
        },
      ],
    });
Now I want to remove the TTL… I removed from code, but CFormation is trying to re-create the bucket and fails… why can’t just UPDATE it?
f
hmm.. according to CloudFormation doc, updating lifecycle configuration doesn’t required the bucket to be recreated https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#cfn-s3-bucket-lifecycleconfig
Can you compare the CFN template b4 and after and see what the differences are?
a
Yeah good point.
It’s weird, maybe because I’m deleting the entire
lifecycleRules
object?
I’m going to investigate.
@Frank I think my problem is that I created a
backup plan
and attached it to the bucket.
And that is trying to re-create the bucket.
Apparently when I’ve updated to SST v1, my bucket logical-name changed, not sure if I did it or the CDK did it:
Copy code
[-] AWS::S3::Bucket fragreementsbucketBucket4A44A125 orphan
[-] AWS::S3::BucketPolicy fragreementsbucketBucketPolicyBB6DBB5E destroy
[+] AWS::S3::Bucket fr-agreements-bucket fragreementsbucket87FBF386 
[+] AWS::S3::BucketPolicy fr-agreements-bucket/Policy fragreementsbucketPolicy21403E06
Is there a way to keep the same logical-id so I don’t need to remove it?