question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

(module name): Errors in the construction Certificate or DnsValidatedCertificate of from stack

See original GitHub issue

Errors in the construction Certificate or DnsValidatedCertificate of from stack

Argument of type 'this' is not assignable to parameter of type 'Construct'.
  Type 'CertificateStack' is not assignable to type 'Construct'.
    Types of property 'node' are incompatible.
      Type 'ConstructNode' is missing the following properties from type 'ConstructNode': _locked, _aspects, _children, _context, and 6 more.ts(2345)
this: this

Reproduction Steps

import * as cdk from "@aws-cdk/core";
import { ValidationMethod } from "@aws-cdk/aws-certificatemanager";
import * as cm from "@aws-cdk/aws-certificatemanager";

const domainName = "fast-static-website.miensol.pl";

export class CertificateStack extends cdk.Stack {
  constructor(scope: cdk.Construct) {
    super(scope, "CertificateStack", {
      env: { region: "us-east-1" },
    });

    const certificate = new cm.Certificate(this, "CustomDomainCertificate", {
      domainName: domainName,
      validationMethod: ValidationMethod.DNS,
    });

    const certificateArn = certificate.certificateArn;
    new cdk.CfnOutput(this, "CertificateArn", {
      value: certificateArn,
    });
  }
}

What did you expect to happen?

the certificate construct to be created

create a certificate to be used in cloudfront

What actually happened?

the error above . I think its because import { Construct } from 'constructs';

is used for scope rather than

import {Construct} from "@aws-cdk/core"

Environment

  • CDK CLI Version : 1.121.0 (build 026cb8f)
  • Framework Version: 1.121.0
  • Node.js Version: v14.17.6
  • OS : ubuntu:20.04
  • Language (Version): TypeScript 4.4.3

Other


This is 🐛 Bug Report

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
golatoyecommented, Sep 19, 2021

@jumic . well that’s embarrassing 😃 . Thanks for spotting. its working after your fix

0reactions
github-actions[bot]commented, Sep 19, 2021

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.

Read more comments on GitHub >

github_iconTop Results From Across the Web

class DnsValidatedCertificate (construct) · AWS CDK
Fully-qualified domain name to request a certificate for. hostedZone, IHostedZone, Route 53 Hosted Zone used to perform DNS validation of the request.
Read more >
Issues creating DnsValidatedCertificate using CDK
I am attempting to create a certificate using the following: this.certificate = new CertificateManager.DnsValidatedCertificate( this ...
Read more >
StaticSite - SST docs
Create a certificate with alternate domain names const certificate = new acm.DnsValidatedCertificate(stack, "Certificate", {
Read more >
module not found error:no module named numpy even after ...
I keep getting module numpy not found error even though i have followed the steps and installed opencv in my new python environment....
Read more >
awslabs/aws-cdk - Gitter
Hey, what is best way to re-use a resource from another stack? I have DevVpcStack which under the hood creates ec2.Vpc, now I...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found