gpt-4.1-2025-04-14· OpenAI
LMArena Human Preference 140K
looking for a prompt for me to write code for aws cdk for creating infrastructure
- User
looking for a prompt for me to write code for aws cdk for creating infrastructure
- Assistant
Absolutely! Here’s a prompt you can use to guide your code writing for AWS CDK infrastructure:
Prompt:
Write an AWS CDK (Cloud Development Kit) script in TypeScript (or Python, if you prefer) that creates the following infrastructure:
- A VPC with public and private subnets across two Availability Zones.
- An EC2 instance in one of the public subnets, with SSH access restricted to a specific IP address.
- An RDS (PostgreSQL) instance in one of the private subnets, with security group rules allowing access only from the EC2 instance.
- An S3 bucket with versioning enabled and public access blocked.
- Output the public IP address of the EC2 instance and the endpoint of the RDS instance.
Use best practices for security and resource naming. Add comments explaining each major section.
You can adjust the resources or language as needed! If you want a more specific or different setup, let me know.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.