1. Answers
  2. How do I choose between AWS Native, AWS Classic, and AWSx providers?

How Do I Choose Between AWS Native, AWS Classic, and AWSx Providers?

Introduction

When managing AWS resources using Pulumi, you have several provider options available, each catering to different needs and levels of expertise. This guide aims to help you understand the differences between AWS Classic, AWS Native, and AWSx providers, enabling you to make an informed decision based on your specific use case.

Understanding AWS Providers in Pulumi

Pulumi offers multiple ways to manage AWS resources, each with different levels of abstraction and integration. Here’s a breakdown of the three main AWS providers you might encounter:

  1. AWS Classic (@pulumi/aws):

    • This is the most commonly used provider for managing AWS resources with Pulumi.
    • It provides a direct mapping to the AWS API, allowing you to manage a wide range of AWS services.
    • Suitable for users who need fine-grained control over AWS resources.
  2. AWS Native (@pulumi/aws-native):

    • This provider is in preview and offers a more direct integration with AWS CloudFormation.
    • It allows you to use the same resource model as CloudFormation, which can be beneficial if you’re familiar with CloudFormation templates.
    • AWS Native is designed to provide quicker access to new AWS features as they become available.
  3. AWSx (@pulumi/awsx):

    • AWSx provides higher-level abstractions for AWS resources, making it easier to work with complex setups.
    • It includes components like Vpc, Cluster, and FargateService that simplify common patterns.
    • Ideal for users who want to get started quickly with best practices built-in.

Choosing the Right Provider

Here’s a step-by-step guide to help you choose the right provider based on your needs:

  1. Assess Your Familiarity with AWS:

    • If you are comfortable with AWS CloudFormation, consider using AWS Native for a familiar experience.
    • For those new to AWS or seeking simplicity, AWSx offers higher-level abstractions that are easier to manage.
  2. Determine the Level of Control Required:

    • Choose AWS Classic if you need detailed control over AWS resources and access to a wide range of services.
    • Opt for AWSx if you prefer working with pre-configured components that follow best practices.
  3. Consider Future-Proofing:

    • AWS Native can be advantageous if you want early access to new AWS features as they are released.
  4. Evaluate Complexity of Setup:

    • Use AWSx for complex setups that require simplified management with built-in best practices.

Key Points Summary

  • AWS Classic: Best for fine-grained control and extensive service coverage.
  • AWS Native: Ideal for users familiar with CloudFormation and seeking early access to new features.
  • AWSx: Perfect for quick setups with higher-level abstractions and best practices.

Example Program Using AWSx

Let’s create a simple VPC using the AWSx provider to demonstrate how it simplifies resource management. This example will set up a VPC with public and private subnets.

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

// Create a new VPC with the default configuration
const vpc = new awsx.ec2.Vpc("my-vpc", {
    subnetSpecs: [
        {
            type: awsx.ec2.SubnetType.Public,
            cidrBlocks: ["10.0.0.0/24", "10.0.1.0/24", "10.0.2.0/24"],
        },
        {
            type: awsx.ec2.SubnetType.Private,
            cidrBlocks: ["10.0.3.0/24", "10.0.4.0/24", "10.0.5.0/24"],
        }
    ],
});

// Export the VPC ID and subnet IDs
export const vpcId = vpc.vpcId;
export const publicSubnetIds = vpc.publicSubnetIds;
export const privateSubnetIds = vpc.privateSubnetIds;

Conclusion

Choosing between AWS Classic, AWS Native, and AWSx providers depends on your familiarity with AWS, the level of control you require, and how quickly you want to adopt new AWS features. AWS Classic is great for detailed control, AWS Native offers a CloudFormation-like experience, and AWSx simplifies complex setups with built-in best practices. Select the provider that aligns best with your project needs and expertise level.

Deploy this code

Want to deploy this code? Sign up for a free Pulumi account to deploy in a few clicks.

Sign up

New to Pulumi?

Want to deploy this code? Sign up with Pulumi to deploy in a few clicks.

Sign up