pulumi / pulumi-aws-apigateway

Apache License 2.0
13 stars 5 forks source link

Can't access API and Stage objects in Go #12

Closed danielrbradley closed 2 years ago

danielrbradley commented 2 years ago

Hello!

Issue details

When creating a RestAPI, the outputs contain Api and Stage but neither of these properties are correctly typed. This means we can't access the output properties in order to depend on them for other resources.

Steps to reproduce

restAPI, err := apigateway.NewRestAPI(ctx, "api", &apigateway.RestAPIArgs{...}
ctx.Export("api-id", restAPI.Api.ID()) // restAPI.Api.ID undefined (type apigateway.RestApiOutput has no field or method ID)
ctx.Export("api-stage", restAPI.Stage.StateName) // restAPI.Stage.StateName undefined (type apigateway.StageOutput has no field or method StateName)

This appears to be due to the output types being empty:

type RestApiOutput struct{ *pulumi.OutputState }
type StageOutput struct{ *pulumi.OutputState }
danielrbradley commented 2 years ago

This actually affects all languages. Even though the typings are available in Typscript and Python doesn't error because the type is Any, there is no output values for api and stage in the stack outputs. The only output property that's available is the URL of the endpoint