Problem: Lightsail Instance Creation Fails with Quota Exceeded or Invalid Blueprint ID

 

Problem: Lightsail Instance Creation Fails with Quota Exceeded or Invalid Blueprint ID

$ aws lightsail create-instances \
    --instance-names "TestInstance" \
    --availability-zone "us-east-1a" \
    --blueprint-id "ubuntu_20_04" \
    --bundle-id "nano_3_0"

An error occurred (ServiceException) when calling the CreateInstances operation:
You have reached the maximum number of instances allowed for your account.

# OR

An error occurred (InvalidInputException) when calling the CreateInstances operation:
The specified blueprint ID 'ubuntu_20_04' is invalid.

# OR

An error occurred (AccessDeniedException) when calling the CreateInstances operation:
User is not authorized to perform this action.

Issue:

Your attempt to create a Lightsail instance failed due to one of these common reasons:

  • Quota Limits – Your AWS account has reached the maximum number of Lightsail instances allowed.
  • Invalid Blueprint ID – The specified OS image does not exist or is not available in your region.
  • Incorrect Availability Zone – The chosen AZ does not support the selected blueprint.
  • Insufficient IAM Permissions – Your IAM user lacks the required permissions to create a Lightsail instance.

Fix: Check Quotas, List Available Blueprints, Verify IAM Permissions

Bash
# Step 1: Check if you already have instances consuming your quota
$ aws lightsail get-instances --query "instances[].{Name:name, State:state.name}" --output table

--------------------------------
|        GetInstances         |
--------------------------------
|  Name          |  State     |
--------------------------------
|  WebServer1    |  Running   |
|  AppServer2    |  Stopped   |
--------------------------------

# If the number of instances matches your quota limit, you'll need to delete an instance 
# or request a quota increase.

# Step 2: Check your Lightsail instance quota
$ aws lightsail get-container-service-limits
{
    "ServiceLimits": [
        {
            "Name": "LightsailInstancesPerRegion",
            "Max": 20,
            "Used": 20
        }
    ]
}

# Explanation:
# If "Used" equals "Max," you have hit your quota. You'll need to delete old instances
# or request a quota increase from AWS Support.

# Step 3: Request a quota increase (if needed)
# Open the AWS Support console and request an increase for Lightsail instances:
# https://console.aws.amazon.com/support

# Step 4: List available blueprints (OS images) for your region
$ aws lightsail get-blueprints --query "blueprints[].{ID: blueprintId, Name: name}" --output table

------------------------------------
|           GetBlueprints          |
------------------------------------
|  ID             |  Name          |
------------------------------------
|  ubuntu_22_04   |  Ubuntu 22.04  |
|  amazon_linux_2 |  Amazon Linux 2 |
|  debian_10      |  Debian 10     |
|  centos_8       |  CentOS 8      |
------------------------------------

# Step 5: If the blueprint ID was incorrect, update it to a valid one and retry:
$ aws lightsail create-instances \
    --instance-names "FixedInstance" \
    --availability-zone "us-east-1a" \
    --blueprint-id "ubuntu_22_04" \
    --bundle-id "nano_3_0"

# Step 6: Verify that the instance was created successfully
$ aws lightsail get-instances --query "instances[].{Name:name, State:state.name}" --output table

--------------------------------
|        GetInstances         |
--------------------------------
|  Name          |  State     |
--------------------------------
|  FixedInstance |  Running   |
--------------------------------

# Step 7: If the issue persists, check IAM permissions for Lightsail
$ aws iam list-attached-user-policies --user-name YourIAMUser

# Ensure your IAM user has the policy "AmazonLightsailFullAccess"
# If missing, attach it:
$ aws iam attach-user-policy \
    --user-name YourIAMUser \
    --policy-arn arn:aws:iam::aws:policy/AmazonLightsailFullAccess

Need AWS Expertise?

If you're looking for guidance on AWS Lightsail or any cloud challenges, feel free to reach out! We'd love to help you tackle your AWS projects. 🚀

Email us at: info@pacificw.com


Image: Gemini

Comments

Popular posts from this blog

The New ChatGPT Reason Feature: What It Is and Why You Should Use It

Raspberry Pi Connect vs. RealVNC: A Comprehensive Comparison

The Reasoning Chain in DeepSeek R1: A Glimpse into AI’s Thought Process