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

Unable to using pulumi.Map as input to pulumi.StringMapInput #271

Closed
phillipedwards opened this issue Feb 22, 2023 · 2 comments
Closed

Unable to using pulumi.Map as input to pulumi.StringMapInput #271

phillipedwards opened this issue Feb 22, 2023 · 2 comments
Labels
kind/bug Some behavior is incorrect or out of spec resolution/by-design This issue won't be fixed because the functionality is working as designed

Comments

@phillipedwards
Copy link

What happened?

Unable to using pulumi.Map as input to pulumi.StringMapInput when using pulumi-random@4.11.2.

Expected Behavior

pulumi up succeeds.

Steps to reproduce

Run the following program twice; once with pulumi-random@4.8.0 and again with pulumi-random@4.11.2. The first up succeeds and the incurs a compiler warning.

package main

import (
	"github.com/pulumi/pulumi-random/sdk/v4/go/random"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {

		n := 2

		m := pulumi.Map{
			"hi": pulumi.String("hello"),
		}

		_, err := random.NewRandomId(ctx, "rand", &random.RandomIdArgs{
			ByteLength: pulumi.ToOutput(n).(pulumi.IntOutput),
			Keepers:    m,
		})

		if err != nil {
			return err
		}

		return nil
	})
}

Output of pulumi about

Dependencies:
NAME VERSION
github.com/pulumi/pulumi-random/sdk/v4 4.11.2
github.com/pulumi/pulumi/sdk/v3 3.55.0

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

@phillipedwards phillipedwards added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Feb 22, 2023
@lukehoban
Copy link

This appears to have been introduced with #260, which changed the schema for Keepers from:

                "keepers": {
                    "type": "object",
                    "additionalProperties": {
                        "$ref": "pulumi.json#/Any"
                    },
                    "description": "Arbitrary map of values that, when changed, will\ntrigger a new id to be generated. See\nthe main provider documentation for more information.\n"
                },

to:

                "keepers": {
                    "type": "object",
                    "additionalProperties": {
                        "type": "string"
                    },
                    "description": "Arbitrary map of values that, when changed, will trigger recreation of resource. See the main provider documentation for more information.\n"
                },

That is - it appears to be incorrectly requiring that the values of the keepers object are strings.

@AaronFriel AaronFriel added resolution/by-design This issue won't be fixed because the functionality is working as designed and removed needs-triage Needs attention from the triage team labels Feb 22, 2023
@AaronFriel
Copy link
Contributor

The upstream made this change in v3.4.0 provider with the same impact on their users as we saw - restricting the map to string elements - and our release being a minor version bump was in keeping with our versioning policy for breaking changes.

We're going to take a look at that policy and what we can do in the future to mitigate this for users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Some behavior is incorrect or out of spec resolution/by-design This issue won't be fixed because the functionality is working as designed
Projects
None yet
Development

No branches or pull requests

3 participants