https://pulumi.com logo
#getting-started
Title
# getting-started
d

dry-byte-5648

08/28/2023, 6:12 AM
Howdy, using @pulumi/cloud (Provider is AWS) how do I create a VPC
Copy code
const cloud = require("@pulumi/cloud");

let service = new cloud.Service("pulumi-nginx", {
    containers: {
        nginx: {
            build: "./app",
            memory: 128,
            ports: [{ port: 80 }],
        },
    },
    replicas: 1,
});

// export just the hostname property of the container frontend
exports.url = service.defaultEndpoint.apply(e => `http://${e.hostname}`);
Currently get this Error but would ideally want 1 vpc per stack: Error: invocation of awsec2/getVpcgetVpc returned an error: invoking awsec2/getVpcgetVpc: 1 error occurred: * no matching EC2 VPC found Update: solved I did
pulumi config set cloud-aws:usePrivateNetwork true
based of this code https://github.com/danny-waite/pulumi-cloud/blob/master/aws/shared.ts#L119 and it seems to be generating vpcs now