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

Can a Amazon States Language json file be generated from CDK step functions TS file

If I have a CDK *.ts file that defines my AWS Step Functions, is it possible to generate an Amazon States Language asl.json file that I can use it to visualize that step function process (using the AWS Toolkit for VS)? I took a look at: Is there a…
Perry Hoekstra
  • 2,687
  • 3
  • 33
  • 52
9
votes
3 answers

use aws `cdk synth` output via cloudformation

I am working in an environment with existing Cloudformation based pipelines. I am wondering if it's possible to describe my infrastructure in CDK and then generate the Cloudformation to be used in the pipeline with no changes to the pipelines. I…
sumek
  • 26,495
  • 13
  • 56
  • 75
9
votes
3 answers

Adding AWS Cognito User Pool role using CDK

I have deployed https://github.com/aws-samples/amazon-elasticsearch-service-with-cognito to my stack, and am trying to add a master group as per…
khinester
  • 3,398
  • 9
  • 45
  • 88
9
votes
2 answers

Create/associate ssh keypair to an ec2 instance with the CDK

I'm using the new Cloud Development Toolkit (CDK) to build an infrastructure on AWS using Java language. I'm using a Bastion Host on a public subnet to communicate with an RDS instance on a private subnet, so I reach the database (on the private…
Overflow 404
  • 482
  • 5
  • 20
9
votes
3 answers

Provision lambda concurrency in CDK

I am trying to provision lambda concurrency via CDK. I have a couple of CfnFunctions and I need to provision them. Provisioning can be done on aliases only. Hence, when I add autoPublishAlias to the CfnFunction, the APIG trigger does not work. How…
user7365614
  • 469
  • 2
  • 4
  • 14
9
votes
2 answers

AWS cdk Stack deployment order

I'm looking for a way to specify the deployment order of my stacks in my project. I know I could add dependencies, however, these stacks do not depend on each other and I might want to delete some at a later time. I have a framework of services that…
Lightning303
  • 91
  • 1
  • 1
  • 3
9
votes
1 answer

AWS CDK: Error when deploying Redis ElastiCache: Subnet group belongs to a different VPC than CacheCluster

Summary I am trying to deploy a Redis ElastiCache Cluster on AWS using CDK. I want the cluster to be within a VPC for security reasons. My code (see supra) defines a VPC, a security group, a cache subnet group (linked to vpc private subnets) and the…
9
votes
3 answers

How do i add Input transformation to a target using aws cdk for a cloudwatch event rule?

After i create a cloud-watch event rule i am trying to add a target to it but i am unable to add a input transformation. Previously the add target had the props allowed for input transformation but it does not anymore. codeBuildRule.addTarget(new…
mohantyArpit
  • 373
  • 4
  • 9
9
votes
2 answers

Add Conditions to Resources in CDK

I have created a CDK stack that will be deployed in multiple regions. One of the constructs shall only be deployed in one region. In Cloudformation I'd simply add a Condition to the resource, but I haven't found a way to do something similar with…
Lukas
  • 178
  • 1
  • 1
  • 11
9
votes
3 answers

CDK split API Gateway stack into 2 small stacks

I'm trying to create a CDK stack in order to create API Gateway. Everything working as excepted if I create the stack in "small pieces" (comment part of the resources), But when I'm trying to create the completed stack I'm getting this exception: …
Amit Baranes
  • 7,398
  • 2
  • 31
  • 53
9
votes
1 answer

How to provide multiple account credentials to `cdk bootstrap`?

We are developing a multi-account CDK app, and performing continuous deployment on CodeBuild. We are aware of CDK authentication issues so we use $ aws sts assume-role and set environment variables to switch AWS accounts during $ cdk deploy. This…
rinfield
  • 164
  • 2
  • 10
9
votes
2 answers

Is it possible to deploy AWS CDK stacks from within a Lambda?

I want to deploy AWS CDK stacks from with a Lambda function. The use case is to support similar functionality to that described in Trek10's Serverless CI/CD pipeline, where the relevant code is here. In a nutshell, AWS CodePipelines only support…
John
  • 10,837
  • 17
  • 78
  • 141
9
votes
1 answer

How can I access an EC2 instance created by CDK?

I am provisioning an infrastructure using this CDK class: // imports export interface AppStackProps extends cdk.StackProps { repository: ecr.Repository } export class AppStack extends cdk.Stack { public readonly service: ecs.BaseService …
Jayr Motta
  • 718
  • 1
  • 8
  • 26
9
votes
1 answer

How to wait stack to complete before executing code in AWS CDK?

I'm trying AWS CDK and got stuck when I tried to execute a code block that depends on the stack completion. Here's my current code: class Application extends cdk.Construct { constructor(scope: cdk.Construct, id: string) { super(scope,…
kkesley
  • 3,258
  • 1
  • 28
  • 55
9
votes
1 answer

How to setup CloudFront with ApiGateway and S3 using AWS CDK?

I'm trying to use the AWS CDK to setup a CloudFront distribution with 2 different origins: S3 ApiGateway Here's a diagram of the stack. The problem I am having is that I can't pass the domain of the API Gateway to the CloudFront distribution…