pulumi / pulumi-aws-native

AWS Native Provider for Pulumi
Apache License 2.0
95 stars 17 forks source link

Pulumi fails to handle output->string for awsnative apprunner runtimeEnvironmentVariables #793

Closed olimcc closed 8 months ago

olimcc commented 1 year ago

What happened?

I am attemtping to migrate an AppRunner service from aws. to awsnative., using the Typescript API.

The API transition itself was straightforward, however I'm hitting an issue with setting environment variables based on Pulumi outputs. The error is happening outside of Pulumi, and looks like Pulumi outputs are not being handled appropriately, yielding the following error:

operation error CloudControl: UpdateResource, https response error StatusCode: 400, RequestID: c5a399bc-99a6-4b22-994d-14cf8843d7e1, api error ValidationException: Model validation failed (#/SourceConfiguration/ImageRepository/ImageConfiguration/RuntimeEnvironmentVariables/0/Value: expected type: String, found: JSONObject

Expected Behavior

This was a direct translation, so I expected to be able to set these values similarly to how I had done previously. I've tried a couple of varieties of apply(..) to no avail.

Steps to reproduce

The prior, functioning case:

const serviceRuntimeVars = {
    "FOO": someOutput,
}

const service = new aws.apprunner.Service(
   ...
   imageRepository: {
      imageConfiguration: {
           runtimeEnvironmentVariables: serviceRuntimeVars
       }
   }
)

With awsnative:

const serviceRuntimeVars: awsnative.types.input.apprunner.ServiceKeyValuePairArgs[] = [
    {name: "FOO", value: someOutput}
]

const service = new awsnative.apprunner.Service(
   ...
   imageRepository: {
      imageConfiguration: {
           runtimeEnvironmentVariables: serviceRuntimeVars
       }
   }
)

Which results in error.

Output of pulumi about

CLI Version 3.53.1 Go Version go1.19.5 Go Compiler gc

Plugins NAME VERSION aws 5.26.0 aws-native 0.47.0 awsx 1.0.1 docker 3.6.1 mongodbatlas 3.5.2 nodejs unknown

Host OS darwin Version 12.1 Arch arm64

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

squaremo commented 1 year ago

Hi, thanks for posting this. I can see why this is puzzling! It'd help to know

denisw commented 1 year ago

I suspect that this has the same root cause as #821.