To do this, you need access to your DNS server - either through your domain hoster or whatever you use to manage your DNS zone. The easiest would be to have a wildcard DNS entry (< This will send all subdomains .yourdomain.tld to your EC2 instance(s). Once you have that, you only need some logic in you application which does whatever you want if a valid subdomain (say: user name) is used or redirect to your landing page or an error page if the subdomain is unknown.
Ah, one little thing i sleft. Your webserver has to accept the subdomains. If you use Apache httpd, the following line in your VirtualHost configuration will do the trick:
ServerAlias *.yourdomain.tld
For nginx the configuration should look like this:
server {
server_name *.yourdomain.tld
...
}