-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document migrating aws.s3.Bucket to aws.s3.BucketV2 #5444
base: master
Are you sure you want to change the base?
Conversation
@interurban opening for early review, thanks a lot! As an aside, I'm working to get examples formatted with the right |
Your site preview for commit 6812b5d is ready! 🎉 http://registry--origin-pr-5444-6812b5d7.s3-website.us-west-2.amazonaws.com/registry. |
Your site preview for commit 95a25b7 is ready! 🎉 http://registry--origin-pr-5444-95a25b7f.s3-website.us-west-2.amazonaws.com/registry. |
Your site preview for commit f7e5595 is ready! 🎉 http://registry--origin-pr-5444-f7e5595e.s3-website.us-west-2.amazonaws.com/registry. |
Your site preview for commit 50358fc is ready! 🎉 http://registry--origin-pr-5444-50358fc1.s3-website.us-west-2.amazonaws.com/registry. |
Looks like something with choosers inside lists is not happy: /home/runner/work/registry/registry/themes/default/content/registry/packages/aws/how-to-guides/bucketv2-migration.md: |
Your site preview for commit f9a1f60 is ready! 🎉 http://registry--origin-pr-5444-f9a1f600.s3-website.us-west-2.amazonaws.com/registry. |
themes/default/content/registry/packages/aws/how-to-guides/bucketv2-migration.md
Outdated
Show resolved
Hide resolved
themes/default/content/registry/packages/aws/how-to-guides/bucketv2-migration.md
Outdated
Show resolved
Hide resolved
themes/default/content/registry/packages/aws/how-to-guides/bucketv2-migration.md
Outdated
Show resolved
Hide resolved
2. Perform `pulumi up` to replace (delete and re-create) the buckets in AWS. | ||
|
||
If replacement is not acceptable, it is possible to perform a manual migration with `pulumi import` (see Avoiding | ||
replacement). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should be able to link to the section like this: [Avoiding Replacement](#avoiding-replacement)
. Not 100% sure though whether Hugo supports that syntax
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's been failing builds. Looks like this only works in GitHub markdown. @interurban might have some pointers here.
|
||
|
||
|
||
As a bonus, the policy can now more easily refer to the concrete name of the bucket. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be worth explaining the benefit of not having cyclic deps in a bit more detail in the beginning. Gives some more insights into why this is a good thing for users.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a difficult sell. I tried adding a Context section at the bottom, but not sure it belongs, perhaps this sentence does not belong either. Primary motivation for users to do this is to get onto a supported version because they have to.
I've checked the style of https://registry.terraform.io/providers/hashicorp/aws/latest/docs/guides/version-4-upgrade#s3-bucket-refactor FWIW it's very technical to-the-point and does not explain any design considerations as to why.
This will only be available as an output. If your program specified this as an input, simply remove it. The input was | ||
ignored by prior versions of the provider and was exposed in error. | ||
|
||
### other inputs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How were the props with explicit instructions chosen? I guess they're the most used ones?
I'm wondering if we should have a single example with all options (might not be possible if some settings are mutually exclusive) and show how to migrate that instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I've just taken one of the more commonly used properties. It's not a bad idea, try running through this which might prove instructive.
against the actual cloud account. While the details will vary depending on your use case, this procedure generally | ||
involves the following steps: | ||
|
||
- Find URNs for legacy Bucket Pulumi resources using `pulumi stack export` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should be able to extract those with jq, right? Could be a nice addition to add that here
Your site preview for commit a26fefd is ready! 🎉 http://registry--origin-pr-5444-a26fefd1.s3-website.us-west-2.amazonaws.com/registry. |
Your site preview for commit f172554 is ready! 🎉 http://registry--origin-pr-5444-f1725541.s3-website.us-west-2.amazonaws.com/registry. |
@flostadler I went ahead and took a larger bucket example for a spin through the import-based migration procedure. It worked but highlighted a few extra steps, this was useful. For alternative upgrade procedures. I have filed pulumi/pulumi-aws#4471 as this seems to have regressed. I've also had a slack conversation with a user trying this today and filed pulumi/pulumi-aws#4470 - sounds like we could do a bit more possibly, depending on interest here. |
Your site preview for commit e7f99a0 is ready! 🎉 http://registry--origin-pr-5444-e7f99a0d.s3-website.us-west-2.amazonaws.com/registry. |
The confusing things for me were to find the old migration guide and
If the mechanism doesn't work anymore, remove the guide or clearly state on top that it stopped working with v12345 of Pulumi. |
Thanks for your feedback @georgberky that's a good point; we don't edit old blog content but we have a way to marking it obsolete and pointing to new material, I'll make sure we do this to https://www.pulumi.com/blog/announcing-v5.0.0-of-the-pulumi-aws-provider/#can-i-migrate-from-awss3bucket-to-awss3bucketv2 |
`BucketV2` inputs such as `policy` and `accelerationStatus` are to be replaced by side-by-side resources | ||
`aws.s3.BucketPolicy` and `aws.s3.BucketAccelerateConfigurationV2`. | ||
|
||
2. Perform `pulumi up` to replace the buckets in AWS. **WARNING**: replacing the buckets will delete and re-create them, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if we should flip this and mention replacing buckets as the alternative. I think 99% of buckets won't be able to be replaced so we should just go with that as the default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right.. that seems to be really true. I'll incorporate.
import * as pulumi from "@pulumi/pulumi"; | ||
import * as aws from "@pulumi/aws"; | ||
|
||
const myBucket = new aws.s3.Bucket("my-bucket", {serverSideEncryptionConfiguration: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const myBucket = new aws.s3.Bucket("my-bucket", {serverSideEncryptionConfiguration: { | |
const myBucket = new aws.s3.Bucket("my-bucket", { | |
serverSideEncryptionConfiguration: { |
In situations when replacing the bucket in the AWS account is not acceptable, it is possible to perform a manual | ||
migration that changes Pulumi program and state to track buckets using the new resource without executing any changes | ||
against the actual cloud account. While the details will vary depending on your use case, this procedure generally | ||
involves the following steps: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think as far as manual steps go this is not bad and as good as we can do 👍🏻
Description
Add a migration guide for moving from aws.s3.Bucket to aws.s3.BucketV2.
Fixes https://github.com/pulumi/home/issues/3630
Adding a new package?
If this pull request adds a new package:
Cloud
,Infrastructure
,Network
,Database
,Monitoring
, orUtility
)./docs/_index.md
) that includes:layout
set topackage
./docs/installation-configuration.md
) that includes:pulumi config set
.v
that corresponds with a valid GitHub release and published package SDKs