pulumi / pulumi-awsx

AWS infrastructure best practices in component form!
https://www.pulumi.com/docs/guides/crosswalk/aws/
Apache License 2.0
227 stars 104 forks source link

If no subnet strategy specified, you get the "outputs are not strings" error message #1372

Closed pierskarsenbarg closed 1 month ago

pierskarsenbarg commented 2 months ago

What happened?

I didn't add a subnet_strategy input to my VPC and got the following warning message:

warning: The default subnetStrategy will change from "Legacy" to "Auto" in the next major version. Please specify the subnetStrategy explicitly. The current subnet layout can be specified via "Auto" as:

    "Calling [toJSON] on an [Output<T>] is not supported.\n\nTo get the value of an Output as a JSON value or JSON string consider either:\n    1: o.apply(v => v.toJSON())\n    2: o.apply(v => JSON.stringify(v))\n\nSee https://www.pulumi.com/docs/concepts/inputs-outputs for more details.\nThis function may throw in a future version of @pulumi/pulumi."

which suggests that we're trying to write out an output as a string.

Example

import pulumi_aws as aws
import pulumi_awsx as awsx

vpc = awsx.ec2.Vpc("gpu-vpc",
          cidr_block="10.0.0.0/16",
          subnet_specs=[awsx.ec2.SubnetSpecArgs(
              type=awsx.ec2.SubnetType.PUBLIC,
              name="gpu-public"
          )],
          nat_gateways=awsx.ec2.NatGatewayConfigurationArgs(
              strategy=awsx.ec2.NatGatewayStrategy.NONE
          ),
        #   subnet_strategy=awsx.ec2.SubnetAllocationStrategy.AUTO
          )

(note the subnet strategy line is commented out)

Output of pulumi about

CLI
Version      3.130.0
Go Version   go1.22.6
Go Compiler  gc

Plugins
KIND      NAME    VERSION
resource  aws     6.50.1
resource  awsx    2.14.0
resource  docker  4.5.5
language  python  unknown

Host
OS       darwin
Version  14.6.1
Arch     arm64

This project is written in python: executable='/Users/piers/go/src/github.com/pierskarsenbarg/demos/python-ecs-gpu/venv/bin/python' version='3.12.5'

Current Stack: demo/python-ecs-gpu/dev

Found no resources associated with demo/dev

Found no pending operations associated with demo/dev

Backend
Name           pulumi.com
URL            https://app.pulumi.com/pierskarsenbarg
User           pierskarsenbarg
Organizations  pierskarsenbarg, team-ce, gitlab-test-piers, demo
Token type     personal

Dependencies:
NAME         VERSION
pip          24.2
pulumi_awsx  2.14.0
setuptools   74.1.1
wheel        0.44.0

Pulumi locates its logs in /var/folders/x8/cdd9j87s607fwpy0q62mfmmw0000gn/T/ by default

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).

pulumi-bot commented 2 months ago

This issue has been addressed in PR #1374 and shipped in release v2.15.0.

MitchellGerdisch commented 1 month ago

I'm seeing this issue in release 2.16.1

pierskarsenbarg commented 1 month ago

This wasn't fixed in v2.15.0 either

If it helps, I'm now seeing this as a warning:

warning: The default subnetStrategy will change from "Legacy" to "Auto" in the next major version. Please specify the subnetStrategy explicitly. The current subnet layout can be specified via "Auto" as:

    [
      {
        "cidrMask": "Calling [toJSON] on an [Output<T>] is not supported.\n\nTo get the value of an Output as a JSON value or JSON string consider either:\n    1: o.apply(v => v.toJSON())\n    2: o.apply(v => JSON.stringify(v))\n\nSee https://www.pulumi.com/docs/concepts/inputs-outputs for more details.\nThis function may throw in a future version of @pulumi/pulumi.",
        "type": "Calling [toJSON] on an [Output<T>] is not supported.\n\nTo get the value of an Output as a JSON value or JSON string consider either:\n    1: o.apply(v => v.toJSON())\n    2: o.apply(v => JSON.stringify(v))\n\nSee https://www.pulumi.com/docs/concepts/inputs-outputs for more details.\nThis function may throw in a future version of @pulumi/pulumi."
      }
    ]
pulumi-bot commented 1 week ago

This issue has been addressed in PR #1395 and shipped in release v2.17.0.