Skip to content

Commit

Permalink
Merge pull request pulumi#648 from pulumi/mikhailshilkov/dotnet-20
Browse files Browse the repository at this point in the history
Update .NET examples to 2.0 betas
  • Loading branch information
jaxxstorm committed Apr 15, 2020
2 parents afb0bbe + a89b661 commit f824737
Show file tree
Hide file tree
Showing 38 changed files with 89 additions and 91 deletions.
4 changes: 2 additions & 2 deletions aws-cs-eks/Aws.EksCluster.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Pulumi.Aws" Version="1.30.0-preview" />
<PackageReference Include="Pulumi.Kubernetes" Version="1.6.0-preview" />
<PackageReference Include="Pulumi.Aws" Version="2.0.0-beta.3" />
<PackageReference Include="Pulumi.Kubernetes" Version="2.0.0-beta.2" />
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions aws-cs-fargate/Infra/Aws.Fargate.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Pulumi.Aws" Version="1.27.0-preview" />
<PackageReference Include="Pulumi.Docker" Version="1.4.0-preview" />
<PackageReference Include="Pulumi.Aws" Version="2.0.0-beta.3" />
<PackageReference Include="Pulumi.Docker" Version="1.5.0-preview" />
</ItemGroup>

</Project>
10 changes: 5 additions & 5 deletions aws-cs-fargate/Infra/FargateStack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ class FargateStack : Stack
public FargateStack()
{
// Read back the default VPC and public subnets, which we will use.
var vpc = Output.Create(Ec2.Invokes.GetVpc(new Ec2.GetVpcArgs {Default = true}));
var vpc = Output.Create(Ec2.GetVpc.InvokeAsync(new Ec2.GetVpcArgs {Default = true}));
var vpcId = vpc.Apply(vpc => vpc.Id);
var subnet = vpcId.Apply(id => Ec2.Invokes.GetSubnetIds(new Ec2.GetSubnetIdsArgs {VpcId = id}));
var subnet = vpcId.Apply(id => Ec2.GetSubnetIds.InvokeAsync(new Ec2.GetSubnetIdsArgs {VpcId = id}));
var subnetIds = subnet.Apply(s => s.Ids);

// Create a SecurityGroup that permits HTTP ingress and unrestricted egress.
Expand Down Expand Up @@ -90,7 +90,7 @@ public FargateStack()
Port = 80,
DefaultActions =
{
new Elb.Inputs.ListenerDefaultActionsArgs
new Elb.Inputs.ListenerDefaultActionArgs
{
Type = "forward",
TargetGroupArn = webTg.Arn,
Expand All @@ -102,7 +102,7 @@ public FargateStack()
var appRepo = new Ecr.Repository("app-repo");
var appRepoCredentials = appRepo.RegistryId.Apply(async rid =>
{
var credentials = await Ecr.Invokes.GetCredentials(new Ecr.GetCredentialsArgs {RegistryId = rid});
var credentials = await Ecr.GetCredentials.InvokeAsync(new Ecr.GetCredentialsArgs {RegistryId = rid});
var data = Convert.FromBase64String(credentials.AuthorizationToken);
return Encoding.UTF8.GetString(data).Split(":").ToImmutableArray();
});
Expand Down Expand Up @@ -151,7 +151,7 @@ public FargateStack()
},
LoadBalancers =
{
new Ecs.Inputs.ServiceLoadBalancersArgs
new Ecs.Inputs.ServiceLoadBalancerArgs
{
TargetGroupArn = webTg.Arn,
ContainerName = "my-app",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
<AWSProjectType>Lambda</AWSProjectType>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion aws-cs-lambda/pulumi/Aws.Lambda.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Pulumi.Aws" Version="1.27.0-preview" />
<PackageReference Include="Pulumi.Aws" Version="2.0.0-beta.3" />
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions aws-cs-lambda/pulumi/LambdaStack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ public LambdaStack()
{
var lambda = new Function("basicLambda", new FunctionArgs
{
Runtime = "dotnetcore2.1",
Code = new FileArchive("../DotnetLambda/src/DotnetLambda/bin/Debug/netcoreapp2.1/publish"),
Runtime = "dotnetcore3.1",
Code = new FileArchive("../DotnetLambda/src/DotnetLambda/bin/Debug/netcoreapp3.1/publish"),
Handler = "DotnetLambda::DotnetLambda.Function::FunctionHandler",
Role = CreateLambdaRole().Arn
});
Expand Down
2 changes: 1 addition & 1 deletion aws-cs-webserver/Aws.WebServer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Pulumi.Aws" Version="1.27.0-preview" />
<PackageReference Include="Pulumi.Aws" Version="2.0.0-beta.3" />
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions aws-cs-webserver/WebServerStack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ class WebServerStack : Stack
{
public WebServerStack()
{
var ami = Output.Create(Pulumi.Aws.Invokes.GetAmi(new GetAmiArgs
var ami = Output.Create(GetAmi.InvokeAsync(new GetAmiArgs
{
MostRecent = true,
Owners = {"137112412989"},
Filters = {new GetAmiFiltersArgs {Name = "name", Values = {"amzn-ami-hvm-*"}}}
Filters = {new GetAmiFilterArgs {Name = "name", Values = {"amzn-ami-hvm-*"}}}
}));

var group = new SecurityGroup("web-secgrp", new SecurityGroupArgs
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
<DebugType>portable</DebugType>
<OutputType>Exe</OutputType>
<EnableDefaultContentItems>false</EnableDefaultContentItems>
Expand Down
4 changes: 2 additions & 2 deletions aws-fs-lambda-webserver/pulumi/Aws.LambdaWebServer.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Pulumi.Aws" Version="1.27.0-preview" />
<PackageReference Include="Pulumi.FSharp" Version="1.12.1-preview" />
<PackageReference Include="Pulumi.Aws" Version="2.0.0-beta.3" />
<PackageReference Include="Pulumi.FSharp" Version="2.0.0-beta.2" />
</ItemGroup>
</Project>
11 changes: 5 additions & 6 deletions aws-fs-lambda-webserver/pulumi/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ let addInvokePermission name accountId functionArn executionArn =
|> ignore

let infra () =
let configSection = Pulumi.Config()
let accountId = configSection.Get "awsAccount"
let accountId = Output.Create<GetCallerIdentityResult>(Pulumi.Aws.GetCallerIdentity.InvokeAsync()).Apply(fun r -> r.AccountId)

let lambdaRole =
Role (
Expand Down Expand Up @@ -96,8 +95,8 @@ let infra () =
Function(
"basicLambda",
FunctionArgs(
Runtime = input "dotnetcore2.1",
Code = input (FileArchive "../LambdaWebServer/bin/Debug/netcoreapp2.1/publish" :> Archive),
Runtime = input "dotnetcore3.1",
Code = input (FileArchive "../LambdaWebServer/bin/Debug/netcoreapp3.1/publish" :> Archive),
Handler = input "LambdaWebServer::Setup+LambdaEntryPoint::FunctionHandlerAsync",
Role = io lambdaRole.Arn,
Timeout = input 30
Expand Down Expand Up @@ -129,8 +128,8 @@ let infra () =
)
)

addInvokePermission "lambdaPermission1" (input accountId) (io lambda.Arn) (deployment.ExecutionArn |> Outputs.apply (fun arn -> arn + "*/*/") |> io)
addInvokePermission "lambdaPermission2" (input accountId) (io lambda.Arn) (deployment.ExecutionArn |> Outputs.apply (fun arn -> arn + "*/*/*") |> io)
addInvokePermission "lambdaPermission1" (io accountId) (io lambda.Arn) (deployment.ExecutionArn |> Outputs.apply (fun arn -> arn + "*/*/") |> io)
addInvokePermission "lambdaPermission2" (io accountId) (io lambda.Arn) (deployment.ExecutionArn |> Outputs.apply (fun arn -> arn + "*/*/*") |> io)

let urlWithTrailingSlash =
prodStage.InvokeUrl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Pulumi.Azure" Version="2.1.0-preview"/>
<PackageReference Include="Pulumi.AzureAD" Version="1.6.0-preview"/>
<PackageReference Include="Pulumi.Docker" Version="1.4.0-preview"/>
<PackageReference Include="Pulumi.Kubernetes" Version="1.5.8-preview"/>
<PackageReference Include="Pulumi.Random" Version="1.6.0-preview"/>
<PackageReference Include="Pulumi.Tls" Version="1.5.0-preview"/>
<PackageReference Include="Pulumi.Azure" Version="3.0.0-beta.2" />
<PackageReference Include="Pulumi.AzureAD" Version="2.0.0-beta.3" />
<PackageReference Include="Pulumi.Docker" Version="1.5.0-preview"/>
<PackageReference Include="Pulumi.Kubernetes" Version="2.0.0-beta.2"/>
<PackageReference Include="Pulumi.Random" Version="2.0.0-beta.5" />
<PackageReference Include="Pulumi.Tls" Version="2.0.0-beta.1" />
</ItemGroup>

<ItemGroup>
Expand Down
8 changes: 4 additions & 4 deletions azure-cs-aks/Azure.Aks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Pulumi.Azure" Version="2.1.0-preview" />
<PackageReference Include="Pulumi.AzureAD" Version="1.6.0-preview" />
<PackageReference Include="Pulumi.Random" Version="1.6.0-preview" />
<PackageReference Include="Pulumi.Tls" Version="1.5.0-preview" />
<PackageReference Include="Pulumi.Azure" Version="3.0.0-beta.2" />
<PackageReference Include="Pulumi.AzureAD" Version="2.0.0-beta.3" />
<PackageReference Include="Pulumi.Random" Version="2.0.0-beta.5" />
<PackageReference Include="Pulumi.Tls" Version="2.0.0-beta.1" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion azure-cs-appservice/AppServiceStack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public AppServiceStack()
},
ConnectionStrings =
{
new AppServiceConnectionStringsArgs
new AppServiceConnectionStringArgs
{
Name = "db",
Type = "SQLAzure",
Expand Down
2 changes: 1 addition & 1 deletion azure-cs-appservice/Azure.AppService.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Pulumi.Azure" Version="2.1.0-preview" />
<PackageReference Include="Pulumi.Azure" Version="3.0.0-beta.2" />
</ItemGroup>

</Project>
6 changes: 3 additions & 3 deletions azure-cs-botservice/Azure.BotService.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Pulumi.Azure" Version="2.1.0-preview" />
<PackageReference Include="Pulumi.AzureAD" Version="1.6.0-preview" />
<PackageReference Include="Pulumi.Random" Version="1.6.0-preview" />
<PackageReference Include="Pulumi.Azure" Version="3.0.0-beta.2" />
<PackageReference Include="Pulumi.AzureAD" Version="2.0.0-beta.3" />
<PackageReference Include="Pulumi.Random" Version="2.0.0-beta.5" />
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions azure-cs-cosmosapp-component/Azure.CosmosAppComponent.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Pulumi.Azure" Version="2.1.0-preview" />
<PackageReference Include="Pulumi.Docker" Version="1.4.0-preview" />
<PackageReference Include="Pulumi.Azure" Version="3.0.0-beta.2" />
<PackageReference Include="Pulumi.Docker" Version="1.5.0-preview"/>
</ItemGroup>

<PropertyGroup>
Expand Down
6 changes: 3 additions & 3 deletions azure-cs-cosmosapp-component/Containers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public static Output<string> Run()
Location = region.Location,
ImageRegistryCredentials =
{
new GroupImageRegistryCredentialsArgs
new GroupImageRegistryCredentialArgs
{
Server = registry.LoginServer,
Username = registry.AdminUsername,
Expand All @@ -62,15 +62,15 @@ public static Output<string> Run()
OsType = "Linux",
Containers =
{
new GroupContainersArgs
new GroupContainerArgs
{
Cpu = 0.5,
Image = dockerImage.ImageName,
Memory = 1.5,
Name = "hello-world",
Ports =
{
new GroupContainersPortsArgs
new GroupContainerPortArgs
{
Port = 80,
Protocol = "TCP",
Expand Down
2 changes: 1 addition & 1 deletion azure-cs-cosmosapp-component/CosmosApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public CosmosApp(string name, CosmosAppArgs args, ComponentResourceOptions? opti
{
ResourceGroupName = resourceGroup.Name,
Location = primaryLocation,
GeoLocations = locations.Select((l, i) => new AccountGeoLocationsArgs { Location = l, FailoverPriority = i }).ToArray(),
GeoLocations = locations.Select((l, i) => new AccountGeoLocationArgs { Location = l, FailoverPriority = i }).ToArray(),
OfferType = "Standard",
ConsistencyPolicy = new AccountConsistencyPolicyArgs { ConsistencyLevel = "Session" },
EnableMultipleWriteLocations = args.EnableMultiMaster,
Expand Down
24 changes: 12 additions & 12 deletions azure-cs-cosmosapp-component/VmScaleSets.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public Builder(ResourceGroup resourceGroup)
Location = location,
FrontendIpConfigurations =
{
new LoadBalancerFrontendIpConfigurationsArgs
new LoadBalancerFrontendIpConfigurationArgs
{
Name = "PublicIPAddress",
PublicIpAddressId = publicIp.Id,
Expand Down Expand Up @@ -138,11 +138,11 @@ public Builder(ResourceGroup resourceGroup)
Location = location,
NetworkProfiles =
{
new ScaleSetNetworkProfilesArgs
new ScaleSetNetworkProfileArgs
{
IpConfigurations =
{
new ScaleSetNetworkProfilesIpConfigurationsArgs
new ScaleSetNetworkProfileIpConfigurationArgs
{
LoadBalancerBackendAddressPoolIds = {bpepool.Id},
Name = "IPConfiguration",
Expand Down Expand Up @@ -171,7 +171,7 @@ public Builder(ResourceGroup resourceGroup)
},
StorageProfileDataDisks =
{
new ScaleSetStorageProfileDataDisksArgs
new ScaleSetStorageProfileDataDiskArgs
{
Caching = "ReadWrite",
CreateOption = "Empty",
Expand Down Expand Up @@ -212,9 +212,9 @@ public Builder(ResourceGroup resourceGroup)
},
Profiles =
{
new AutoscaleSettingProfilesArgs
new AutoscaleSettingProfileArgs
{
Capacity = new AutoscaleSettingProfilesCapacityArgs
Capacity = new AutoscaleSettingProfileCapacityArgs
{
Default = 1,
Maximum = 10,
Expand All @@ -223,9 +223,9 @@ public Builder(ResourceGroup resourceGroup)
Name = "defaultProfile",
Rules =
{
new AutoscaleSettingProfilesRulesArgs
new AutoscaleSettingProfileRuleArgs
{
MetricTrigger = new AutoscaleSettingProfilesRulesMetricTriggerArgs
MetricTrigger = new AutoscaleSettingProfileRuleMetricTriggerArgs
{
MetricName = "Percentage CPU",
MetricResourceId = scaleSet.Id,
Expand All @@ -236,17 +236,17 @@ public Builder(ResourceGroup resourceGroup)
TimeGrain = "PT1M",
TimeWindow = "PT5M",
},
ScaleAction = new AutoscaleSettingProfilesRulesScaleActionArgs
ScaleAction = new AutoscaleSettingProfileRuleScaleActionArgs
{
Cooldown = "PT1M",
Direction = "Increase",
Type = "ChangeCount",
Value = 1,
},
},
new AutoscaleSettingProfilesRulesArgs
new AutoscaleSettingProfileRuleArgs
{
MetricTrigger = new AutoscaleSettingProfilesRulesMetricTriggerArgs
MetricTrigger = new AutoscaleSettingProfileRuleMetricTriggerArgs
{
MetricName = "Percentage CPU",
MetricResourceId = scaleSet.Id,
Expand All @@ -257,7 +257,7 @@ public Builder(ResourceGroup resourceGroup)
TimeGrain = "PT1M",
TimeWindow = "PT5M",
},
ScaleAction = new AutoscaleSettingProfilesRulesScaleActionArgs
ScaleAction = new AutoscaleSettingProfileRuleScaleActionArgs
{
Cooldown = "PT1M",
Direction = "Decrease",
Expand Down
2 changes: 1 addition & 1 deletion azure-cs-functions-raw/Azure.FunctionsRaw.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Pulumi.Azure" Version="2.1.0-preview" />
<PackageReference Include="Pulumi.Azure" Version="3.0.0-beta.2" />
</ItemGroup>

<PropertyGroup>
Expand Down
6 changes: 3 additions & 3 deletions azure-cs-msi-keyvault-rbac/AppStack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public AppStack()
Source = new FileArchive("./webapp/bin/Debug/netcoreapp2.2/publish"),
});

var clientConfig = Output.Create(Pulumi.Azure.Core.Invokes.GetClientConfig());
var clientConfig = Output.Create(GetClientConfig.InvokeAsync());
var tenantId = clientConfig.Apply(c => c.TenantId);
var currentPrincipal = clientConfig.Apply(c => c.ObjectId);

Expand All @@ -99,7 +99,7 @@ public AppStack()
TenantId = tenantId,
AccessPolicies =
{
new KeyVaultAccessPoliciesArgs
new KeyVaultAccessPolicyArgs
{
TenantId = tenantId,
// The current principal has to be granted permissions to Key Vault so that it can actually add and then remove
Expand Down Expand Up @@ -137,7 +137,7 @@ public AppStack()
},
ConnectionStrings =
{
new AppServiceConnectionStringsArgs
new AppServiceConnectionStringArgs
{
Name = "db",
Type = "SQLAzure",
Expand Down
Loading

0 comments on commit f824737

Please sign in to comment.