예제 #1
0
    public MyStack()
    {
        var pet = new RandomPet("my-pet", new RandomPetArgs {
        });

        this.PetName = pet.Id;
    }
예제 #2
0
    static Task <int> Main(string[] args)
    {
        return(Deployment.RunAsync(() =>
        {
            var pet = new RandomPet("cat");

            var getPetLength = pet.Urn.Apply(urn => new GetResource(urn).Length);

            return new Dictionary <string, object>
            {
                { "getPetLength", getPetLength }
            };
        }));
    }
예제 #3
0
파일: Program.cs 프로젝트: jaxxstorm/pulumi
    static Task <int> Main(string[] args)
    {
        return(Deployment.RunAsync(() =>
        {
            var pet = new RandomPet("cat", new RandomPetArgs {
                Length = 2,
            });

            var getPetLength = pet.Urn.Apply(urn => new GetResource(urn).Length);
            var secretPet = new RandomPet("secretPet", new RandomPetArgs {
                Length = Output.CreateSecret(1),
            });

            var getPetSecretLength = secretPet.Urn.Apply(urn => new GetResource(urn).Length);

            return new Dictionary <string, object>
            {
                { "getPetLength", getPetLength },
                { "secret", getPetSecretLength },
            };
        }));
    }