Questions tagged [terraform-cdk]
63 questions
3
votes
1 answer
Secret management with terraform cdk
In the past I've used Pulumi which offers a secrets management solution that allows stack based secrets to be checked into git while being encrypted.
I've been looking for a similar solution with Terraform CDK and haven't found one. Does Terraform…

Paymahn Moghadasian
- 9,301
- 13
- 56
- 94
3
votes
1 answer
How to get all availability zones at runtime with cdktf?
I have a subnet declaration like the following which creates one subnet for each AWS AZ in us-west-2:
const dataAwsAvailabilityZonesAll =
new aws.datasources.DataAwsAvailabilityZones(this, "all", {});
const zoneNames = Fn.lookup(
…

Paymahn Moghadasian
- 9,301
- 13
- 56
- 94
3
votes
1 answer
How to parse ingress object in cdktf security group?
Problem Unable to create security group rules in aws using CDKTF
Code
import cdktf_cdktf_provider_aws.security_group as SecurityGroup_
self.security_group_ = SecurityGroup_.SecurityGroup(self.scope_object, id_=self.id, name=self.name,…

pratiti28_
- 33
- 3
3
votes
1 answer
How to load local file with cdktf for helm release?
I'd like to reference a local yaml file when creating a helm chart with cdktf.
I have the following cdktf config:
{
"language": "typescript",
"app": "npx ts-node main.ts",
"projectId": "...",
"terraformProviders": [
"hashicorp/aws@~>…

Paymahn Moghadasian
- 9,301
- 13
- 56
- 94
2
votes
1 answer
OIDC provider URL not resolving in 0.16.3
I'm upgrading from cdktf 0.12.3 to 0.16.3 and I'm having issues with AWS OIDC URLs. Here's the code
const oidcProvider = new aws.iam.IamOpenidConnectProvider(
this,
"oidc_provider",
{
clientIdList:…

Paymahn Moghadasian
- 9,301
- 13
- 56
- 94
2
votes
1 answer
How to add dependency between helm chart and kubernetes resource in terraform CDK
I'm installing a helm chart which creates a CRD and then I want to instantiate the CRD defined in the helm chart. What's the correct way to declare a dependency between them so that terraform doesn't try to create the CRD until after the helm chart…

Paymahn Moghadasian
- 9,301
- 13
- 56
- 94
2
votes
1 answer
How to print the string value from cdktf data sources with python
Problem
I am trying to retrieve the subnet cidr block range using CDKTF data_aws_subnet, but doing so gives me an output as $TfTokenTOKEN instead of an actual cidr range (example 10.42.0.0/24)
Code
import cdktf_cdktf_provider_aws.data_aws_subnet as…

john mich
- 2,477
- 3
- 17
- 32
1
vote
0 answers
Pydantic class inheritance
I am doing some inheritance in Pydantic.
Here is my code:
from typing import Dict, Any, List, Optional, Mapping
from pydantic import BaseModel, Field, ValidationError, validator
from enum import Enum
class PartitionCountType(int, Enum):
one =…

404Everything
- 23
- 4
1
vote
0 answers
Reusing cdk.tf.json (inside cdktf.out) instead of generating new one each cdktf deploy
I want to generate only one time that cdk.tf.json file using cdktf synth and each time
i want to deploy i want to use that cdk.tf.json generated when cdktf synth is executed.
So the workflow will look like very similar to:
terraform plan -out…

Ramzi
- 13
- 2
1
vote
1 answer
How can I deploy with Terraform cdktf via python script?
I'm already using cdktf for python to make my provider & resources configuration, I can also deploy via cdktf cli tool with cdkft deploy and it works well, but i need to make an deploy or detroy via python script python deploy.py, how can I achive…

Vrrl
- 27
- 3
1
vote
1 answer
How to loop over taints on an EksNodeGroup with Terraform CDK?
I have an EksNodeGroup with the following taints:
const ssdEksNodeGroupPublicLargeSubnet = new aws.eks.EksNodeGroup(
this,
"ssdEksNodeGroupPublicLargeSubnet",
{
// ... other stuff...
taint: [
…

Paymahn Moghadasian
- 9,301
- 13
- 56
- 94
1
vote
1 answer
How to ignore changes of specific annotation with Terraform CDK
What's the correct way to use the ignoreChanges config to ignore changes of a specific annotation of a kubernetes deployment?
One of my kubernetes deployments has the following annotation automatically injected by a CRD based on some external state…

Paymahn Moghadasian
- 9,301
- 13
- 56
- 94
1
vote
3 answers
How can I use cdktf in combination with the "count" attribute?
I am using cdktf for typescript and I am facing the situation that I only want to add a resource under a given condition. To solve this problem, I found a couple of questions on SO and I figured that we might want to use count in order to solve this…

unterstein
- 79
- 5
1
vote
1 answer
How can I test my terrafrom modules using cdktf?
I would like to integrate existing terraform modules into cdktf. A typescript TerraformModule is created with cdktf get. Can I reference and evaluate this in my unit tests (jtest)?
import { MyLocalModule1 } from…

user5580578
- 1,134
- 1
- 12
- 28
1
vote
1 answer
Terraform CDKTF: How to use/import CDKTF code in existing terraform project?
What:- I have a terraform project. In this project, I am creating CI/CD pipeline using codebuild. For manual approvals, I am sending notifications to slack and getting approval on slack. For approvals, I am using Lambda.
As a project requirement, I…

Jatin Mehrotra
- 9,286
- 4
- 28
- 67