rhythmic-vegetable-87369
01/21/2020, 3:54 AMrhythmic-vegetable-87369
01/21/2020, 5:36 AMrhythmic-vegetable-87369
01/21/2020, 5:37 AMadventurous-garage-59192
01/21/2020, 5:39 AMParameters
adventurous-garage-59192
01/21/2020, 5:39 AMvar siteExtension = new TemplateDeployment("nr-ext", new TemplateDeploymentArgs
{
DeploymentMode = "Incremental",
ResourceGroupName = rgname,
TemplateBody = File.ReadAllText("siteextension.json"),
Parameters = {{"siteName", app.Name}, {"extensionName", "NewRelic.Azure.WebSites.Extension" }, {"extensionVersion", "1.5.0"} }
});
dry-raincoat-51244
01/22/2020, 12:57 PMdelightful-lizard-41466
01/25/2020, 11:12 AMdelightful-lizard-41466
01/29/2020, 10:57 AMstocky-spoon-28903
01/30/2020, 2:30 PMstocky-spoon-28903
01/30/2020, 2:30 PMsetup-dotnet
task and the action-install-pulumi-cli
task to get a working envrionment: https://github.com/cecton/mbrmanlittle-kangaroo-50941
02/03/2020, 4:19 PMlittle-kangaroo-50941
02/03/2020, 4:23 PMlittle-kangaroo-50941
02/03/2020, 4:24 PMdelightful-dawn-43855
02/06/2020, 10:56 AMvar servicebusnamespace = new Namespace($"{standardPrefixName}-sb", new NamespaceArgs
{
ResourceGroupName = resourceGroup.Name,
Sku = "Standard",
ZoneRedundant = false,
});
Pulumi.Azure.ServiceBus.QueueArgs DefaultQueueSetting = new Pulumi.Azure.ServiceBus.QueueArgs
{
ResourceGroupName = resourceGroup.Name,
NamespaceName = servicebusnamespace.Name,
MaxSizeInMegabytes = 1024,
LockDuration = "PT5M",
RequiresDuplicateDetection = true,
RequiresSession = false,
DefaultMessageTtl = "PT12H",
DeadLetteringOnMessageExpiration = true,
MaxDeliveryCount = 10,
EnablePartitioning = true,
};
DefaultQueueSetting.Name = KnownQueues.UpdatedCompany;
var updatedcompanyQueue = new Queue(KnownQueues.UpdatedCompany, DefaultQueueSetting);
DefaultQueueSetting.Name = KnownQueues.UpdatedPanel;
var UpdatedPanelQueue = new Queue(KnownQueues.UpdatedPanel, DefaultQueueSetting);
delightful-lizard-41466
02/11/2020, 3:38 PMfreezing-waiter-91293
02/12/2020, 12:33 PMstocky-crayon-93563
02/12/2020, 6:16 PMfuture-kite-91191
02/19/2020, 8:04 AMOutput<string>
var randomStringResult = string.Empty;
var randomString = new RandomPassword("random", new RandomPasswordArgs() { Length = 63 }).Result.Apply(v => randomStringResult = v);
I'm probably missing something obvious here?
I need to generate a random password and need access to the generated string resultmillions-journalist-34868
02/19/2020, 12:40 PMfuture-kite-91191
02/20/2020, 4:08 PMPulumi.Azure.KeyVault.Secret.Get("Redis--Password", keyVault.Id).Vault
bored-jordan-47264
02/21/2020, 5:16 PMgetOutput
then cast it to the correct type, but when I export using dotnet it exports a string. Are there any docs for this?straight-flower-13757
02/22/2020, 4:51 AMComponentResource
I have something similar to this in the Deployment.RunAsync
like
return Deployment.RunAsync(async () =>
{
var assumeRoleDocument = await Pulumi.Aws.Iam.Invokes.GetPolicyDocument(new Pulumi.Aws.Iam.GetPolicyDocumentArgs
{
Statements = {
...
}
}
});
var ecsPolicyRole = new Pulumi.Aws.Iam.Role($"{name}-ecs-role", new Pulumi.Aws.Iam.RoleArgs
{
AssumeRolePolicy = assumeRoleDocument.Json
});
});
Now I’m trying to move that into a dedicated module, using ComponentResource
What is your recommendation for doing that since I can’t await in the constructor of the custom ComponentResource
?
I did this hack, but not sure if I’m missing something that will make it more straight forward:
public class EcsService : ComponentResource
{
public EcsService(string name, EcsServiceResourceOptions options)
: base("foo:pulumi:ecs", name, options)
{
var assumeRoleDocument = Pulumi.Aws.Iam.Invokes.GetPolicyDocument(new Pulumi.Aws.Iam.GetPolicyDocumentArgs
{
Statements = {
...
}
}
});
var ecsPolicyRole = new Pulumi.Aws.Iam.Role($"{name}-ecs-role", new Pulumi.Aws.Iam.RoleArgs
{
AssumeRolePolicy = Output.Create("").Apply(async _ => (await assumeRoleDocument).Json) //getting advantage of the built in Output type and its Apply func
}, new CustomResourceOptions { Parent = this });
}
}
little-kangaroo-50941
02/24/2020, 9:54 AMstraight-flower-13757
02/27/2020, 5:32 PMComponentResource
like
public class EcsService : ComponentResource
{
public EcsService(string name, EcsServiceResourceOptions options)
: base("foo:pulumi:ecs", name, options)
{
...
var parameters = new List<Pulumi.Aws.Ssm.Parameter>();
foreach (KeyValuePair<string, string> variable in options.EnvironmentVariables) // EnvironmentVariables is InputMap<string>
{
var Parameter = new Pulumi.Aws.Ssm.Parameter(variable.Key,
...
, new CustomResourceOptions { Parent = this });
parameters.Add(Parameter);
}
...
}
}
I’m trying to use this component like:
class Program
{
static Task<int> Main()
{
return Deployment.RunAsync(() =>
{
var config = new Config();
var environmentVariables = new InputMap<string>();
foreach (var item in config.RequireObject<JsonElement>("environmentVariables").EnumerateObject()) //those environmentVariables are inserted as pulumi config set --path environmentVariables.foo val .. etc
environmentVariables.Add(item.Name, item.Value.GetString());
var service = new EcsService(config.Require("name"), new EcsServiceResourceOptions
{
...
EnvironmentVariables = environmentVariables,
...
});
}
I’m getting the following exception:
error: Running program '....' failed with an unhandled exception:
System.NotSupportedException: A Pulumi.InputMap`1[[System.String, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]] cannot be synchronously enumerated. Use GetAsyncEnumerator instead.
But I can’t await the foreach in the constructor of EcsService
, any advice ?
And what you think around the way I’m importing multiple key/value pairs from config into an InputMap<string>, is there better way ?little-kangaroo-50941
02/27/2020, 10:17 PMambitious-apartment-7017
03/07/2020, 2:29 PMstale-address-4911
03/11/2020, 9:04 AMfast-dinner-32080
03/11/2020, 5:16 PMerror: Running program '/repos/pulumi-projects/rancher-server-cluster/bin/Debug/netcoreapp3.1/rancher-server-cluster.dll' failed with an unhandled exception:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.MissingMethodException: Method not found: 'Void Pulumi.ProviderResource..ctor(System.String, System.String, Pulumi.ResourceArgs, Pulumi.ResourceOptions)'.
at Pulumi.VSphere.Provider..ctor(String name, ProviderArgs args, ResourceOptions options)
at RancherServerCluster..ctor() in /repos/pulumi-projects/rancher-server-cluster/RancherServerCluster.cs:line 19
--- End of inner exception stack trace ---
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean wrapExceptions, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& hasNoDefaultCtor)
at System.RuntimeType.CreateInstanceDefaultCtorSlow(Boolean publicOnly, Boolean wrapExceptions, Boolean fillCache)
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, Boolean wrapExceptions)
at System.Activator.CreateInstance[T]()
at Pulumi.Deployment.Runner.RunAsync[TStack]()
fast-dinner-32080
03/11/2020, 9:29 PMfast-dinner-32080
03/12/2020, 12:37 AMSize = args.VmTemplate.Apply(x => x.Disks[0].Size ) + args.SrvExtendSize
as well as
Size = args.VmTemplate.Apply(x => x.Disks[0].Size ) + args.SrvExtendSize.ToOutput()
So I must be missing something