nutritious-air-21788
03/18/2024, 3:33 PMOutput
can be an Input
to some other resource).
In particular, I was testing creating a VPC with pre-existing IPs (eg IPs that are allowlisted for various things far outside of my control)
var allocatedIps = new List<Eip>
{
Eip.Get(...)
...
}
var eksVpc = new Ec2.Vpc("eks-vpc", new()
{
...
NatGateways = new Ec2.Inputs.NatGatewayConfigurationArgs
{
Strategy = Ec2.NatGatewayStrategy.OnePerAz,
ElasticIpAllocationIds = allocatedIps.Select(x => (Input<string>) x.AllocationId).ToList()
}
}
This feels very weird, but it works. Is there a better way? Am I missing something?bored-activity-40468
03/19/2024, 9:16 PMvar eips = Output.Create(GetEips.InvokeAsync(new GetEipsArgs
{
Filters = new List<GetEipsFilterArgs>()
})).Apply(result =>
{
//shape result
return new List<string>();
});
nutritious-air-21788
03/20/2024, 3:02 PMbored-activity-40468
03/20/2024, 3:10 PMbored-activity-40468
03/20/2024, 3:14 PMOutput<List<string>> eips = Output.Create(GetEips.InvokeAsync(new GetEipsArgs
{
Filters = new List<GetEipsFilterArgs>()
})).Apply(result =>
{
//shape result
return new List<string>();
});
Output<GetEipsResult> eips2 = Output.Create(GetEips.InvokeAsync(new GetEipsArgs
{
Filters = new List<GetEipsFilterArgs>()
}));
nutritious-air-21788
03/20/2024, 3:45 PMInvokeAsync
directly with whatever expects it. the differentiation between “output that might eventually return” (eg creation of a vpc, whatever) and “output that returns immediately” (get me a list of vpcs) especially with a lack of explicit casting feels fairly unergonomicbored-activity-40468
03/20/2024, 3:50 PMElasticIpAllocationIds = eips2.Apply(e => e.AllocationIds);
?nutritious-air-21788
03/20/2024, 5:59 PMElasticIpAllocationIds = GetEips.InvokeAsync(…)