question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't create a Target Group in C#

See original GitHub issue

Hello!

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

Issue details

When I try to create a target group, I get an error which prevents the rest of my pulumi up command from working. I’m using version 4.25.0. I’ve tried dropping down many versions and they all produce the same errror.

Note that error only pops up intermittently. Most of the time, I will get the error, but in rare occasions (< 5% of the time) I don’t get an error.

Steps to reproduce

  1. Start a new C# project with pulumi new aws-csharp
  2. Create a new target group within the stack (this is an exerpt straight out of the samples but using Pulumi.Aws.LB instead of the deprecated Pulumi.Aws.ElasticLoadBalancingV2 (which also produces the same error)
using Pulumi;
using Ec2 = Pulumi.Aws.Ec2;
using Elb = Pulumi.Aws.LB;

class MyStack : Stack
{
    public MyStack()
    {
        // Read back the default VPC and public subnets, which we will use.
        var vpc = Output.Create(Ec2.GetVpc.InvokeAsync(new Ec2.GetVpcArgs { Default = true }));
        var vpcId = vpc.Apply(vpc => vpc.Id);
        var webTg = new Elb.TargetGroup("web-tg", new Elb.TargetGroupArgs
        {
            Port = 80,
            Protocol = "HTTP",
            TargetType = "ip",
            VpcId = vpcId
        });
    }
}
  1. Run with pulumi up

Expected: Everything to run fine and the AWS target group should be generated

Actual:

Diagnostics:
  pulumi:pulumi:Stack (app-dev):
    error: Running program 'app.dll' failed with an unhandled exception:
    System.InvalidOperationException: Expected System.Double but got System.String deserializing Pulumi.Aws.LB.TargetGroup.deregistrationDelay
       at object Pulumi.Serialization.Converter.ConvertObject(string context, object val, Type targetType)
       at OutputData<object> Pulumi.Serialization.Converter.ConvertValue(string context, Value value, Type targetType, ImmutableHashSet<Resource> resources)
       at async Task Pulumi.Deployment.CompleteResourceAsync(Resource resource, bool remote, Func<string, Resource> newDependency, ResourceArgs args, ResourceOptions options, ImmutableDictionary<string, IOutputCompletionSource> completionSources)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
stack72commented, Oct 29, 2021

Ok folks, I have identified the issue here in our bridge code and a fix in on the way! I am sorry about this

Paul

1reaction
Frasslecommented, Oct 29, 2021

Reproduced on my machine, can confirm that the deregistrationDelay property is coming back as a string from the provider. https://github.com/pulumi/pulumi/pull/8286 will provide a work around for this as long as deregistrationDelay isn’t actually used. There is also an underlying bug in the provider that we think this should be an int but it’s coming back as a string, I guess we need a shim to just call parseInt on the string returned from terraform.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Target groups for your Application Load Balancers
When you create a target group, you specify its target type, which determines the type of target you specify when registering targets with...
Read more >
Can't use an existing Target Group when creating a new AWS ...
I'm trying to create a new ECS Service on an Application Load Balancer. When I get to the step to add the container...
Read more >
cannot have more than one target group on a single NLB ...
NLB listeners currently allow for more than one target group to be ... The following resource(s) failed to create: [NLBlistener1B46F543D].
Read more >
DescribeTargetGroups - Elastic Load Balancing - 亚马逊云科技
Describes the specified target groups or all of your target groups. By default, all target groups are ... The specified load balancer does...
Read more >
Subscriptions Terms & Conditions - Target
If we are unable to complete an order with the credit card or Target Debit Card that you used to create your subscription,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found