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
2 answers

Using AwsCustomResource for a large number of resources?

I need a component for creating a large number of CodeCommit users. CloudFormation doesn't support adding a public SSH key for an IAM user, so I have to create my own. CDK comes with AwsCustomResource, which does the heavy lifting of creating the…
eof
  • 413
  • 4
  • 14
1
vote
1 answer

AWS CDK Pipeline not triggering on push to bitbucket

So I set up the connection in the pipeline settings and then applied the arn like so: const pipeline = new CodePipeline(this,'SettingsPipeline' , { pipelineName: 'SettingsPipeline', synth: new CodeBuildStep('SynthStep', { …
1
vote
1 answer

cdk watch command never returns

I'm following the workshop provided by aws, https://cdkworkshop.com/20-typescript/30-hello-cdk/300-cdk-watch.html. When I issue $ cdk watch After the command is succeeded, it never returns. I can see that the new function is deployed correctly on…
Libertatem
  • 71
  • 1
  • 6
1
vote
0 answers

How to get PrimaryClusterId from CfnReplicationGroup in aws cdk

I have created global datastore(Test-Replication-group) using cdk and it has 1 primary node and second is replica node Test-Replication-group-001 Test-Replication-group-002 So how can I access this 2 node using cdk(typescript)
1
vote
1 answer

AWS CDK pass branch name from Event to CodeBuild project

In AWS CDK, I would like to define a CodeBuild project that will run every time a pull request is opened or updated in CodeCommit. I am doing this to be able to have my tests and build validated prior to merging to the main branch. How do I have…
1
vote
2 answers

AWS Python Lambda "Hello World" + psycopg2 dependency = 3.2 MB. Can I shrink?

I have a trivial python lambda function defined in index.py: def handler(event, context): return {"msg": "hello world. this is hello handler"} Deployed via CDK (typescript): const stack = new Stack(app, "PythonHelloStack", {env}) new…
clay
  • 18,138
  • 28
  • 107
  • 192
1
vote
1 answer

aws-cdk add SQS eventSource to existing Lambda

I'm creating multiple SQS queues, and I want to add a Lambda trigger after the queues are created. I'm getting an error (see below) when I do the cdk synth command. I'm using the version 1.130 of aws-cdk and the packages are all the same version…
JBerto
  • 143
  • 5
  • 16
1
vote
1 answer

CREATE_FAILED | AWS::S3::Bucket, the invisible bucket is exist?

I am using aws-cdk and $cdk deploy to deploy some stacks. However, there comes error like this 21:12:30 | CREATE_FAILED | AWS::S3::Bucket |…
whitebear
  • 11,200
  • 24
  • 114
  • 237
1
vote
1 answer

How to associate an elastic ip with a NAT instance in AWS CDK?

I created a NAT instance using AWS CDK. const nat_instance_provider = ec2.NatProvider.instance({ instanceType: new ec2.InstanceType('t3.micro') }); Then I created an elastic IP. const elastic_ip = new ec2.CfnEIP(this, "elastic_ip"); Now I need…
Geoffrey-ap
  • 380
  • 3
  • 12
1
vote
1 answer

In AWS CDK, how should CodeStarConnectionsSourceAction be used as input to a CodePipeline?

I'm trying to have a pipeline that fetches code from Github and deploys it (Lambda, DynamoDB, etc, using CDK). I'm trying to make it work with CodeStarConnectionsSourceAction at the moment and my code is failing with this error: …
1
vote
1 answer

Trying to pass an a type to CDK Event Rule RuleTargetInput but the output json has slashes

I have a class that I want to fill then pass to an event rule as payload. like this. public class Payload { public string Site {get;set;} public string Region {get;set} .... } now in my CDK I fill these with other values var payload =…
causita
  • 1,607
  • 1
  • 20
  • 32
1
vote
1 answer

AWS CDK DocDB::DBCluster fails with 'not a valid password'

I am trying to use AWS CKD (JAVA) to create a DocumentDB instance. This works with a "simple" plaintext password, but fails when I try to use a DatabaseSecret and a password stored in Secrets Manager. The error I get is this: 1:44:42 PM |…
Marco Massenzio
  • 2,822
  • 1
  • 25
  • 37
1
vote
1 answer

CDK Unit test using jest and NodeJsFunction

I faced issue when trying to writs units for my CDK project. Stack is creating, pretty simple one: -> APIGateway (Rest) -> POST endpoint pointing to lambda -> Lambda I have very simple unit: describe("Test WebhookProxyStack", () => { …
1
vote
1 answer

CDK deploy Gatsby site exceeds 50 routing rules

Trying to deploy a Gatsby site with AWS CDK but the BucketDeployment always fails the error message: CREATE_FAILED | Custom::CDKBucketDeployment | DeploySiteCustomResourceE47C9748 Received response status [FAILED] from custom resource. Message…
user17561857
1
vote
1 answer

How to install python 3.9 on Amazon Linux 2 with cloud-init and CDK

I'm trying to install Python 3.9 an EC2 instance that uses Amazon Linux 2. I tried following this guide: https://computingforgeeks.com/install-latest-python-on-centos-linux/, and I was able to install Python3.9 manually on the EC2 instance by…
briancaffey
  • 2,339
  • 6
  • 34
  • 62