Hi, I'm trying to migrate from a V1 to a V2 bucket...
# general
b
Hi, I'm trying to migrate from a V1 to a V2 bucket. Do I have to redeclare the same variable as in the video? My Typescript compiler complains when I do.
Trying to follow this migration guide.
The guide didn't clearly state that I have to keep both the v1 and the v2 declaration in the code instead of replacing the old one with the new one.
So I'm in a bit of a pinch now how to best migrate everything.
I haven't migrated every environment yet. I just want to find a way for the remaining ones to be migrated without losing data.
e
Hi Georg, we've been looking at this recently in the context of possibly sunsetting Bucket in AWS v-next and we're working on a more comprehensive migration guide. https://github.com/pulumi/registry/pull/5444 - it didn't make it past review yet but you might find it useful. Also welcoming feedback here.
b
The previous migration guide seems to suggest that it's possible to switch from one to the next without losing data. Is that wrong?
Copy code
const s3BucketOld = new aws.s3.Bucket('bucket-name', {
  acl: 'private',
  lifecycleRules: [
    {
      enabled: true,
      expiration: {
        days: retentionInDays,
      },
    },
  ],
  serverSideEncryptionConfiguration: {
    rule: {
      applyServerSideEncryptionByDefault: {
        kmsMasterKeyId: '',
        sseAlgorithm: 'AES256',
      },
      bucketKeyEnabled: false,
    },
  },
  tags: {
    component: 'component',
  },
})
Can I migrate this without losing data using the way the original guide describes?
e
It's no longer as easy as it used to be in 2022.
b
Why?
e
The schema evolution has made these resources less compatible over time. Note also that inputs like serverSideEncryptionConfiguration are deprecated in favor of side-by-side resources.
b
Yeah, that's what I'm adding in V2
I'm just highly surprised that an infrastructure-as-code-tool stops supporting migration paths
e
Acknowledged, thanks for your feedback!
b
I really love Pulumi and how it's easy to use, but I really favor stability over most other things.
e
https://registry.terraform.io/providers/hashicorp/aws/latest/docs/guides/version-4-upgrade some decisions were made here that Pulumi's catching up with a few years later.
b
Yeah, I found that one too. You didn't want to keep supporting the old TF provider forever?
e
Indeed, indeed. This resonates with some internal conversations. The tradeoffs are difficult here. I'm going to open a ticket that you can upvote though for this specific ask, if there is enough interest it can help prioritize putting more effort into seamless migration tooling.
b
Thanks, highly appreciated.
e
Appreciate an upvote if you have a second!
b
Upvoted and commented. Thanks Anton.