-
Notifications
You must be signed in to change notification settings - Fork 156
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
fix!: unable to create fsx for OpenZfs Multi-AZ file system #4095
Conversation
This PR removes the `MaxItemsOne` config for the `subnetIds` property. Originally this was a `MaxItemsOne` property in upstream, but it was removed when Multi-AZ support was added by AWS. In Terraform removing `MaxItemsOne` is not a breaking change, but for Pulumi it is. Because it looks like there is very low usage of this resource, and the change enables a (maybe) more common use case (Multi-AZ filesystem) we have decided to take the breaking change now. In order to upgrade users will only need to update their code so that `subnetIds` is now a list. For example, From ```ts const test = new aws.fsx.OpenZfsFileSystem("test", { storageCapacity: 64, subnetIds: test1.id, deploymentType: "SINGLE_AZ_1", throughputCapacity: 64, }); ``` To ```ts const test = new aws.fsx.OpenZfsFileSystem("test", { storageCapacity: 64, subnetIds: [test1.id], deploymentType: "SINGLE_AZ_1", throughputCapacity: 64, }); ``` Because we are including the `TransformFromState` function, users should not need to make any changes to the state themselves. BREAKING CHANGE: `fsx.OpenZfsFileSystem.subnetIds` now accepts a list instead of a string closes #3106, closes #3034
Does the PR have any schema changes?Found 4 breaking changes: Resources
Maintainer note: consult the runbook for dealing with any breaking changes. |
"aws_fsx_windows_file_system": {Tok: awsResource(fsxMod, "WindowsFileSystem")}, | ||
"aws_fsx_openzfs_file_system": { | ||
Tok: awsResource(fsxMod, "OpenZfsFileSystem"), | ||
TransformFromState: func(ctx context.Context, state resource.PropertyMap) (resource.PropertyMap, error) { |
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.
Curious if you found this necessary? If I recall correctly the bridge might be already applying this transformation generically to permit lenient state reads to compensate for MaxItems=1 mismatches. If it doesn't at the moment we could consider moving it there anyway.
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.
Yes it was necessary. Without it it showed a resource 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.
lgtm
provider/provider_test.go
Outdated
idiff := inputDiff.(map[string]interface{}) | ||
if adds, ok := idiff["adds"]; ok { | ||
a := adds.(map[string]interface{}) | ||
delete(a, "region") |
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.
Why do we delete the region, that shouldn't change, right?
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 can change between what you set it to locally and what is set in CI. I ended up changing the test to set the region explicitly, but I thought to keep this in.
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.
But wouldn't change more in this case? E.g. ARNs
or URLs
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.
Hmm that's true. I"ll remove it.
return | ||
} | ||
|
||
pulumiTest.T().Log("Plan is not equal, re-running up") |
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.
This is https://www.pulumi.com/docs/concepts/update-plans/ right?
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.
Yes!
@@ -82,6 +89,100 @@ func testProviderUpgrade(t *testing.T, dir string, opts *testProviderUpgradeOpti | |||
assertpreview.HasNoReplacements(t, result) | |||
} | |||
|
|||
type testProviderCodeChangesOptions struct { |
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 looking at this and I'm thinking that ideally we'd figure out how to upstream this into https://github.com/pulumi/providertest
This is almost like:
func PreviewProviderUpgrade(t pulumitest.PT, pulumiTest *pulumitest.PulumiTest, providerName string, baselineVersion string, opts ...optproviderupgrade.PreviewProviderUpgradeOpt) auto.PreviewResult {
But not quite.
One difference is that it lets you specify two sets of programs and options which I've also wanted and I think would be a very useful thing to have.
Another difference is that your test also runs pulumi up? Or am I misreading this?
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.
Yes I think we could upstream this since I think it is a generic enough use case. And yes those are the two main differences.
// This should be used when the plan is a good representation of what you are testing. Sometimes | ||
// there are issues where the plan is consistent, but the apply fails. In those cases a snapshot test is not | ||
// a good fit. | ||
func pulumiUpWithSnapshot(t *testing.T, pulumiTest *pulumitest.PulumiTest) { |
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.
This looks curious, I could use some help understanding what this is testing additionally, and perhaps if this is generally useful if we can upstream it to pulumitest.
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 experimenting with something here. I think it may be useful to upstream, but I'm not sure yet since I think it would be easy to footgun yourself. I'm trying to figure out ways we can short circuit the test.
I think it is useful for the type of test where everything that you want to test exists in the plan snapshot. In those cases we can short circuit the test and only actually run the test when the plan has changed. In this case I'm testing that subnets as a list is able to be deployed and the snapshot contains this information.
In other cases the snapshot won't contain enough information, for example if the test depends on the value of unknowns the plan won't have those values so will never show a difference.
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.
So you're looking for an optimization that doesn't run pulumi up
when the plan hasn't changed, but does run it if there's changes in plans? This can be interesting. I worry that plan support is not yet solid enough to trust for this, but it can be interesting.
This PR has been shipped in release v6.42.0. |
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@pulumi/aws](https://pulumi.io) ([source](https://togithub.com/pulumi/pulumi-aws)) | dependencies | minor | [`6.41.0` -> `6.42.0`](https://renovatebot.com/diffs/npm/@pulumi%2faws/6.41.0/6.42.0) | --- ### Release Notes <details> <summary>pulumi/pulumi-aws (@​pulumi/aws)</summary> ### [`v6.42.0`](https://togithub.com/pulumi/pulumi-aws/releases/tag/v6.42.0) [Compare Source](https://togithub.com/pulumi/pulumi-aws/compare/v6.41.0...v6.42.0) ##### What's Changed - Add extra notes to critical resource properties by [@​guineveresaenger](https://togithub.com/guineveresaenger) in [https://github.com/pulumi/pulumi-aws/pull/4088](https://togithub.com/pulumi/pulumi-aws/pull/4088) - upstream v5.55.0 by [@​flostadler](https://togithub.com/flostadler) in [https://github.com/pulumi/pulumi-aws/pull/4102](https://togithub.com/pulumi/pulumi-aws/pull/4102) - Upgrade pulumi-terraform-bridge to v3.85.0 by [@​pulumi-bot](https://togithub.com/pulumi-bot) in [https://github.com/pulumi/pulumi-aws/pull/4103](https://togithub.com/pulumi/pulumi-aws/pull/4103) - Enable TypedDict input types for the Python SDK by [@​julienp](https://togithub.com/julienp) in [https://github.com/pulumi/pulumi-aws/pull/4108](https://togithub.com/pulumi/pulumi-aws/pull/4108) - fix!: unable to create fsx for OpenZfs Multi-AZ file system by [@​corymhall](https://togithub.com/corymhall) in [https://github.com/pulumi/pulumi-aws/pull/4095](https://togithub.com/pulumi/pulumi-aws/pull/4095) - Fix unexpected alb.Listener target group refresh by [@​t0yv0](https://togithub.com/t0yv0) in [https://github.com/pulumi/pulumi-aws/pull/4083](https://togithub.com/pulumi/pulumi-aws/pull/4083) ##### ⚠ BREAKING CHANGES - fsx.OpenZfsFileSystem - The `subnetIds` argument now accepts a list instead of a string ##### New Contributors - [@​julienp](https://togithub.com/julienp) made their first contribution in [https://github.com/pulumi/pulumi-aws/pull/4108](https://togithub.com/pulumi/pulumi-aws/pull/4108) **Full Changelog**: pulumi/pulumi-aws@v6.41.0...v6.42.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://togithub.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MTkuMSIsInVwZGF0ZWRJblZlciI6IjM3LjQyMC4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJ0eXBlL21pbm9yIl19--> Co-authored-by: lumiere-bot[bot] <98047013+lumiere-bot[bot]@users.noreply.github.com>
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@pulumi/aws](https://pulumi.io) ([source](https://togithub.com/pulumi/pulumi-aws)) | dependencies | minor | [`6.41.0` -> `6.42.0`](https://renovatebot.com/diffs/npm/@pulumi%2faws/6.41.0/6.42.0) | --- ### Release Notes <details> <summary>pulumi/pulumi-aws (@​pulumi/aws)</summary> ### [`v6.42.0`](https://togithub.com/pulumi/pulumi-aws/releases/tag/v6.42.0) [Compare Source](https://togithub.com/pulumi/pulumi-aws/compare/v6.41.0...v6.42.0) ##### What's Changed - Add extra notes to critical resource properties by [@​guineveresaenger](https://togithub.com/guineveresaenger) in [https://github.com/pulumi/pulumi-aws/pull/4088](https://togithub.com/pulumi/pulumi-aws/pull/4088) - upstream v5.55.0 by [@​flostadler](https://togithub.com/flostadler) in [https://github.com/pulumi/pulumi-aws/pull/4102](https://togithub.com/pulumi/pulumi-aws/pull/4102) - Upgrade pulumi-terraform-bridge to v3.85.0 by [@​pulumi-bot](https://togithub.com/pulumi-bot) in [https://github.com/pulumi/pulumi-aws/pull/4103](https://togithub.com/pulumi/pulumi-aws/pull/4103) - Enable TypedDict input types for the Python SDK by [@​julienp](https://togithub.com/julienp) in [https://github.com/pulumi/pulumi-aws/pull/4108](https://togithub.com/pulumi/pulumi-aws/pull/4108) - fix!: unable to create fsx for OpenZfs Multi-AZ file system by [@​corymhall](https://togithub.com/corymhall) in [https://github.com/pulumi/pulumi-aws/pull/4095](https://togithub.com/pulumi/pulumi-aws/pull/4095) - Fix unexpected alb.Listener target group refresh by [@​t0yv0](https://togithub.com/t0yv0) in [https://github.com/pulumi/pulumi-aws/pull/4083](https://togithub.com/pulumi/pulumi-aws/pull/4083) ##### ⚠ BREAKING CHANGES - fsx.OpenZfsFileSystem - The `subnetIds` argument now accepts a list instead of a string ##### New Contributors - [@​julienp](https://togithub.com/julienp) made their first contribution in [https://github.com/pulumi/pulumi-aws/pull/4108](https://togithub.com/pulumi/pulumi-aws/pull/4108) **Full Changelog**: pulumi/pulumi-aws@v6.41.0...v6.42.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://togithub.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MTkuMSIsInVwZGF0ZWRJblZlciI6IjM3LjQyMC4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJ0eXBlL21pbm9yIl19--> Co-authored-by: lumiere-bot[bot] <98047013+lumiere-bot[bot]@users.noreply.github.com>
This PR removes the
MaxItemsOne
config for thesubnetIds
property. Originally this was aMaxItemsOne
property in upstream, but it was removed when Multi-AZ support was added by AWS. In Terraform removingMaxItemsOne
is not a breaking change, but for Pulumi it is.Because it looks like there is very low usage of this resource, and the change enables a (maybe) more common use case (Multi-AZ filesystem) we have decided to take the breaking change now.
In order to upgrade users will only need to update their code so that
subnetIds
is now a list. For example,From
To
Because we are including the
TransformFromState
function, users should not need to make any changes to the state themselves.BREAKING CHANGE:
fsx.OpenZfsFileSystem.subnetIds
now accepts a list instead of a stringcloses #3106, closes #3034