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.

pulumi.all level-pro with multiple Output<string> into string

See original GitHub issue

Hi there guys,

Many thanks for providing this awesome tool! I just bumped into something a bit tricky trying to create an ELB configuration template with a large number of deps. Here is a minimal example

import * as aws from "@pulumi/aws";
import * as awsx from "@pulumi/awsx";
import * as pulumi from "@pulumi/pulumi";

import {
  createSecurityGroupArgs,
  createVpcArgs,
} from "./src/args/ec2";
import { createStackConfig } from "./src/stack";

const stackConfig = new pulumi.Config("application-backend");
const config = createStackConfig(stackConfig);

const customVpc = new awsx.ec2.Vpc("custom", createVpcArgs(config));

const securityGroup = new aws.ec2.SecurityGroup(
  "security-group",
  createSecurityGroupArgs(config, customVpc)
);

const settings: aws.types.output.elasticbeanstalk.ConfigurationTemplateSetting[] =  ([
  {
    name: "VPCId",
    namespace: "aws:ec2:vpc",
    value: customVpc.id,
  },
  {
    namespace: "aws:autoscaling:launchconfiguration",
    name: "SecurityGroups",
    value: securityGroup.id,
  }
]);

Of course that’s a naughty thing to do

Type ‘Output<string>’ is not assignable to type ‘string’

One should use pulumi.all but

  • it’s really complicated&error prone, when you need to convert say 7 outputs into strings
  • it doesn’t “spark joy”

Is that the only way to go? Is there no better way to get this off the ground?

This issue seems related to other, existing ones

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
jandomcommented, Jan 24, 2020

Many many thanks @pgavlin

1reaction
pgavlincommented, Jan 24, 2020

I think things will work out if you change the type from aws.types.output.elasticbeanstalk.ConfigurationTemplateSetting to aws.types.input.elasticbeanstalk.ConfigurationTemplateSetting.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Intro to Pulumi: Inputs and Outputs
a type that permits either a raw value of a given type (such as string, ... If you have multiple outputs and need...
Read more >
Functions Now Accept Outputs | Pulumi Blog
Every function now has an additional Output form that accepts Input -typed arguments and returns an Output -wrapped result. For a quick example, ......
Read more >
Understanding Stack Outputs - Pulumi
In this part, we're going to explore stack outputs. Stack outputs are, as you might guess, the values exported from any given stack....
Read more >
Class Output - Pulumi
Conceptually, this method unwraps all the underlying values in the holes, combines them appropriately with the System.FormattableString.Format string, and ...
Read more >
pulumi stack output
By default, this command lists all output properties exported from a stack. ... as secret in plaintext Options inherited from parent commands --color...
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