Questions tagged [aws-cdk]

The AWS CDK is an infrastructure modeling framework that allows you to define your cloud resources using an imperative programming interface.

The AWS CDK is an infrastructure modeling framework that allows you to define your cloud resources using an imperative programming interface, currently TypeScript/JavaScript, Python, Java, C# and (beta) Go.

Developers can use one of the supported programming languages to define reusable cloud components called Constructs, which are composed together into Stacks and Apps.

The AWS CDK Toolkit is a command-line tool for interacting with CDK apps. It allows developers to synthesize artifacts such as AWS CloudFormation Templates, deploy stacks to development AWS accounts and “diff” against a deployed stack to understand the impact of a code change.

The AWS Construct Library includes a module for each AWS service with constructs that offer rich APIs that encapsulate the details of how to use AWS. The AWS Construct Library aims to reduce the complexity and glue-logic required when integrating various AWS services to achieve your goals on AWS.

3488 questions
1
vote
1 answer

How to retrieve cognito identification data in Appsync Lambda Resolver (Using cdk)

I have an appsync lambda resolver which will query a postgresql database. Appsync requests are authorized using API keys for unauthorized users and cognito user pools for authorized users. I would like to retrieve identification data from cognito…
1
vote
2 answers

(@aws-cdk/pipelines) Build stage for application source code

I worked through the CDK Pipelines: Continuous delivery for AWS CDK applications tutorial, which gave an overview of creating a self-mutating CDK pipeline with the new CodePipeline API. The tutorial creates a CodePipeline with the CDK source code…
1
vote
0 answers

Creation of a Serverless Discord Bot with AWS CDK in Typescript

I'm try to create a serverless discord bot on AWS using typescript. I've seen a lot of tutorial : Building a Serverless Discord Bot on AWS Serverless Discord Custom Slash Commands bot with AWS API Gateway and Lambda But I don't really understand…
Kinhira
  • 11
  • 1
1
vote
2 answers

AWS CDK - Projen noUnusedLocals

I am building a CDK library and have everything working, but am planning / iterating through some development and when I do not assign a variable to be used, the CDK will fail on build. I know is not best practice to do this, hence throws a test…
NickH48226
  • 149
  • 1
  • 9
1
vote
0 answers

AWS CDK methodOptions wildcard syntax - is my intuition correct?

I've looked for docs that explain this but I've drawn a blank so far. You may specify methodOptions within deployOptions for a RestApi using a wildcard /*/*. My intuition is that if I also add specific HTTP verbs they will override whatever is set…
Roger Heathcote
  • 3,091
  • 1
  • 33
  • 39
1
vote
1 answer

With CDK is it possible to modify the default subnets after they have been created?

I've created a VPC like this vpc = new Vpc(theStack, vpcName, VpcProps.builder() .cidr("10.0.0.0/16") .build()); In eu-west-1, by default I get 3 public and 3 private subnets. The private subnets will have a NAT…
Jörgen Lundberg
  • 1,799
  • 3
  • 22
  • 31
1
vote
2 answers

Deletion of few resources through AWS console for a CDK application

I have a problem that I see many redundant log groups in all my AWS accounts for my CDK (Cloud Development Kit) application. Would it be a problem if I delete these log groups through console? New to CDK and just wanted to ensure that it is safe…
sak18
  • 101
  • 13
1
vote
1 answer

AWS CDK && Gitlab CI - Unable to determine the default AWS account: IncompleteSignature / can't read credentials

Situtation: When I cdk deploy locally, I can deploy the stack to the correct account. However, via gitlab-ci.yml, I get the error: Error: Need to perform AWS calls for account XXXXXX, but no credentials have been configured I've listed at the…
Brad Beggs
  • 21
  • 4
1
vote
1 answer

AWS CDK: Print Secret

I'm creating a Secret in CDK like so: import * as cdk from "@aws-cdk/core"; import * as lambda from "@aws-cdk/aws-lambda-nodejs"; import * as apiGw from "@aws-cdk/aws-apigateway"; import * as secretsmanager from…
yspreen
  • 1,759
  • 2
  • 20
  • 44
1
vote
0 answers

How to add the variable from context in keyconditions aws cdk appsync

How can I provide the id variable from context.args in the following code: requestMappingTemplate: appsync.MappingTemplate.dynamoDbQuery(appsync.KeyCondition.eq("id", ) I know how to get it in VTL, but I cannot find any example of adding the…
plutolaser
  • 448
  • 4
  • 17
1
vote
2 answers

AWS CDK - How to run API and Lambdas locally?

edit: Turns out the solution is in the docs. I had bog standard normal 'sam' installed but I needed what they call the 'public preview version' AKA 'sam-beta-cdk'. With this installed the API can be started locally with sam-betacdk start-api and…
Roger Heathcote
  • 3,091
  • 1
  • 33
  • 39
1
vote
1 answer

CDK ElasticSearch: Setting AccessPolicies property causes stack to fail

❯ cdk --version 1.122.0 (build ae09c16) My definition looks like this: new DomainProps { Version = ElasticsearchVersion.V7_10, DomainName = domainName, Vpc = Context.Network.VPC, …
Brandon Prudent
  • 313
  • 3
  • 8
1
vote
1 answer

Reuse custom authorizer for AWS ApiGW using CDK

I would like to reuse a custom authorizer that was created using CDK in one repository for a new AWS ApiGW method that was created in another repo. Currently, there is no CDK built-in method for importing an existing authorizer.
1
vote
1 answer

Typescript error: It is not assignable to parameter of type (same type different folder)

I am currently working on aws cdk, where I am using Typescript for the setup. I have a question, where I have same library but they are referred as not same type. Compilation Error: Argument of type…
Smit
  • 2,078
  • 2
  • 17
  • 40
1
vote
1 answer

Event pattern in AWS EventBridge filter using fields, not content

I know we can have AND condition in event pattern, for example: { "field1": ["option1", "option2"], "field2": ["option3"] } is there anyway, we can add a OR condition between field1 & field2? So the event rule will be satisfied on both…
saif
  • 370
  • 1
  • 3
  • 16