pulumi/tests/integration/stack_reference/dotnet/step2/Program.cs

33 lines
814 B
C#

// Copyright 2016-2019, Pulumi Corporation. All rights reserved.
using System;
using System.Threading.Tasks;
using Pulumi;
class Program
{
static Task<int> Main(string[] args)
{
return Deployment.RunAsync(async () =>
{
var slug = $"{Deployment.Instance.OrganizationName}/{Deployment.Instance.ProjectName}/{Deployment.Instance.StackName}";
var a = new StackReference(slug);
var gotError = false;
try
{
await a.GetValueAsync("val2");
}
catch
{
gotError = true;
}
if (!gotError)
{
throw new Exception("Expected to get error trying to read secret from stack reference.");
}
});
}
}