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

ECS task unable to pull secrets or registry auth

I have a CDK project that creates a CodePipeline which deploys an application on ECS. I had it all previously working, but the VPC was using a NAT gateway, which ended up being too expensive. So now I am trying to recreate the project without…
e-e
  • 1,071
  • 1
  • 11
  • 20
1
vote
2 answers

AWS CDK: Lambda resource based policy for a function with an alias

I am using CDK to create a lambda, a new version of the lambda, and point the "live" alias to the newest version of the lambda like so const func = new lambda.Function(this, 'lambdaName', { // Other properties …
PodGen4
  • 338
  • 4
  • 12
1
vote
0 answers

Trivial Lambda function works on AWS but not on `sam local start-api`

There are so many moving parts here I'm not sure which ones are relevant. The Lambda function is defined like this: import {APIGatewayProxyEvent, APIGatewayProxyResult} from "aws-lambda" import {DynamoDBClient} from…
Pablo Fernandez
  • 279,434
  • 135
  • 377
  • 622
1
vote
1 answer

How can I clone a CDK resource?

Let's say I'm using the AWS CDK with TypeScript. Is there a way to define a function that takes a resource as a parameter and creates a clone with tweaked parameters? Alternatively, do CDK constructs allow extracting all their attributes so I can…
Antrikshy
  • 2,918
  • 4
  • 31
  • 65
1
vote
2 answers

MWAA Webserver IPs on CDK

I'm creating an Amazon Managed Airflow (MWAA) using CDK with the setting of webserver_access_mode='PRIVATE_ONLY'. In this mode, AWS creates a VPC interface endpoint and binds an IP address, from the selected VPC private subnets, to them as explained…
lspinheiro
  • 423
  • 1
  • 4
  • 9
1
vote
1 answer

aws api-gateway - cdk stage deployment setup - updating without drift

I want to setup an api gateway using cdk - with RestApi, Resource, Method and Stage - all included in the cdk stack. To create the Stage construct in the cdk stack, it required a Deployment, so I defined this in the cdk stack. deployment =…
1
vote
1 answer

Is there a way to get the Amazon State Language JSON representation of a State Machine created within AWS CDK

My CDK infrastructure (a typescript file) has a lambda that will create a new State Machine when it runs. To do so it needs the Amazon State Langauge JSON representation of the machine I want to create. I have created the State Machine within my AWS…
1
vote
1 answer

Is there a way to set the default password while making RDS by cdk

I made the RDS with this script by cdk. It makes the user myname as admin, however where can I get the password? And also, is there any way to set the default password by script? const dbInstance = new rds.DatabaseInstance(this, 'Instance', { …
whitebear
  • 11,200
  • 24
  • 114
  • 237
1
vote
1 answer

How can I deploy cdk python to multiple environment to self.node.try_get_context('env') and some logic to specify where the stack gets deployed

I have created the following vpc class using python aws cdk, I need help understanding how to dynamicaly set the env variable through self.node.try_get_context('env') to represent the environment where the stack will be deployed, for example…
chief-O
  • 13
  • 4
1
vote
1 answer

How to configure AWS SQS via CDK to receive messages from outside world?

I have a normal monolith app running on Heroku. I would like to use an SQS queue to process some background jobs. Monolith -> posts to SQS -> SQS holds event & calls -> Monolith -> Confirms processing and deletes event from SQS I already have an S3…
Oscar Franco
  • 5,691
  • 5
  • 34
  • 56
1
vote
0 answers

If deadLetterQueue is encrypted shouldn't lambda know how to decrypt master key?

As in question. Wonder about use case where deadLetterQueue passed to lambda function is actually encrypted. Shouldn't a policy in lambda include permissions to decrypt sqs.IQueue encryptionMasterKey? Similarly to what grantConsumeMessages is doing?
kornicameister
  • 305
  • 1
  • 15
1
vote
1 answer

AWS CodeCommit SSH connection stopped working suddenly (It was worked well before)

I'm working for an AWS CDK Pipeline with a source repository in AWS CodeCommit. I set the pipeline works with the specific branch push in the repository. And I used SSH connection (IAM USER > security credentials > SSH keys for AWS CodeCommit) to…
Noah Gray
  • 151
  • 1
  • 1
  • 13
1
vote
1 answer

Typescript interface + constants vs class for defining enum-like object

I am new to typescript, and I am trying to define an enum-like class with some additional attributes. I have seen there are two different approaches of doing this: Using a class, similar to what I would do in Java: export class AwsRegion { …
Raquel
  • 89
  • 8
1
vote
1 answer

How do I make my CloudFormation / CodePipeline update a domain name to point to an S3 bucket when using CDK?

I'm using CDK to deploy a CodePipeline that builds and deploys a React application to S3. All of that is working, but I want the deployment to update a domain name to point that S3 bucket. I already have the Zone defined in Route53 but it is defined…
Pablo Fernandez
  • 279,434
  • 135
  • 377
  • 622
1
vote
1 answer

AWS CDK synth and deploy from JAR file

I order to treat my Infrastructure as code I would like to create a pipeline where my app code (let's say some lambda functions) are compiled, packaged and uploaded/deployed with a respective version to my Artifacts repo (CodeArtifact) INCLUDING my…
Teimatini Marin
  • 445
  • 1
  • 3
  • 11