How to Fix “No Targets Available” When Setting Alias Target from Route 53 to S3 Website Endpoint


1 views

When configuring a static website hosted on Amazon S3 with Route 53 DNS routing, many developers encounter the frustrating "No targets available" message when trying to set an alias target. This typically occurs when attempting to create a record set in Route 53 that points to an S3 website endpoint.

Before Route 53 can recognize your S3 bucket as a valid alias target, several conditions must be met:

1. The S3 bucket name must exactly match your domain name (e.g., simples3websitetest.com)
2. Static website hosting must be properly enabled on the bucket
3. The bucket must be in the same AWS region as your Route 53 hosted zone
4. Proper bucket permissions must be configured

Here's how to properly set up the S3 bucket for website hosting:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "PublicReadGetObject",
            "Effect": "Allow",
            "Principal": "*",
            "Action": "s3:GetObject",
            "Resource": "arn:aws:s3:::your-domain.com/*"
        }
    ]
}

The most common reason for the "No targets available" error is that the S3 bucket's region isn't properly aligned with Route 53. AWS Route 53 only displays S3 website endpoints from the same region where the hosted zone was created.

Solution checklist:

- Verify bucket region matches hosted zone region
- Ensure bucket name exactly matches the record name
- Confirm static website hosting is enabled (not just bucket access)
- Check that the bucket policy allows public read access

If regional alignment isn't possible, consider using CloudFront as an intermediary:

1. Create a CloudFront distribution
2. Set the S3 website endpoint as origin (not the S3 REST endpoint)
3. Configure Route 53 to alias to the CloudFront distribution
4. This bypasses the regional limitation entirely

After configuring everything, test with these commands:

# Check DNS resolution
nslookup your-domain.com

# Verify bucket website endpoint
aws s3api get-bucket-website --bucket your-domain.com

# Check Route 53 records
aws route53 list-resource-record-sets --hosted-zone-id /hostedzone/YOURZONEID

First, let's verify your S3 static website configuration is correct. Your bucket policy looks properly configured:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "AddPerm",
            "Effect": "Allow",
            "Principal": {
                "AWS": "*"
            },
            "Action": [
                "s3:GetObject"
            ],
            "Resource": [
                "arn:aws:s3:::simples3websitetest.com/*"
            ]
        }
    ]
}

However, you must ensure two critical configurations:

1. Static website hosting is enabled in S3 bucket properties
2. The bucket name exactly matches your domain name (simples3websitetest.com)

The "No targets available" error typically occurs when:

  • The S3 bucket isn't in the same AWS region as your Route 53 hosted zone
  • The bucket name doesn't exactly match the domain name
  • The S3 website endpoint isn't properly configured
  • IAM permissions prevent Route 53 from seeing the bucket

Check these configurations in your AWS console:

1. Navigate to S3 → Your Bucket → Properties
2. Verify "Static website hosting" is enabled
3. Note the exact endpoint (e.g., simples3websitetest.com.s3-website-us-west-2.amazonaws.com)
4. Ensure the Region matches your Route 53 hosted zone region
5. In Route 53, create an A record (not CNAME) with Alias enabled

If your S3 bucket is in us-west-2 but Route 53 hosted zone is in us-east-1, you might need to:

1. Create a new S3 bucket in the same region as your hosted zone
2. Or use a CloudFront distribution in front of your S3 bucket
3. Verify the bucket policy allows Route 53 to discover it

For complex setups, try this AWS CLI command to verify S3 website configuration:

aws s3api get-bucket-website --bucket simples3websitetest.com

Expected output should show your IndexDocument configuration:

{
    "IndexDocument": {
        "Suffix": "index.html"
    },
    "ErrorDocument": {
        "Key": "error.html"
    }
}

If regional mismatch persists, consider this CloudFront setup:

1. Create CloudFront distribution
2. Set S3 website endpoint as origin (not the S3 REST endpoint)
3. In Route 53, create Alias record pointing to CloudFront
4. Add bucket policy allowing CloudFront access