Skip to content
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 rds db param group default #3802

Merged
merged 10 commits into from Apr 12, 2024
Merged

Conversation

VenelinMartinov
Copy link
Contributor

@VenelinMartinov VenelinMartinov commented Apr 11, 2024

In #3638 - we introduced a diff customizer to change the schema as an alternative to patching. The change does not pass InternalValidate but because of pulumi/pulumi-terraform-bridge#1852 it was not flagged up.

After turning InternalValidate back on (pulumi/pulumi-terraform-bridge#1852) we discovered an issue with this parameter:

make tfgen_no_deps
(cd provider && go build -p 2 -o /Users/vvm/code/pulumi-aws/bin/pulumi-tfgen-aws -ldflags "-X github.com/pulumi/pulumi-aws/provider/v6/pkg/version.Version=6.29.1+dirty" github.com/pulumi/pulumi-aws/provider/v6/cmd/pulumi-tfgen-aws)
/Users/vvm/code/pulumi-aws/bin/pulumi-tfgen-aws schema --out provider/cmd/pulumi-resource-aws
Errors occurred: [InternalValidate: Internal validation of the provider failed! This is always a bug
with the provider itself, and not a user issue. Please report
this bug:

resource aws_db_parameter_group: apply_method: Default must be nil if computed]
make: *** [tfgen_no_deps] Error 255

This should fix it by also setting the Default to nil in the schema.

To keep the current behaviour, we set the Default in the pulumi overlay instead.

Copy link

Does the PR have any schema changes?

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

Maintainer note: consult the runbook for dealing with any breaking changes.

Copy link

Is README.md missing any configuration options?

assumeRoleWithWebIdentity not found in Configuration section
customCaBundle not found in Configuration section
defaultTags not found in Configuration section
ec2MetadataServiceEndpoint not found in Configuration section
ec2MetadataServiceEndpointMode not found in Configuration section
httpProxy not found in Configuration section
httpsProxy not found in Configuration section
ignoreTags not found in Configuration section
noProxy not found in Configuration section
retryMode not found in Configuration section
s3UsEast1RegionalEndpoint not found in Configuration section
sharedConfigFiles not found in Configuration section
skipRequestingAccountId not found in Configuration section
stsRegion not found in Configuration section
tokenBucketRateLimiterCapacity not found in Configuration section
useDualstackEndpoint not found in Configuration section

Please add a description for each of these options to README.md. Details about them can be found in either the upstream docs or schema.json.

@@ -34,6 +34,7 @@ public sealed class ParameterGroupParameterArgs : global::Pulumi.ResourceArgs

public ParameterGroupParameterArgs()
{
ApplyMethod = "immediate";
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder why we didn't generate the defaults in the sdk before - this PR just moves the defaults from the TF schema to the pulumi overlay. IMO this is a better UX for the sdks, does anyone know why they didn't show up before?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe it depends on how the defaults are applied. We can't always see inside TF providers to find the defaults they supply.

Copy link
Member

@iwahbe iwahbe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm having trouble understanding this PR.

Is this a bug we introduced in AWS in a patch, and if so can we just fix the patch? If not, does this imply that the upstream schema is invalid, and if so can we submit an upstream patch instead?

@VenelinMartinov
Copy link
Contributor Author

VenelinMartinov commented Apr 12, 2024

The context is this: #3638 - we introduced a diff customizer to change the schema as an alternative to patching. The change does not pass InternalValidate but because of pulumi/pulumi-terraform-bridge#1852 it was not flagged up.

This PR corrects the change to make the schema pass InternalValidate

I don't believe we can submit a PR upstream as the change is pulumi-specific and different to the TF behaviour.

@iwahbe iwahbe self-requested a review April 12, 2024 16:47
name: securitygroup${randSuffix}
family: postgres14
parameters:
- name: track_io_timing
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice this looks like it's testing the case where the default might kick in.

// We set the default value in the overlay since
// we remove it in the TF schema in
// provider/pkg/rds/parameter_group.go
Default: &tfbridge.DefaultInfo{Value: "immediate"},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this compensates for the patch. Very nice.

Copy link
Member

@t0yv0 t0yv0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢

@t0yv0
Copy link
Member

t0yv0 commented Apr 12, 2024

Yes @iwahbe the alternative here would be to rework #2442 fix with patching, instead of a diff customizer, but as things stand this change here is the lightest-way step forward, so I think this is good for now.

@VenelinMartinov VenelinMartinov enabled auto-merge (squash) April 12, 2024 16:57
@VenelinMartinov VenelinMartinov merged commit 16ae22e into master Apr 12, 2024
23 checks passed
@VenelinMartinov VenelinMartinov deleted the vvm/fix_param_group_default branch April 12, 2024 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants