how to request ACM using AWS default DNS for ELB - amazon-web-services

I have an application running on AWS ELB and want to set up https listener. I tried to request an SSL certificate using AWS ACM but was unable to do because the ELB is using default AWS DNS name.
Is it possible to request ACM for the DNS name like below?
abc-123455.us-east-2.elb.amazonaws.com

No, you can't create a certificate for a DNS name that you don't own. It is owned by AWS. What you can do is request an ACM for a DNS name that you do own like vamsi_domain.com. Then in Route53 you can use an alias (similar to CNAME) record to alias vamsi_domain.com as abc-123455.us-east-2.elb.amazonaws.com.
See the answer to this question for more information: https://serverfault.com/questions/424253/how-does-one-point-a-domain-to-a-load-balancer-that-doesnt-have-a-stable-ip

Type the name of your domain in the Domain name box and choose Next.
In this example, I type www.example.com. You must use a domain name
that you control. Requesting certificates for domains that you don’t
control violates the AWS Service Terms.
so in short, you can not use LB DNS name because you can not control LB DNS name but it controls by AWS.
easier-certificate-validation-using-dns-with-aws-certificate-manager
Now, the question is how you will validate the DNS? as AWS ACM required to validate the ownership of DNS.
You may request for the LB DNS but you will have to validate, and for validation, you need to place CNAME record in your DNS provider setting or have to use email.

Related

Issue AWS certificate for a single subdomain to be used with CloudFront?

My client has a domain example.com hosted somewhere.
We need to create a subdomain cloudfront.example.com in my AWS cloud in order to make my Cloudfront Distribution accessible on that subdomain.
CF requires an SSL certificate to work with a custom domain.
I was only able to find a solution which leads to 4th level subdomains via creating an AWS Hosted Zone (3rd level domain) in my AWS account where I can then create another subdomain (4th level).
Is it possible to register a single record in my client's DNS table to point to my CF Distro?
Yes, you can use the client's DNS. What you need to do:
Use ACM to create an SSL certificate for cloudfront.example.com. You will see a necessary CNAME to confirm the SSL certificate
Add CNAME to your client's DNS that will validate the certificate
In CloudFront, define alternate domain name (CNAME) as cloudfront.example.com
In the client's DNS add a CNAME for cloudfront.example.com to point to your CloudFront distribution domain name (it's going to be some-hash.cloudfront.net)

AWS Application Load Balancer throws net::ERR_CERT_COMMON_NAME_INVALID

I have created an microservice API application and hosted it on AWS ECS cluster and attached this cluster to AWS Application Load Balancer (ALB). Added a certificate from AWS Certificate Manager to the ALB. When I try to call using the link provided by AWS ALB, from my frontend app, it returns an error:
net::ERR_CERT_COMMON_NAME_INVALID
The link from ALB is sonething like this:
xxxxx-xx-xxxxxxxxx.ap-south-1.elb.amazonaws.com
I attached a SSL certificate to the listener. The SSL is issued using AWS Certificate Manager for my-site.xyz and *.my-site.xyz
The frontend application is react application hosted on different-site.ai using AWS Amplify
Edit
The OP wanted this to resolve for their root/apex domain example.com, as they use Namecheap (which support an Alias record) a value was added for the root domain following these instructions.
Alias records are also supported in Route 53.
It needed to be an alias record as a root domain traditionally can only resolve to an IP address which would be an A record, whereas Alias will map the IP of the CNAME record to the value instead.
Original
The error thrown is because the SSL certificate that is attached is not applicable for the domain you're trying to access.
For example the cert is for example.com but you're trying to access xxxxx-xx-xxxxxxxxx.ap-south-1.elb.amazonaws.com.
To access this you must access on a valid domain name, to do this add a DNS record so that example.com resolves to xxxxx-xx-xxxxxxxxx.ap-south-1.elb.amazonaws.com. Then when accessing example.com the SSL will be valid.
In my case, when I was requesting a certificate, I failed to list the domain names correctly.
For example, if your website was www.somewhere.com, you would need to add
www.somewhere.com
and also add
somewhere.com

Unable to map custom domain to API Gateway (from Godaddy)

I'm trying to set up a custom domain (say, myapi.com) for my API Gateway but am running into problems. The domain is currently registered on GoDaddy. So far, I've followed this tutorial and done the following:
Obtained a certificate for myapi.com and *.myapi.com from the AWS Certificate Manager.
Mapped the domain myapi.com (not *.myapi.com as I don't need it yet) to an API in the API Gateway.
Added a CNAME entry for the resulting "target domain name" in GoDaddy.
Here are the screenshots:
Now here's the problem: When I do ping myapi.com I get: No address associated with hostname. I'm not sure what's causing this, so would really appreciate some help. And while we're at it, are there any other steps I need to perform before this works as expected?
You cannot use a CNAME record at the apex or domain root with standard DNS services. I suggest you try using a hostname for your endpoint and using the CNAME there eg api.example.com.
Alternatively, you can move your DNS to Route 53. The Route 53 system does support aliases at the root domain level, using the Alias record type.
For more information on Alias records in Route 53 see https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resource-record-sets-choosing-alias-non-alias.html

Adding AWS SSL to an external DNS

I have bought a domain from an external resource and I tried to add the AWS SSL certificate into DNS as a CNAME record
Although the AWS Certivicate Name starts with a ' _ ' character, when I tried to add it in DNS it gives me an error as
"Server name can be use letters hypens and dots only"
I do not have any experience regarding this and want to know if I'm doing anything wrong in DNS Validation for AWS SSL Certificate.
There are couple of options to solve this:
1. Use Email verification method to get the certificate, if you haven't enabled Privacy protection on the registrar, you'll get a verification email from AWS ACM and you can verify a certificate or ACM also sends verification emails to 5 different email addresses such as:
administrator#your_domain_name
hostmaster#your_domain_name
postmaster#your_domain_name
webmaster#your_domain_name
admin#your_domain_name
Use Route53, Create a HostedZone for your domain in Route53 and use the name servers Route53 provided and use it on your current registrar.
Create and transfer all the records to Route53 , you don't need to transfer the domain, just use Route53 nameservers to your current registrar.

Is there anyway to create a friendly URL for AWS Elasticsearch domain url?

I tried creating a Route 53 alias record but that didn't work.
It is possible as of November 2020:
Choose Edit domain.
To add a Custom endpoint, select the Enable custom endpoint check box.
For Custom hostname, enter your preferred custom endpoint hostname. Your custom endpoint hostname should be a fully qualified domain name (FQDN), such as www.yourdomain.com or example.yourdomain.com.
For AWS certificate, choose the SSL certificate that you want to use for your domain.
https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-customendpoint.html
We don’t support custom SSL certificates, which means that a custom CNAME for an Elasticsearch Service endpoint such as mycluster.mycompanyname.example also is not supported.
Ref: https://www.elastic.co/guide/en/cloud/current/ec-faq.html#faq-dns
It is still not possible on September 2020:
Can I use a Custom SSL certificate?
We don’t support custom SSL certificates, which means that a custom CNAME for an Elasticsearch Service endpoint such as mycluster.mycompanyname.com also is not supported.
source
Create a wild card certificate like *.youdomain.com (for subdomain setup) or a domain certificate (e.g yourdomain.com) if you have a domain that you want to point to this cluster in ACM.
Assuming you are going with a subdomain setup. You can follow similar steps for domain setup.
While creating the ES cluster select the custom domain option and add Custom hostname as your subdomain (e.g: elasticsearch.yourdomain.com) And for certificate chose wildcard certificate from ACM. Or you can edit your cluster and do the same.
If you have cogito auth for kibana You will need also need to follow these steps:
Go to Cognito pool
Under App integration > App client settings
Update Sign-in and sign-out URLs according to your subdomain.
Adding more information to the answer by yurez's.
The following step is also important:
After you enable a custom endpoint for your OpenSearch Service domain, you must create a CNAME mapping in Amazon Route 53 (or your preferred DNS service provider) to route traffic to the custom endpoint and its subdomains. Create the CNAME from the custom endpoint (the name of the record e.g., example.yourdomain.com) to the auto-generated endpoint (the value of the record e.g., vpc-1b1b1b1b1b1b1b1b1b1b1b1b1.us-east-1.es.amazonaws.com). Without this mapping, your custom endpoint won't work.
Reference: Creating a custom endpoint for Amazon OpenSearch Service
You can use route 53 service of AWS, Create record with CNAME and put value as some friendly name like kibana.logs.com or whatever domain you owned.