AWSx (Pulumi Crosswalk for AWS)

This AWSx documentation is generated using the v1.0.0 series of AWSx. If you have not upgraded to that version of the provider then we suggest you continue to use our @pulumi/awsx NodeJS documentation.

The Amazon Web Services (AWS) Crosswalk (AWSx) library uses automatic well-architected best practices to make common infrastructure-as-code tasks in AWS easier and more secure. It uses the AWS SDK to manage and provision resources.

The AWSx provider must be configured with credentials to deploy and update resources in AWS; see Installation & Configuration for instructions.

New to Pulumi and AWS? Get started with AWS using our AWSx tutorial.


import * as awsx from "@pulumi/awsx";

// Allocate a new VPC with the default settings:
const vpc = new awsx.ec2.Vpc("custom");

// Export a few resulting fields to make them easy to use:
export const vpcId = vpc.vpcId;
export const privateSubnetIds = vpc.privateSubnetIds;
export const publicSubnetIds = vpc.publicSubnetIds;
import pulumi
import pulumi_awsx as awsx

vpc = awsx.ec2.Vpc("custom")

pulumi.export("vpcId", vpc.vpc_id)
pulumi.export("publicSubnetIds", vpc.public_subnet_ids)
pulumi.export("privateSubnetIds", vpc.private_subnet_ids)
package main

import (

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		vpc, err := ec2.NewVpc(ctx, "my-vpc", nil)
		if err != nil {
			return err
		ctx.Export("vpcId", vpc.VpcId)
		ctx.Export("privateSubnetIds", vpc.PrivateSubnetIds)
		ctx.Export("publicSubnetIds", vpc.PublicSubnetIds)
		return nil
using Pulumi;
using Ec2 = Pulumi.Awsx.Ec2;

class MyStack : Stack
    public MyStack()
        var vpc = new Ec2.Vpc("custom");

        this.VpcId = vpc.VpcId;

    [Output] public Output<string> VpcId { get; set; }

class Program
    static Task<int> Main(string[] args) => Deployment.RunAsync<MyStack>();
package myproject;

import com.pulumi.Pulumi;
import com.pulumi.awsx.ec2.Vpc;

public class App {
    public static void main(String[] args) { -> {
            var vpc = new Vpc("custom");

            ctx.export("vpcId", vpc.vpcId());
            ctx.export("privateSubnetIds", vpc.privateSubnetIds());
            ctx.export("publicSubnetIds", vpc.publicSubnetIds());
name: awsx-networking-yaml
runtime: yaml
description: A minimal AWS Pulumi YAML program

  # Allocate a new VPC with the default settings:
    type: awsx:ec2:Vpc

  vpcId: ${vpc.vpcId}
  privateSubnetIds: ${vpc.privateSubnetIds}
  publicSubnetIds: ${vpc.publicSubnetIds}