pulumi.all level-pro with multiple Output<string> into string
See original GitHub issueHi 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:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Many many thanks @pgavlin
I think things will work out if you change the type from
aws.types.output.elasticbeanstalk.ConfigurationTemplateSetting
toaws.types.input.elasticbeanstalk.ConfigurationTemplateSetting
.