AWS CDK to create a Fargate Load Balancer solution with an ssl certificate with an external DNS provider

0

Hello,

I want to create a. ECS Fargate ApplicationLoadBalancer solution using a certificate for a Domain which is hosted on a external DNS provider (godaddy)

Here is my code:


    //create a new certificate in the certificate manager for the domain 

    const certificate = new acm.Certificate(this, ‘certificate’, {

      domainName: ‘api-fargate.mygodaddy.org’,

      validation: acm.CertificateValidation.fromDns(),

    }

    );

    new ecs_patterns.ApplicationLoadBalancedFargateService(this, ‘ECService’, {

      cluster,

      taskDefinition,

      certificate: certificate,

      domainName: ‘api-fargate.mygodaddy.org’,

      listenerPort: 443,

      taskSubnets: {

        subnetType: ec2.SubnetType.PRIVATE_WITH_EGRESS,

      },

    });

The error I get is:

Error: A Route53 hosted domain zone name is required to configure the specified domain name

How I can do what I want, not having a Route53 hosted domain, I hope the answer is not do it all manual ;)

1 Risposta
0
Risposta accettata

Hi,

Can you share version used? Typically I would look into GitHub repository and check why that error is triggered.

For instance, https://github.com/aws/aws-cdk/blob/767cd31c2b66b48b3b8fed7cd8d408a6846cf1e1/packages/%40aws-cdk/aws-ecs-patterns/lib/base/application-load-balanced-service-base.ts#L457. In that version, seems as domainZone needs to be provided too, apart from domainName.

As you may use a different version, the code logic may be different.

Eventually, could be that this construct pattern requires the domain to be on route 53, but hope to be wrong :)

Hope it helps ;)

profile picture
ESPERTO
con risposta un anno fa
  • hmmm, you are right, it seams there is no way to do that using the ApplicationLoadBalancedFargateService function

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande