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.

Filter by
Sorted by
Tagged with
0 votes
0 answers
24 views

Deploying ECS with CDK

I have been going at it now for a day and just cant get ECS to deploy using EC2, I am getting this error service prod-ecsStack-EC2Service5392EF94-71wVDsfHgsZh was unable to place a task because no ...
Ben's user avatar
  • 9
0 votes
1 answer
19 views

AWS CDK: Moving resources between stacks

Is that possible to move a DB from a Stack to another? Here is the example, I haven't the following code: export class ParentStack extends cdk.Stack { constructor(scope: Construct, id: string, props?...
user3045808's user avatar
0 votes
0 answers
10 views

ES6 imports from CDK-constructed NodeJs 20.x AWS Lambda with inline code

For e.g. quick and dirty listeners I've used lambdas on the Node.js 18.x. Now with Node.js 20.x I tried to ES6 imports etc but I can't get it to work since I've understood that I would have to a) ...
Nicklas Karlsson's user avatar
0 votes
1 answer
35 views

How can I filter subnet by ID for Ec2 CDK?

I'm looking for a way to filter a subnet by Id, from the docs seems like we can use SubnetFilter but I can't parse the subnetFilter to a SubnetSelection: // Err: Initializer type Subnetfilter Is not ...
Jaime FH's user avatar
  • 148
0 votes
1 answer
12 views

Why use CfnAppSync rather than AppSync in CDK project?

We need to add new JS resolvers to our API, and phase out the VTL resolvers, for an AWS AppSync CDK project built with Cfn<> Cloud Front CDK, like this: let resolver = new CfnResolver(...
MonsCamus's user avatar
  • 131
0 votes
0 answers
15 views

AWS CDK: Handling Security Group Deletion Failure Due to Dependent ENIs

My cdk stack will not destroy because of dependent Elastic Netwrok Interface (ENIs). The stack includes a Lamda function and a security group, and even through the lambda function is deleted correctly,...
himahimahima's user avatar
0 votes
1 answer
40 views

Lambda Function connection to RDS timing out (*Private Isolated Subnets only no NAT Gateway or IGW)

Does anyone know if it's possible to connect Lambda to RDS in the same VPC with just isolated subnets where both resources are in the same subnets? I've fiddled and searched far and wide for a few ...
makisupa488's user avatar
0 votes
0 answers
17 views

when and why should I override logical id in CDK

When the logical id of a resource changes, CDK would delete the old resource with the old logical id, and create a new resource with the new logical id. There are concerns that critical resources may ...
lipeiran's user avatar
  • 556
0 votes
1 answer
17 views

AWS Cloudwatch list-metrics in CDK

Is there is a way to automatically get all the dimensions of a metrics from CW in AWS CDK code? There is a cli command (aws cloudwatch list-metrics) and SDK API (list-metrics) too.. I am unable to ...
Scooby's user avatar
  • 635
0 votes
0 answers
12 views

AWS CDK Batch - Job Definitions platform capabilities

I am updating a FARGATE spot batch jobs to use the newer L2 constructs and I am running into the error, An error occurred (ClientException) when calling the SubmitJob operation: Job Queue is attached ...
spitfiredd's user avatar
  • 2,937
0 votes
0 answers
18 views

how to attach an API gateway endpoint to an API gateway created in a different cdk stack

I have a main stack (shared resources) and several worker stacks. My main stack contains an api gateway resource, I pass this into the worker stacks that will attach a new endpoint to this resource ...
Matthew D'vertola's user avatar
0 votes
1 answer
32 views

How to deploy React to AWS using AWS CDK?

I have the following React project structure project/ - cdk/ - bin/ - cdk.ts - lib/ - pipeline.stack.ts - etc. - src/ - all files related to React app package.json (...
Roman Mahotskyi's user avatar
-1 votes
0 answers
34 views

AWS CDK newly added data delay issue to display [closed]

I am facing data delay issue in my application. When I add new data it take to much time to display on live site but working fine when I attach live database with my local code. CDK usually take 5 to ...
Hamza Ess's user avatar
-1 votes
0 answers
26 views

IaC Secrets Manager can't find the specified secret when AWS CDK in Deploy

I'm having an issue when trying to create and replicate the secret of the database created within the provisioned cluster. I have attempted to specify the ARN of the secret in the Parameter Store ...
BlackHat's user avatar
0 votes
1 answer
21 views

Setting the Maximum Timeout for an AWS Step Function Task in CDK

I am working on an AWS Step Function workflow using the AWS CDK, and I have a task in my workflow that sends a message to an SQS queue. I want to set a maximum timeout for this task to ensure it keeps ...
Lloukas's user avatar
  • 131
0 votes
1 answer
31 views

Adding a secret value to an EcsJobDefinition

I am trying to add a secret value to my ECS Job definition, secret_id = f"mysecretid" secret = secretsmanager.Secret.from_secret_name_v2( self, ...
spitfiredd's user avatar
  • 2,937
1 vote
0 answers
53 views

AWS Go lambda recevie raw http request bytes without any base64 encoding through API gateway

I am trying to build a rest api with Go using lambda and api gateway. In the api, I want to process the raw request body bytes without any base64 conversion in middle. I am able to receive base64 ...
Swati's user avatar
  • 13
1 vote
1 answer
20 views

Override EC2 Image ID for AWS Batch Compute Environment - on AWS CDK Stack

I'm creating a CloudFormation Stack using AWS CDK (for Python) and one of its main components is a Batch Compute Environment which should run GPU intensive jobs. Batch jobs would simply not work with ...
Luiz Tauffer's user avatar
0 votes
0 answers
19 views

AWS CDK Pipeline - Cross-account pass role is not allowed

I would really appreciate some help with this issue I am facing. I am looking to enable Cross Account Deployments using CodePipeline Actions. I do not want to use cdk pipelines, I know it does these ...
Soley Digital's user avatar
0 votes
1 answer
24 views

Create an aws integration in Http API using AWS CDK

I'm using AWS CDK to build a cloudformation stack with HttpApi in it. HttpApi will have an integration with SQS. I have the following snippet: import * as ApiGW2 from "@aws-cdk/aws-apigatewayv2-...
Alexander Kondaurov's user avatar
0 votes
0 answers
26 views

AWS CDK How to handle Fn.getAtt to return integer

I am utilizing a custom resource to retrieve an integer value. However, despite the CDK parameter specifically requiring an integer, I encounter an error stating type of argument must be one of (int, ...
GeoCom's user avatar
  • 1,300
0 votes
0 answers
37 views

Use "latest" ECR Image in CDK Lambda Build

I have a CDK build where currently I have it as two different stacks. Stack one is to build ECR image from Docker. Stack two is for the remainder of my CloudFormation application, including a Lambda ...
Shaun Worcester's user avatar
0 votes
1 answer
30 views

AWS CDK: Reuse NAT-Gateway and App Load Balancer (ALB) to reduce cost

I am new in AWS with CDK and trying to reduce cost in NAT-Gateway and ALB. I have a stack for every client within NAT-Gateway, ALB, EC2, EFS and so on. If I have 3 clients I will end with 3 NAT-...
MLeganes's user avatar
0 votes
0 answers
31 views

CDK - Iterate over a SecretManager keys

Let's say I have an Express application that makes calls to a third-party API on behalf of customer companies that use the system. The application includes the company's API key in the request, which ...
Samuele B.'s user avatar
0 votes
0 answers
13 views

How to setup detailed metrics for apigateway using CDK and C#

I want to enable this functionality in the API Gateway so I can see 500 errors at a method level and not at the entire API Gateway level. However there doesn't seem to be any way in CDK code to set ...
user20358's user avatar
  • 14.3k
0 votes
0 answers
25 views

Eventbridge Rule target with input transform for list

I am trying to do input transform from a list of objects. This is how the event detail: "detail": { "Id": 11111, "Name": "test", "Subjects"...
JPil's user avatar
  • 271
0 votes
1 answer
20 views

Aws CDK create sampling rule

can someone point out the error in this instantiation? I tested this rule in the console and it seems to work: import * as xray from 'aws-cdk-lib/aws-xray'; new xray.CfnSamplingRule(this, '...
b3a's user avatar
  • 81
0 votes
1 answer
40 views

Langchain is giving me NUMPY import error when I am creating a lambda layer via AWS CDK

I am using MAC M1 and creating a container image via AWS CDK python Layer: langchain_lambda_layer = _alambda.PythonLayerVersion( self, "langchain-lambda-layer", entry="./...
dinesh mane's user avatar
0 votes
1 answer
50 views

AWS CDK EC2 user data - copy local file to EC2 instance

In my AWS CDK code for setting up EC2, I’m trying to put a local file to a certain location in my instance. The only overcomplicated way I can think of is to upload it to s3 in the CDK code, and then /...
waynewingorc's user avatar
1 vote
0 answers
47 views

Changing the encryption settings of EC2 EBS devices while creating a launch template using AWS CDK with Python

In my AWS environment, I have an unencrypted AMI. When I launch EC2 instances from it, their EBS volumes are unencrypted, as expected. I'm trying to change the encryption settings of the EBS volumes ...
Rafiq's user avatar
  • 1,402
0 votes
1 answer
66 views

AWS Code Build artifact is missing one file

I have a code build instance which is building a CDK app in a MonoRepo into a dist folder. If I run ls in the folder after the build command it shows all files outputted buy the build but then the ...
Mercury's user avatar
  • 622
0 votes
1 answer
46 views

How to import 'ClusterInstance' from aws_rds (module 'aws_cdk.aws_rds' has no attribute 'ClusterInstance')

Trying to run the docs from (https://docs.aws.amazon.com/cdk/api/v2/python/aws_cdk.aws_rds/ClusterInstance.html), it says ClusterInstance is a part of aws_rds. When cdk synth gets to that line, it ...
Cameron Showalter's user avatar
1 vote
1 answer
78 views

When using CDK with multiple stacks in typescript, how can I stop the cdk deploy command from bundling all lambda functions?

I have 2 stacks defined, for 2 separate lambda functions. Each one has a separate package.json and it's dependencies. When I have them built locally, I can run a cdk deploy Stack1 command successfully....
ricardosmg's user avatar
0 votes
0 answers
15 views

CDK Wont add tags to ELB listener (Java)

I'm currently trying to add Tags to an ELBs listener via CDK, I can do this on the console UI however even when I run CDK synth I see that the tags arent necessarily added, however this works when ...
Sello L's user avatar
0 votes
1 answer
25 views

DynamoDB resource creation test in CDK fails when using TableV2

Jest test fails when using DynamoDB TableV2 instead of Table: CDK code const table = new dynamodb.TableV2(this, tableName, { partitionKey: { name: environmentInputs.partition_key, type: ...
Khaled Abbas's user avatar
1 vote
0 answers
21 views

UserPoolIdentityProviderGoogle email_verified AttributeMapping missing in CDK construct

When adding Google as IDP in Cognito via Console in Mapping attribute there is an option to add email_verified attribute that will set email as Verified in your Cognito UserPool when you sign in. But ...
aleksandralj's user avatar
1 vote
1 answer
79 views

Combining JsonPath listAt and stringAt to make a single array in AWS Steps/CDK

I am invoking an AWS Steps orchestration - and one of the contained steps is to invoke an ECS Fargate Task. I currently pass some of the Steps' inputs as the "command" of the ECS Task using ...
Andrew Patterson's user avatar
1 vote
2 answers
74 views

How do I properly build multiple pipelines via CDK and CodePipelines in the context of a monorepo?

I've got a monorepo that's structured like this. All infra is CDK v2, and I'm trying to determine the best way to build pipelines in this context. At this point, I've got two of them fully working, ...
Tsar Bomba's user avatar
0 votes
1 answer
65 views

Aurora serverless v2 execute SQL in CDK

I'm trying to create an Aurora Serverless v2 DB cluster with CDK, and creating the database right after the cluster is provisioned. I have this code: const dbSecurityGroup = new ec2.SecurityGroup(this,...
blastervla's user avatar
-2 votes
2 answers
39 views

How do I configure Dockerized Lambda Image Configuration with CDK?

Currently using DockerImageFunction, but I can’t figure out how to set the CMD Override. Any advice would be appreciated. Repo: https://github.com/alphaHades/Dockerized-Lambda-NR/blob/main/lib/docker-...
AlphaK12's user avatar
0 votes
1 answer
27 views

Route subdomains to separate ECS Services without Route 53

Is it possible to have 2 ECS Services in the same task, accessible from different subdomains without Route53? I am using Fargate but that is not necessary if it makes a difference. For example: foo....
Coder1's user avatar
  • 13.2k
1 vote
1 answer
47 views

How to properly reference resources in one CDK app from another?

I haven't been able to find a clear answer to my question anywhere so hoping people can help me out or point me to some documentation and/or articles that discuss this topic. Let's say I have 3 ...
HumanTarget's user avatar
1 vote
0 answers
57 views

Github Action Mkdocs with Aws-Cdk

i am getting a terminal error saying: remote: Write access to repository not granted. fatal: unable to access 'https://github.com/@username/cdk-github/': The requested URL returned error: 403 I ...
zizora's user avatar
  • 19
0 votes
0 answers
25 views

AWS CodeBuild InvalidIdInRequest HttpErrorCode: 400 Error when passing credentials to Docker Runtime

Following the "Unable To Locate Credentials" section from this document, I am passing AWS_DEFAULT_REGION and AWS_CONTAINER_CREDENTIALS_RELATIVE_URI to Docker Runtime in my cdk code like this ...
karan mirani's user avatar
0 votes
0 answers
36 views

CDK - Secure Method to Include Necessary Secrets in API Gateway Event Target

I have the following API Gateway EventBus event target defined in CDK: const key = cdk.aws_secretsmanager.Secret.fromSecretCompleteArn( this, 'key', process.env.key, ...
Sa'id Kharboutli's user avatar
2 votes
1 answer
196 views

Set "Enforce inbound rules on PrivateLink traffic" setting in AWS CDK

In order to allow API Gateway access to my private Network Load Balancer in AWS, I need to set the property Enforce inbound rules on PrivateLink traffic to Off (see reference). This is very easy to do ...
aensm's user avatar
  • 3,367
0 votes
1 answer
40 views

AWS CDK, non-obvious cyclic dependency between fargate task and rds

I am trying to understand the cyclic dependency happening in my app. It's pretty clear that cyclic dependencies can be a <-> b, or something more complex where multiple components are involved. ...
Nikola-Milovic's user avatar
0 votes
0 answers
26 views

Adding new L2 Fargate service to existing L3 Fargate Service Load balancer

I have an existing service setup. 1 ECS cluster stack, 1 ECS Service stack(all resources including ALB are created in it), 1 Fargate Service stack (Default 'PublicListener' with default rule was ...
Drazer's user avatar
  • 67
0 votes
1 answer
69 views

SubnetIds are empty when creating an Elasticache cluster using CDK

When creating a VPC and a simple Elasticache (Redis) cluster using CDK, the stack creation fails with the following error: "The parameter SubnetIds must be provided." My code creates a VPC, ...
Ejnar's user avatar
  • 23
1 vote
2 answers
48 views

Using Python aws-cdk to Map One Load Balancer to Multiple ECS Services

I have multiple Docker containers that I'd like to put behind a single Application Load Balancer in AWS. The containers run in EC2 ECS, not Fargate, for cost. I'm able to do this in CloudFormation, ...
Jon Buys's user avatar
  • 517

1
2 3 4 5
72