Skip to content
The Chat Archive
llama-3.3-70b-instruct· Meta LMArena Human Preference 140K

looking for a prompt for me to write code for aws cdk for creating infrastructure

  1. User

    looking for a prompt for me to write code for aws cdk for creating infrastructure

  2. Assistant

    Here are a few prompts for writing AWS CDK code to create infrastructure:

    1. Simple Web Server

    Create an AWS CDK stack that provisions a simple web server using an Amazon EC2 instance. The stack should include: * An EC2 instance with a public IP address * A security group that allows inbound traffic on port 80 (HTTP) * An Elastic IP address associated with the EC2 instance

    2. Serverless API

    Create an AWS CDK stack that provisions a serverless API using AWS Lambda and API Gateway. The stack should include: * An AWS Lambda function with a Node.js runtime * An API Gateway REST API with a single resource and method (e.g., GET /hello) * An IAM role for the Lambda function with necessary permissions

    3. S3 Bucket with CORS

    Create an AWS CDK stack that provisions an Amazon S3 bucket with CORS (Cross-Origin Resource Sharing) enabled. The stack should include: * An S3 bucket with a unique name * A CORS configuration that allows GET requests from any origin * A bucket policy that allows public read access to the bucket

    4. VPC with Subnets and Security Groups

    Create an AWS CDK stack that provisions a VPC with subnets and security groups. The stack should include: * A VPC with a specified CIDR block * Two subnets (public and private) with different CIDR blocks * Two security groups (one for the public subnet and one for the private subnet) with different inbound rules

    5. RDS Database with EC2 Instance

    Create an AWS CDK stack that provisions an Amazon RDS database instance and an EC2 instance to connect to it. The stack should include: * An RDS database instance with a specified engine (e.g., MySQL) and instance type * An EC2 instance with a public IP address and a security group that allows inbound traffic on the database port * A security group for the RDS instance that allows inbound traffic from the EC2 instance

    Choose one of these prompts and write the AWS CDK code to create the specified infrastructure. Good luck!

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.