mysterious-australia-14256
04/25/2020, 3:24 PMvar rgName = proj.RequireObject("ResourceGroupName").Apply(name => name.ToString());
rgName ends up being of type Output<string?> i.e. it can be null because this is what ToString returns even though I'm using RequireObject
When I then cone to use rgName in my code to get the resource group
var rg = rgName.Apply(rgName => GetResourceGroup.InvokeAsyn(new GetResourceGroupArgs { Name = rgName } ));
I get a warning about a possible null reference assignment as I am passing in Output<string?>? rather than Output<string> which is what GetResourceGroupArgs wants for Name.
The code works and I can hide the error using ! (i.e. { Name = rgName! }) but is there a cleaner way to do this i.e. get the value from RequireObject as Output<string> in the first place rather than Output<string?>name => (string)name
tall-librarian-49374
04/25/2020, 8:32 PMproj
in your example? A Config
?Require
instead of RequireObject<T>
that returns a string directly?mysterious-australia-14256
04/26/2020, 7:52 AMproj
is a StackReference to another project so I am using RequireOutput
, don't think Require is an option?