Questions tagged [cdktf]

Resources:

28 questions
3
votes
1 answer

Should I choose Terraform cdktf over aws cdk

I am having difficulty in understanding whether to use aws cdk or terraform cdktf. From my work so far, it appears to me that aws cdk has more robust patterns and constructs which will comply with the well architected framework, all available out of…
Chubsdad
  • 24,777
  • 4
  • 73
  • 129
2
votes
1 answer

Multiple AWS providers using CDKTF

I am using CDKTF and python for a project where I am generating JSON output that will be interpreted by Terraform. I have a use case where I need to send in multiple aliased AWS providers. I am able to specify a single provider to the stack by using…
nandac
  • 335
  • 3
  • 16
1
vote
1 answer

Terraform CDKTF Typescript How to set environment variables?

I have the following code: class MyStack extends TerraformStack { constructor(scope: Construct, id: string) { super(scope, id); const awsSecrectKey = new TerraformVariable(this, "aws", { type: "string", sensitive: true, …
Lars Flieger
  • 2,421
  • 1
  • 12
  • 34
1
vote
1 answer

How to iterate over terraform cdk objects made with an iterator

The docs for iterators demonstrate how to create several s3 buckets: import { s3 } from "@cdktf/provider-aws"; import { TerraformIterator, TerraformVariable } from "cdktf"; const list = new TerraformVariable(this, "list", { type:…
Paymahn Moghadasian
  • 9,301
  • 13
  • 56
  • 94
1
vote
1 answer

How to use `count.index` with cdktf iterators

I'm currently upgrading my cdktf dependencies in typescript and running into some issues during the upgrade. I currently have the following code which works perfectly on version 0.8.6 const dataAwsAvailabilityZonesAll = new…
Paymahn Moghadasian
  • 9,301
  • 13
  • 56
  • 94
1
vote
1 answer

Fetch stack state from terraform remote(azure) without local config file

I am using cdktf in Python and maintaining multiple stacks using Terraform and the states are being stored in azure storage account as backend. I would need to fetch any stack at any point in time and make changes to the resources in the stack.…
Subha_26
  • 440
  • 4
  • 14
1
vote
2 answers

How can I auto generate inputs.tf and outputs.tf variables when working with Terraform?

Note: Please see the #### UPDATE ### section below. I've heavily modified the question for clarity on what I'm trying to achieve, but added it as an addendum rather than rewrite the question. As my infrastructure grows, adding input variables in my…
user658182
  • 2,148
  • 5
  • 21
  • 36
1
vote
1 answer

Inject CDKTF multiline token value

Context: TLS provider: SelfSignedCert AWS provider: ECS Fargate task const cert = new SelfSignedCert(this.stack, `${certName}-sscert`, { keyAlgorithm: 'RSA', privateKeyPem: privateKey.privateKeyPem, subject: [{ …
Sebastian
  • 108
  • 1
  • 2
  • 11
1
vote
1 answer

Errors during deployment to AWS using Terraform (cdktf)

I am trying to create or update Lambdas on AWS using the Terraform CDKTF. During deployment, I am getting the error of "An event source mapping with SQS arn (\" arn:aws:sqs:eu-west-2:*******:*****-*****-******** \") and function (\"…
1
vote
2 answers

Convert Terraform reference output type in cdktf

I have two resources in TF that I linked. service_account = \ ServiceAccount(tf_stack, id='123', description='', name="service-account", …
AlexV
  • 3,836
  • 7
  • 31
  • 37
0
votes
1 answer

cdktf - HdinsightKafkaCluster - No stack could be identified for the construct at path

I'm trying to build cdktf - Java Infrastructure as Code for Azure. On the HdInsight Kafka Cluster i'm not able to produce the correct cdktf classes. I'm always running in: Caused by: software.amazon.jsii.JsiiException: No stack could be identified…
0
votes
1 answer

Caused by: java.lang.NoClassDefFoundError: software/constructs/Construct

I’m beginner to Terraform CDK. I’ve created simple code in terraform CDK to create an EC2 instance. but here instead of run cdktf deploy in terminal I’m calling is via java processbuilder inside my main method. Every thing good till now. My Code is…
Raghav Patel
  • 51
  • 1
  • 2
0
votes
1 answer

Terraform docker_registry_image error: 'unable to get digest: Got bad response from registry: 400 Bad Request'

I am trying to use CDF for terraform to build and push a docker image to AWS ECR. I have decided to use terraform docker provider for it. Here is my code class MyStack extends TerraformStack { constructor(scope: Construct, name: string) { …
0
votes
2 answers

terraform cdk equivalent for grantReadWriteData (available in aws-cdk)

I am new to Terraform and also CDKTF. I have worked with “regular” AWS CDK. In AWS CDK you have methods like grantReadWriteData ( IAM principal example ). E.g. if you have a dynamodb table where you want to give a Lambda function readwrite…
Ali Khalil
  • 126
  • 1
  • 11
0
votes
1 answer

cdktf help understanding docs, in specific, bucket parameters

I am just starting my journey with cdktf / typescript and looking to create an s3 backend. This part just focuses on bucket and dynamodb lock. I have the following code which I put together, through reading docs and also running a convert on a HCL…
cumulus.ws
  • 31
  • 5
1
2