This guide provides an overview of how to create network infrastructure using Pulumi. We'll create a Virtual Private Cloud (VPC) with associated public and private subnets, configure route tables, and attach an Internet Gateway for public internet access.
Before getting started, make sure you have the following:
- Pulumi CLI installed.
- AWS CLI installed and configured with necessary credentials.
pulumi new aws-javascript
Edit your Pulumi.dev.yaml file to configure your VPC and subnet settings.
In your Pulumi JavaScript file (e.g., index.js), use Pulumi to define and deploy your infrastructure.
- Created a new VPC named "myVPC" with specified CIDR block.
- Created a new Internet Gateway named "myInternetGateway" and attached it to the VPC.
- Queried and obtained the first three availability zones.
- Created public and private subnets in each availability zone.
- Associated route tables with subnets.
- Created public and private route tables.
- Associated subnets with route tables.
- Created security groups for load balancer, EC2 instances, and RDS instance.
- Created a MySQL RDS instance with specified configurations.
- Created an IAM role with policies for EC2 instances.
- Attached policies for CloudWatch and S3 to the role.
- Created an Application Load Balancer with specified configurations.
- Configured listeners and target groups.
- Created an Auto Scaling Group with scaling policies and CloudWatch alarms.
- Created an IAM role and attached policies for Lambda function.
- Defined and created an AWS Lambda function with dependencies on S3 bucket.
- Created an SNS topic and subscription for Lambda function.
- Created CloudWatch alarms for scaling based on CPU utilization.
- Created a Route53 record for the load balancer.
- Created a DynamoDB table with specified attributes and global secondary indexes.
- Configured an IAM policy for DynamoDB access and attached it to the Lambda execution role.
- Created an S3 bucket named "pranav-bucket-1" with private ACL.
- Created a GCS bucket named "csye6225_demo_gcs_bucket" with versioning enabled.
- Created a service account with necessary permissions and attached it to the GCS bucket.
- Attached a custom IAM policy to the Lambda execution role for GCS access.
- Exported various resource IDs and information for reference and integration with other services.