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 réponse
0
Réponse acceptée

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
EXPERT
répondu il y a un an
  • hmmm, you are right, it seams there is no way to do that using the ApplicationLoadBalancedFargateService function

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions