Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
    Durwasa Chakraborty
    How does one de-register an instance from a target group?
    can anyone help me out with cloudformation template ,right now we are using default cidrip for prod,staging,test and dev but now i need to assign seperate cidrip to staging and prod like for staging env this ip range should pick and production this ,and for rest environment this ip ranges.
    Vineeth Penugonda
    How do I check if the log group exists in CDK before creating a new log group for a service?
    Shane R. Spencer
    you can use an aws client lib
    Hi there, I am working on a cdk stack and want to deploy a provisioned product. Therefore I am using the typescript class CfnCloudFormationProvisionedProduct. Comming from cfn I am used to work with "!GetAtt %ProductName%.Outputs.%Parameter%" to retrieve outputs from the product and maybe add them to the Output of the stack. Is there a way to retrieve those outputs in cdk? I couldn't find a way. Thank you very much :)
    2 replies
    Lachlan Vass
    Is anyone using Java for CDK? What is your experience?
    1 reply
    I have built a python cdk app to provision a Aurora serverless db cluster and a Lambda function to fetch the database records. It works great so I thought of adding an Api gateway with LambdaRestApi Construct to lmbda function. But when I hit the api endpoint I get an error as "BadRequestException: An error occurred (BadRequestException) when calling the ExecuteStatement operation: Access denied for user 'admin'@'10.x.x.xx' (using password: YES); Error code: 1045; SQLState: 28000 "
    pls tel me how to fix this.
    2 replies
    Muhammad Areeb Siddiqui
    Hey guys, I am having a hard time to resolve this error:
    CodePipeline: CodeBuildAppStack' depends on 'CodePipelineAppStack' cyclic reference
    I have opened an issue here basically I am trying to use codebuild Stack with in codePipeline Stack and it gives me this error:
    throw new Error('${target.node.path}' depends on '${this.node.path}' (${cycle.join(', ')}). Adding this dependency (${reason}) would create a cyclic reference.);
    Dan Russell
    Hi all! I've got a problem deploying an ECS cluster to a VPC that doesn't have NAT Gateways due to a somewhat unique configuration where all traffic is routed through transit gateway and through firewall instances. The specific error message is: There are no 'Private' subnet groups in this VPC. Available types: Isolated,Public Is there a workaround to deploying to 'Private' subnets that do not have NAT gateways?
    Dan Russell
    It seems this Gitter is less active than it used to be. Is there a more active forum for support?
    Shane R. Spencer
    re:post might be a good target
    code issues.. github.. assistance… re:post?
    Adam Ruka
    Yes, there is a more active forum! https://cdk.dev/
    1 reply
    Ian Cullinane

    Trying to lookup a subdomain and use if found, and create if not found using Typescript. I am a little confused as to how the relationship between HostedZone.fromLookup, the envvar, and context work together. I am passing an env object into the stack with my region and account number. When I use a knowingly incorrect subdomain I get Found zones: [] for dns:lies.example.com .... which makes sense. However when I try to log some value I get DUMMY so I know that the cli is trying to fill those in later per the docs. I assume the real value is looked up at deploy time, and that is when it is added to context.cdk.json?

    Is there some method I am missing to do if HostedZone exists, and if not create it?

    Ragnar Rova
    It seems that @aws-cdk/aws-sns is not in sync API-wise with @aws-cdk/core
    "dependencies": {
        "@aws-cdk/aws-ecr-assets": "^1.144.0",
        "@aws-cdk/aws-lambda": "^1.144.0",
        "@aws-cdk/aws-sns": "^1.144.0",
        "@aws-cdk/aws-sns-subscriptions": "^1.144.0",
        "@aws-cdk/aws-sqs": "^1.144.0",
        "aws-cdk-lib": "2.12.0",
        "constructs": "^10.0.63",
        "source-map-support": "^0.5.21"

    with code

    export class Wrk2LambdaStack extends cdk.Stack {
        constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {
            super(scope, id, props);
            const queue = new sqs.Queue(this, 'wrk2-queue');
            const topic = new sns.Topic(this, "")


    TS2345: Argument of type 'this' is not assignable to parameter of type 'Construct'. Type 'Wrk2LambdaStack' is not assignable to type 'Construct'. Property 'onValidate' is protected but type 'Construct' is not a class derived from 'Construct'.

    import section for code above was
    import * as cdk from '@aws-cdk/core';
    import * as iam from '@aws-cdk/aws-iam';
    import * as lambda from '@aws-cdk/aws-lambda';
    import * as s3 from '@aws-cdk/aws-s3';
    import * as sqs from '@aws-cdk/aws-sqs';
    import * as sns from '@aws-cdk/aws-sns';
    1 reply
    and npm ls gives
    ├── @aws-cdk/aws-ecr-assets@1.144.0
    ├── @aws-cdk/aws-lambda@1.144.0
    ├── @aws-cdk/aws-sns-subscriptions@1.144.0
    ├── @aws-cdk/aws-sns@1.144.0
    ├── @aws-cdk/aws-sqs@1.144.0
    ├── @types/jest@27.4.0
    ├── @types/node@17.0.18
    ├── aws-cdk-lib@2.12.0
    ├── aws-cdk@2.12.0
    ├── constructs@10.0.63
    ├── jest@27.5.1
    ├── source-map-support@0.5.21
    ├── ts-jest@27.1.3
    ├── ts-node@10.5.0
    └── typescript@4.5.5
    Hey All, I have stacks created CDK deploy and passing in tags. However, tags are not propagated to CloudWatch LogGroups. Is there a way to have tags applied on LogGroups?
    5 replies
    Tyler Getsay
    Could really use some help here if anyone is familiar with SSM, it seems CF is attempting to lookup a secret regardless of whether its in the new template or not
    1 reply
    but that secret is now gone, and I can't recreate it :(
    'Secrets Manager can't find the specified secret' is the message I am getting from CF
    Did anyone migrated from cdk v1 to cdk v2? I am trying to update my CI/CD pipeline .. its giving me tough time.
    @tylergets are you stuck in a rollback state? Experienced the same when introducing new keys in a deployment that failed. Now we reference to versioned secrets, I guess this is only relevant for secret json blobs that holds keys come to think of it
    Sean O'Brien
    Is there a way in cdkv2 to create a private nat gateway? Trying to get around the need of creating an eip. I see a CfnConstruct in v1/v2 but wanted to see if there was something higher level
    Clyo Michel Mayela Ramirez Salas
    from codebuild CfnSourceCredential is possible to set creds but how does it is integrated with codebuild obj or pipeline obj?
    Hello.. I am creating a stack which has an eventbridge and a lambda which does a putevents to the EB. Both are in the same account. Now there is a requirement to allow only this specific lambda to have putevents access and deny all even if they are in the same account. Need help on how to acheve this. We are using python, aws cdk.

    I try to deploy an AWS lambda (multiple AWS lambdas) with AWS CDK.
    Everything works fine when i don't have node modules.
    I want to add winston lib to manage logs now.

    So I added it to package.json.
    I Added in the cdk part:

            bundling: {
                nodeModules: ['winston']

    And I do npm install in my gitlab CI before cdk bootstrap.

    And I get this error:

    npm ERR! cipm can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync. Please update your lock file with `npm install` before continuing.
    npm ERR! 
    npm ERR! 
    npm ERR! Missing: winston@^3.7.2
    npm ERR! 
    npm ERR! A complete log of this run can be found in:
    npm ERR!     /tmp/npm-cache/_logs/2022-05-02T19_19_34_562Z-debug.log
    Luke Bodeen
    hi, we use DockerImageAsset to build an ECR image via aws cdk. I would like to force a build using --no-cache, (we have side scripts that change so we do want the docker build to start completely fresh)
    it doesnt look like there is a way to do this so I was thinking of opening a github feature request

    I migrate from CDK1 to CDK 2.
    But I still have the NOTICES:
    19836 AWS CDK v1 entering maintenance mode soon

    Does it mean I forgot something in my migration or is it normal?


    Hi, I have find the way to change ENUM value with variable.

    const alarm = new Alarm(this, `${params.alarm.name}-Alarm`, {
              threshold: params.alarm.threshold,
              comparisonOperator: ComparisonOperator.GREATER_THAN_OR_EQUAL_TO_THRESHOLD,


    const alarm = new Alarm(this, `${params.alarm.name}-Alarm`, {
              threshold: params.alarm.threshold,
              comparisonOperator: ComparisonOperator.*variable
    can we use cdk to update the vpc info of a lambda function?
    Brian Keifer

    Trying to stand up some DNS servers in Fargate containers. When I define a UDP container, I get the following message:

    Container 'AuthDNSApplicationStack/TaskDefUDP/ContainerUDP' has no mapping for port undefined and protocol tcp. Did you call "container.addPortMappings()"?


    const containerUDP = taskDefUDP.addContainer('ContainerUDP', {
        image: ContainerImage.fromEcrRepository(repository),
        environment: {
            "AWS_ENVIRONMENT": awsEnvironmentString,
            "SLACK_WEBHOOK": assets.slackWebhook,
          logging: LogDrivers.awsLogs({
              logGroup: assets.dnsLogGroup,
              streamPrefix: 'dns',
    containerUDP.addPortMappings({containerPort: 53, protocol: ecsProtocol.UDP})
    Brian Keifer
    Is there an updated link to get an invite for the CDK slack workspace?
    Daniel Bauman
    Hey Folks. Does anyone know if there's a way to use Fn.ConditionIf to conditionally set an array property on a cdk resource.
    EG: I want to set the subjectAlternativeNames on a certificate to some array if a condition is true or AWS::NoValue otherwise. I can't do it with ConditionIf because it only returns a ICfnRuleConditionExpression with a toString().
    Do I need to just use a addPropertyOverride and pass a string?
    Felix Borchers

    Hello, can anyone help me out with advanced CDK testing in python, please?
    I have an EC2 instance which I want to test that it is in a private subnet.
    This is the resolved stack part:

    "SubnetId": {
    "Ref": "testvpcPrivateSubnet1Subnet865FB50A"

    Testing it with: ...

    assert template.has_resource_properties(
        "AWS::EC2::Instance", {"SubnetId": {"Ref": "testvpcPrivateSubnet1Subnet865FB50A"}}

    gives me no match at all. What I am doing wrong?

    new here
    so forgive the possible stupid questions
    I am trying to filter the sent mail by identity in SES
    so right now AWS SES dashboard shows the total amount of sent email no matter the identity
    I would like to get the amount of mails sorted by identity
    any idea?
    I'll help 10 individuals how to earn $20,000 in just 72 hours from the crypto/forex market. But you will pay me 10% commission when you receive your profit. if interested send me a direct message via Whatapp by asking me HOW for more details on how to get started
    +1 (570) 801-0862
    This message was deleted
    K.I. (Dennis) Jung
    This message was deleted