broad-belgium-4685
05/06/2020, 1:45 AMwooden-room-54680
05/09/2020, 3:18 PMOutput<ImmutableArray<T>>
, if I try to use Linq it doesn't create the resources. I have a workaround where I don't use Linq, but is there a better way to write this? I put my use case here https://gist.github.com/fracek/a94ff73d42b8f1aa180abe885982f7a4tall-librarian-49374
05/09/2020, 7:34 PMApply
calls. I think they should still be created but you may not see them in preview. A solution with a outside Apply
would be preferred.wooden-room-54680
05/09/2020, 8:20 PMApply
and Add the resources inside the Apply
?tall-librarian-49374
05/10/2020, 6:48 AMadventurous-garage-59192
05/11/2020, 4:24 AMOutput.Format
with a couple of sensitive values. In the old async stack system I used Output.CreateSecret()
successfully, but I discovered in the new stack model that it wraps the output I give it, resulting in a signature of Output<Output<string>>
, so I'm guessing it was never supposed to work that way.adventurous-garage-59192
05/11/2020, 4:32 AMAdditionalSecretOutputs
on the resource property I wanted hidden, but that didn't do anything and I still got a plaintext string as the output.millions-journalist-34868
05/11/2020, 12:06 PMplain-tiger-79744
05/11/2020, 3:51 PMmysterious-australia-14256
05/16/2020, 10:12 AMvar webApp = new AppService(name, new AppServiceArgs
{
ClientAffinityEnabled = false,
HttpsOnly = true,
}
I then wanted to create a deployment slot with the same setting. I was hoping to be able to pass the webApp in and read the settings in its AppServiceArgs and use them to apply to the SlotArgs (to ensure that they ended up identical) e.g.
var webAppSlot = new Slot(name, new SlotArgs
{
ClientAffinityEnabled = webApp.ClientAffinityEnabled,
HttpsOnly = webApp.HttpsOnly,
}
This seems to work for the ClientAffinityEnabled setting but for the HttpsOnly setting I get an error...
Cannot implicitly convert type 'Pulumi.Output<bool?>' to 'Pulumi.Input<bool>'
Why are ClientAffinityEnabled and HttpsOnly behaving differently and is there a way to be able to read the HttpsOnly setting from the webApp and apply it to the slot App?
Thanks
Alanmysterious-australia-14256
05/17/2020, 8:33 PMprivate static void CopyArgs(Object source, Object target)
{
foreach (var sourceProp in source.GetType().GetProperties())
{
var targetProp = target.GetType().GetProperty(sourceProp.Name);
switch (sourceProp.PropertyType.ToString())
{
case "Pulumi.Input`1[System.Boolean]":
case "Pulumi.Input`1[System.String]":
if (targetProp != null) targetProp.SetValue(child, sourceProp.GetValue(parent), null);
break;
default:
break;
}
}
}
The problem comes when handling more complex types such as the SiteConfig which is of Type Pulumi.Azure.AppService.Inputs.AppServiceSiteConfigArgs in the parent object
That is wrapped as a Pulumi.Input which means I need to call Apply to get at the contents
I can manage that adding another case like this that determines the Types of the new, next level objects (e,g, the AppServiceSiteConfigArgs and SlotSiteConfigArgs in the case of SiteConfig) and then recursively calls the CopyArgs method with them as arguments...
case "Pulumi.Input`1[Pulumi.Azure.AppService.Inputs.AppServiceSiteConfigArgs]":
var newSource = (Input<AppServiceSiteConfigArgs>)sourceProp.GetValue(source)!;
if (newSource != null)
{
newSource.Apply(x =>
{
var newTargetProp = target.GetType().GetProperty(sourceProp.Name);
if (newTargetProp != null)
{
var newTarget = (Input<SlotSiteConfigArgs>)newTargetProp.GetValue(target)!;
if (newTarget != null)
{
newTarget.Apply(y =>
{
CopyArgs(x, y);
return y;
});
}
}
return x;
});
}
break;
The problem with the above is that I have hard coded in casts for (Input<AppServiceSiteConfigArgs>) and (Input<SlotSiteConfigArgs>) which means I would need a new case for each potential type. What I'd really like to do is to be able to determine the types by reflection (so I can create newSource and newTarget in the above without the fixed casts) and call the appropriate Apply methods, presumably using an Invoke command. Unfortunately I haven't been able to work out how to do that and successfully. It seems quite complicated with the mix of generics and extension methods :(
If anyone has any tips they would be greatly appreciated!
Thanks
Alanwet-noon-14291
05/21/2020, 7:14 PMpulumi up
with the raw source available?wet-noon-14291
05/26/2020, 6:58 AMgetStack
in dotnet? I can't find.wet-noon-14291
05/26/2020, 7:57 AMInputUnion
in F#? I'm using InputUnion.op_Implicit(80)
, and that isn't pretty 🙂limited-carpenter-34991
05/27/2020, 2:34 PMvar resourceGroup = ResourceGroup.Get("resourceGBla", "/subscriptions/4711/resourceGroups/resourceGBla")
and use it for a storage account, ResourceGroupName = resourceGroup.Name or ResourceGroupName = resourceGroup.Name.ToString() , it doesn't work. If i read in an existing resource, it is then possible to import the resource inside the stack ?limited-carpenter-34991
05/28/2020, 11:20 AMlimited-carpenter-34991
05/28/2020, 11:58 AMvar servicePrincipal = new ServicePrincipal("sp-superUser", new ServicePrincipalArgs
{
ApplicationId = application.ApplicationId,
});
quick-motorcycle-17856
05/28/2020, 12:55 PMfresh-summer-65887
05/28/2020, 8:32 PMfast-dinner-32080
05/28/2020, 10:12 PMplain-tiger-79744
06/03/2020, 5:14 PMawait akvClient.ImportKeyAsync("***.<http://vault.azure.net|vault.azure.net>", "MyKey", existingJsonWebkey);
limited-carpenter-34991
06/09/2020, 9:19 AMNullability of reference types in value of type 'Output<string?>' doesn't match target type 'Output<string>'.
shy-garage-48328
06/09/2020, 3:13 PMlimited-carpenter-34991
06/10/2020, 7:58 PMboundless-tailor-35598
06/19/2020, 9:53 AMbroad-dog-22463
06/19/2020, 9:55 AMbroad-dog-22463
06/19/2020, 9:55 AMvar azs = Pulumi.Aws.GetAvailabilityZones.InvokeAsync(new Pulumi.Aws.GetAvailabilityZonesArgs()).Result;
var hostnames = new List<Input<string>>();
var ips = new List<Input<string>>();
foreach (var az in azs.Names)
{
var server = new Pulumi.Aws.Ec2.Instance($"web-server-{az}", new Pulumi.Aws.Ec2.InstanceArgs
{
InstanceType = "t2.micro",
VpcSecurityGroupIds = {group.Id},
UserData = userData,
Ami = ami.Apply(a => a.Id),
AvailabilityZone = az,
});
hostnames.Add(server.PublicDns);
ips.Add(server.PublicIp);
}
boundless-tailor-35598
06/19/2020, 9:55 AMbroad-dog-22463
06/19/2020, 9:56 AMboundless-tailor-35598
06/19/2020, 9:56 AMboundless-tailor-35598
06/19/2020, 9:56 AM