Open flostadler opened 1 month ago
Indeed, this is very unfortunate. Are some of the resources more important for your use case than other resources? Trying to see what our options are here, fixing the entire list necessitates breaking changes that need to wait until the v7, but some of the smaller ones can be possibly tidied up before v7 taking a minor break. Full list:
schema_test.go:38: Dangling reference: aws:alb/ipAddressType:IpAddressType (isRes=false)
schema_test.go:38: Dangling reference: aws:alb/loadBalancerType:LoadBalancerType (isRes=false)
schema_test.go:38: Dangling reference: aws:apigateway/deployment:Deployment (isRes=true)
schema_test.go:38: Dangling reference: aws:apigateway/restApi:RestApi (isRes=true)
schema_test.go:38: Dangling reference: aws:autoscaling/metrics:Metric (isRes=false)
schema_test.go:38: Dangling reference: aws:autoscaling/notificationType:NotificationType (isRes=false)
schema_test.go:38: Dangling reference: aws:cloudwatch/logGroup:LogGroup (isRes=true)
schema_test.go:38: Dangling reference: aws:ec2/launchConfiguration:LaunchConfiguration (isRes=true)
schema_test.go:38: Dangling reference: aws:ec2/placementGroup:PlacementGroup (isRes=true)
schema_test.go:38: Dangling reference: aws:ecr/lifecyclePolicyDocument:LifecyclePolicyDocument (isRes=false)
schema_test.go:38: Dangling reference: aws:elasticbeanstalk/application:Application (isRes=true)
schema_test.go:38: Dangling reference: aws:elasticbeanstalk/applicationVersion:ApplicationVersion (isRes=true)
schema_test.go:38: Dangling reference: aws:iam/Role:Role (isRes=false)
schema_test.go:38: Dangling reference: aws:iam/documents:PolicyDocument (isRes=false)
schema_test.go:38: Dangling reference: aws:iam/group:Group (isRes=true)
schema_test.go:38: Dangling reference: aws:iam/instanceProfile:InstanceProfile (isRes=true)
schema_test.go:38: Dangling reference: aws:iam/role:Role (isRes=true)
schema_test.go:38: Dangling reference: aws:iam/user:User (isRes=true)
schema_test.go:38: Dangling reference: aws:index/aRN:ARN (isRes=false)
schema_test.go:38: Dangling reference: aws:index/region:Region (isRes=false)
schema_test.go:38: Dangling reference: aws:iot/policy:Policy (isRes=true)
schema_test.go:38: Dangling reference: aws:lambda/function:Function (isRes=true)
schema_test.go:38: Dangling reference: aws:rds/engineType:EngineType (isRes=false)
schema_test.go:38: Dangling reference: aws:s3/bucket:Bucket (isRes=true)
schema_test.go:38: Dangling reference: aws:s3/routingRules:RoutingRule (isRes=false)
schema_test.go:38: Dangling reference: aws:sns/topic:Topic (isRes=true)
The remediation for https://github.com/pulumi/pulumi-aws/issues/2565 we're looking at right now produces a side-by-side schema that has the references corrected, that does not fix the SDKs though (intentionally).
Let me have a quick look at the repro to see if there's any other remediation ideas.
As a workaround it should be possible to unit test in languages other than Node where the overlays are not present perhaps, like Python.
From
new aws.iam.RolePolicyAttachment("test-policy",
{
policyArn: "test",
role: "test", //works
},
);
Another workaround would be to use the string-passing forms instead of the overlay union types correct?
@t0yv0 For my use cases with the MLCs we cannot switch the language as they're already written in node. For other users I feel like the language decision shouldn't be made based on this, but rather what they're most comfortable using. I.e., re-writing their infra to another language isn't really anything I'd expect users to do in order to work around this bug.
Changing the code to use the string passing forms is definitely a viable workaround. Having to make code changes to get tests to work is not really intuitive for users though. Especially because the error message doesn't hint at this being the issue at all.
In terms of what dangling refs have the biggest impact, I'd say it's the iam
resources (Role, InstanceProfile, et al.) as they're some of the most commonly used resources. At the same time this most likely means we cannot take a breaking change because they're so widely used.
Describe what happened
When unit testing with jest in node I'm getting failures for resources with dangling type refs:
The interesting bit is:
The provider currently has multiple resources with dangling refs, see: https://github.com/pulumi/pulumi-aws/issues/2565. One example is the
role
property of theaws.iam.RolePolicyAttachment
resource.Sample program
Log output
No response
Affected Resource(s)
No response
Output of
pulumi about
pulumi v3.134.1
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).