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

Cannot use existing log group in ECS scheduled task (aws-cdk)

I am trying to add an existing log group to my ECS scheduled task to avoid creation of new log groups with random name. But the aws-cdk (typescript) keeps giving me error that the types are not assignable. const myLogGroup = …
1
vote
1 answer

Cloudformation: Import existing resource

I have used cdk to invoke a custom cloudformation which invokes a lambda. The lambda creates few resources internally. I have used AWS SDK to create these resources. There are some logic before resources are created. This makes it difficult for…
1
vote
2 answers

Connect Lambda to Redis Cluster without hardcoding the Redis host/port in lambda environment since both these resources are created in same CDK stack

I am trying to create an ElastiCache (Redis) cluster and a Lambda function that will write to this Redis cluster. Both these 2 resources will be created as a part of the same CDK stack written in typescript language and in their own constructs (i.e…
1
vote
2 answers

Creating a resolver to update dynamoDB item through AppSync - AWS CDK

So I created a resolver to create an item in the table using the below code. const configSettingsDS = api.addDynamoDbDataSource('configSettingsDynamoTable', configurationSettingsTable); configSettingsDS.createResolver({ …
1
vote
1 answer

VTL: Add a new property to an maps inside an array (AWS Appsync, DynamoDB)

I'm new to VTL and AWS appsync and try to get my head around how things are working. The maps that are representing Steps in a List should have the property id with a UUID before there are stored in DynamoDB. To accomplish this I tried to iterate…
JBDev
  • 144
  • 1
  • 10
1
vote
2 answers

getting error whenever try to deploy backend with cdk via gitlab , in local it will works as expected

I am trying to deploy backend serverless resources with CDK in AWS cloud but getting errors while deploying things via GitLab build. trying with a local visual studio it works fine. error is below : $ npm run deploy-backend >…
1
vote
2 answers

AWS CDK: Cannot find module 'typescript'

Long story short, I have a mono repo that I have been using for almost a year. I had a hard drive failure and had to reinstall my OS. Now, when I try to do anything with the CDK, I get this error every time. Cannot find module 'typescript' Require…
Jeremy
  • 1,878
  • 2
  • 30
  • 54
1
vote
1 answer

Trouble with Snapshot tests in CDK

I am trying to do some snapshot testing on my CDK stack but the snapshot is not generating. This is my stack: export interface SNSStackProps extends cdk.StackProps { assumedRole: string } export class SNSStack extends cdk.Stack { …
DrkStr
  • 1,752
  • 5
  • 38
  • 90
1
vote
1 answer

AWS CDK alternative to using Params in StepFunctions

I am working on AWS CDK (ver2 since we all hated the versioning in ver1) in js/ts, and I am trying to replace our current Cloudformation stack/implementation with CDK, for some obvious reasons. The current Cfn repo has a structure like this: . ├──…
1
vote
1 answer

How to pass list to aws CDK bootstrap `--cloudformation-execution-policies` parameter in powershell

Goal To use AWS CDK bootstrap command in powershell, using the --cloudformation-execution-policies argument with a list. The documentation does not have specific examples for OSs. Tests Passing a single string worked fine, eg:…
Efren
  • 4,003
  • 4
  • 33
  • 75
1
vote
0 answers

The MessageGroupId parameter is required for FIFO topics wtih stepfunction

I have SNS FIFO Topic, and using the step function SnsPublish to publish a message, but I am getting this error Error SNS.InvalidParameterException Cause Invalid parameter: The MessageGroupId parameter is required for FIFO topics (Service:…
Yahya
  • 51
  • 7
1
vote
1 answer

How to connect lambda to CloudFront? AWS CDK JS

Code: rootOriginFunc = new cloudfront.experimental.EdgeFunction(stack, 'RootOriginFunction', { runtime: lambda.Runtime.NODEJS_14_X, handler: 'origin.handler', code: lambda.Code.fromAsset("./lib/lambdas"), }); const…
Dennis Liger
  • 1,488
  • 2
  • 13
  • 28
1
vote
2 answers

Unable to attach EC2 instance to a classic load balancer in AWS CDK

I have created an EC2 instance and a Classic Load Balancer in AWS CDK using typescript. But I'm unable to add that EC2 instance directly to that Load balancer. this.Instance= new ec2.Instance(this, 'my-Instance', { vpc, instanceType: new…
1
vote
1 answer

How to delete lambda function log group on CDK destroy using CDK?

Currently, I am trying to delete a log group from a lambda function that's created by AWS CDK Here is what my stack currently looks like: from aws_cdk import ( core, aws_lambda ) from aws_cdk.aws_logs import CfnLogGroup, LogGroup from…
1
vote
0 answers

AWS cdk retrieve account number when working with roles

I have the following ~/.aws/config and try to run ENV=dev cdk synth --profile test --all. Inside CDK my code then tries to determine the profile's account number. Reading the environment variable CDK_DEFAULT_ACCOUNT. Sadly, this is returning 001xx,…
lony
  • 6,733
  • 11
  • 60
  • 92
1 2 3
99
100