Needed to spin up a new AWS environment so thought...
# getting-started
f
Needed to spin up a new AWS environment so thought it was the perfect opportunity to take Pulumi for a test drive. Unfortunately, I seem to have fallen over on the first step!! I'm trying to create a vpc using the code block in the docs (below)
Copy code
using System.Collections.Immutable;
using Pulumi;
using Pulumi.Awsx.Ec2.Inputs;
using Ec2 = Pulumi.Awsx.Ec2;

class MyStack : Stack
{
    public MyStack()
    {
        var vpc = new Ec2.Vpc("custom", new Ec2.VpcArgs
        {
            SubnetSpecs =
            {
                new SubnetSpecArgs
                {
                    Type = Ec2.SubnetType.Public,
                    CidrMask = 22,
                },
                new SubnetSpecArgs
                {
                    Type = Ec2.SubnetType.Private,
                    CidrMask = 20,
                }
            }
        });

        this.VpcId = vpc.VpcId;
        this.PublicSubnetIds = vpc.PublicSubnetIds;
        this.PrivateSubnetIds = vpc.PrivateSubnetIds;
    }

    [Output] public Output<ImmutableArray<string>> PrivateSubnetIds { get; private set; }
    [Output] public Output<ImmutableArray<string>> PublicSubnetIds { get; private set; }
    [Output] public Output<string> VpcId { get; set; }
}

class Program
{
    static Task<int> Main(string[] args) => Deployment.RunAsync<MyStack>();
}
However, having some issues resolving dependencies (see attached image). I've included the packages window so you can see the versions. Judging by the
using
statements this example code seems out of date?
b
@flat-ambulance-51692can you list your deps from the CLI?
you seem to have
Pulumi.Aws
but not
Pulumi.Awsx
installed
I think you need
otnet add package Pulumi.Awsx --version 1.0.0-beta.8
f
@billowy-army-68599 👍 sorted. I had the prerelease checkbox unchecked and didn't realise I was missing this package. Thank you for the guidance