Gellért Sós

Gellért Sós

  · 8 min read

Infrastructure as Prompt (IaP) and the AWS Prompt Library

Can natural language replace infrastructure code?

Can natural language replace infrastructure code?

Introduction

I tested two beta prompts from the AWS Prompt Library using Amazon Q CLI and compared the IaC and IaP approaches.

From time to time, changes occur in technology that completely rewrite how we build and operate systems. Infrastructure as Code (IaC) was such a turning point: manual configuration was replaced by version-controlled, automated deployment. Now we are on the verge of another leap forward: Infrastructure as Prompt (IaP).

Although it is a beta version, it can still perform partial tasks that can help increase the efficiency of experts’ work.

What is Infrastructure of Prompt (IaP)?

Think of it as the next step in cloud automation. Instead of writing Terraform, CloudFormation, or Pulumi code, we simply say what we need in natural language, and AI agents turn it into working infrastructure. For example, instead of writing this in code:

resource "aws_instance" "web" {
  ami = "ami-0c55b159cbfafe1"
  instance_type = "t3.micro"
  tags = {
    Name = "example-instance"
  }
}

It is sufficient to write in natural language:

Create an AWS EC2 instance using the latest Amazon Linux 2 AMI, with instance type t3.micro. Name the instance ‘example-instance’.

The AI agent interprets the request, checks it against security rules, and then creates the infrastructure—either through code generation or direct API calls. This is not just a convenience feature. With IaP, it’s no longer just experts who can create cloud resources: developers, data analysts, and even business leaders can easily express their needs without knowing IaC tools.

In the background, policies, cost limits, and security constraints are automatically enforced. By eliminating syntax difficulties, the prompt-based approach dramatically speeds up infrastructure creation. There is no need to browse through documentation or debug code snippets. AI independently optimizes for load, costs, and regulations, making decisions that previously required expert knowledge—while built-in security constraints ensure compliance with corporate rules. AWS also recognized this potential, which is why they created the Prompt Library.

What is the AWS Prompt Library?

The AWS Prompt Library is a collection of pre-built prompts for AI models and infrastructure design. I used Amazon Q to test these prompts.

What is Amazon Q?

Amazon Q CLI
Amazon Q CLI

Amazon Q is AWS’s generative AI assistant, capable of generating code, architectures, and commands based on natural language instructions. MCPs (Model Context Protocols) are required for effective use and play a key role in enabling Amazon Q to connect seamlessly to external systems and services.

What is Model Context Protocol (MCP)?

MCP szerver előtt és után
MCP szerver előtt és után

The Model Context Protocol (MCP) is an open standard that provides a unified interface for communication between AI models and external systems. It is essentially a standardized bridge between AI and the outside world—APIs, databases, cloud services—that enables secure and controlled access. AWS also has MCP servers that provide access to various services.

I used three AWS MCP servers for the test:

  1. AWS API MCP Server - Provides direct access to AWS SDK operations (e.g., S3, EC2, DynamoDB, Lambda, etc.). Enables AI to initiate API calls to AWS services.
  2. AWS Knowledge MCP Server - Provides access to AWS documentation and knowledge base. This allows AI to obtain up-to-date information about AWS services, best practices, and configuration details directly from official sources.
  3. AWS Cloud Control MCP Server - Provides a unified interface for managing multiple AWS resources through the AWS Cloud Control API. Enables general CRUD (Create, Read, Update, Delete) operations across various AWS services, managing different resource types in a unified manner.

First prompt test: Startup Landing Page Deployment

The purpose of this prompt is to build a modern, responsive landing page that includes a pricing section, contact form, and Stripe-based subscription payment solution. It uses serverless AWS infrastructure in the background (S3, CloudFront, API Gateway, Lambda, DynamoDB), all implemented in Infrastructure-as-Code format using Terraform. It takes care of security settings (private S3 bucket, HTTPS, IAM roles), browser compatibility (CORS configuration), as well as error handling and testing documentation. This gives startups a ready-to-use, production-ready foundation that is scalable, secure, and quick to deploy.

Here you can see the landing page (made from the prompt) with the pricing section and contact form:

Prompt Library - Landing Oldal
Prompt Library - Landing Oldal

This is what the Stripe-based payment page looks like:

Prompt Library - Stripe Checkout
Prompt Library - Stripe Checkout

This is the image you would receive after successful payment:

Prompt Library - Fizetés Sikeres
Prompt Library - Fizetés Sikeres

And this is what happens if the payment fails:

Prompt Library - Megszakított fizetést jelző oldal
Prompt Library - Megszakított fizetést jelző oldal

My experience with the prompt was positive: both the Infrastructure-as-Code (IaC) and natural language (IaP) installation methods yielded similarly stable results.

The system worked consistently, the pages appeared, and saving to the database and Stripe integration also went smoothly. During multiple runs, I experienced only minimal differences, confirming that the prompt is highly scalable and provides a reliable basis for further development.

Second prompt test: Container Orchestration

This prompt helps you deploy a containerized application on AWS, specifically in a Kubernetes (EKS) environment. The goal is to create a cloud architecture where a Node.js application runs securely, efficiently, and flexibly with a PostgreSQL database.

Main architectural elements:

  1. Kubernetes (Amazon EKS): The application runs in containers managed by Kubernetes, supported by several automated components:

    • Horizontal Pod Autoscaler (HPA) – Scales application pods based on load
    • Cluster Autoscaler – Adjusts cluster node capacity automatically
    • Application Load Balancer (ALB) – Handles traffic distribution and routing
  2. Database Layer (Amazon RDS – PostgreSQL): A managed PostgreSQL database hosted on Amazon RDS ensures persistent, reliable, and highly available data storage.

  3. Container Image Management (Amazon ECR): All application container images are stored securely in Amazon Elastic Container Registry (ECR).

  4. Infrastructure-as-Code: The entire environment is provisioned and managed through declarative IaC tools:

    • Terraform – For cloud resource provisioning
    • Helm Charts – For application deployment and updates on Kubernetes
  5. Security & Cost Optimization: The architecture emphasizes both security and cost-efficiency:

    • Role-Based Access Control (RBAC)
    • Secure secret management
    • Network rules and policies (Security Groups, Network Policies)
    • Cost-efficient compute using Spot Instances
  6. Monitoring & Logging: System health and performance are monitored through:

    • AWS CloudWatch
    • Prometheus és Grafana

In practice, I ran into a few errors. After running the prompt for the first time, the EKS cluster was created, but there were errors in the Terraform code:

Operating AWS EKS cluster
Operating AWS EKS cluster
Errors received by the prompt
Errors received by the prompt

Reasons for errors:

  1. PostgreSQL verzió hiba: In the Terraform code, the PostgreSQL version is set to 15.4. However, in the AWS RDS service, this specific subversion is either no longer available (deprecated) or not yet supported in the given region. This error can be easily fixed by rewriting the database version.

  2. IAM Policy hiánya: The Terraform code attempts to attach a Policy to a Role, but the Policy does not exist. It did not recognize this error, so I had to manually create AWSLoadBalancerControllerIAMPolicy.

The AWS Prompt Library will be able to play a supporting role once the development is complete, but regardless, the presence of experts is essential.

I tested the prompt in two ways: I ran it using a Terraform-based (IaC) approach and also using natural language (IaP).

I got similar results in both cases. The EKS cluster was created, the containerized application started, and most of the components worked. However, errors (e.g., RDS version conflict, missing IAM policy) indicate that the prompt does not always handle region-specific or changing AWS configurations. Nevertheless, the system is well-structured, and with some manual intervention, it can be turned into a stable system suitable for a live environment.

Summary

Based on the tests, it is clear that we are on the verge of a technological leap forward, but we are still only at the beginning of the road. The promise of Infrastructure as Prompt (IaP) is enormous, as it can radically accelerate development, but the errors experienced —such as version conflicts and missing permissions— show that the technology is not yet fully mature.

AI solutions are impressive, but they do not yet operate in “autopilot” mode: expert human supervision and manual correction, inspection, and intervention are essential for now.

The real breakthrough will come with the development of the Model Context Protocol (MCP). As these servers create deeper, live connections between systems, APIs, and documentation, AI agents will become more reliable, eliminating errors caused by outdated information, helping experts be more efficient.

The vision for the future is therefore not that natural language will completely replace code. Rather, it is about having AI assistants that take over the “grunt work” (boilerplate code, basic configurations) so that we can focus on real, complex engineering tasks.

AI will not be our replacement, but our most effective tool.

Sources


Are you interested in this topic? Do you have any questions about the article? Book a free consultation and let’s see how the Code Factory team can help you, or take a look at our services!

Back to Blog