Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

GCP service account creation in Terraform through Java cdktf

Hi Team, 
  I am getting the following error while running the cdktf to generate multiple service accounts and service account keys.  

Even though I could see the imports has service account and service account key, It doesn't recognise in my code. 


PS E:\cdk> cdktf get
⠹ downloading and generating modules and providers...
[2025-03-19T16:10:54.798] [ERROR] default - !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! !!
!! The 5.4 release line of jsii has reached End-of-Support. !!
!! We strongly recommend you upgrade to the current release line (5.8) at your earliest convenience. !!

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! !!
!! The 5.4 release line of jsii has reached End-of-Support. !!
!! We strongly recommend you upgrade to the current release line (5.8) at your earliest convenience. !!
[2025-03-19T16:10:54.802] [ERROR] default - !! !!
!! Other actively supported release lines include: !!
!! - 5.5 (planned End-of-Support date: 2025-05-15T00:00:00.000Z) !!
!! - 5.6 (planned End-of-Support date: 2025-07-01T00:00:00.000Z) !!
!! - 5.7 (planned End-of-Support date: 2025-09-15T00:00:00.000Z) !!
!! !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

!! !!
!! Other actively supported release lines include: !!
!! - 5.5 (planned End-of-Support date: 2025-05-15T00:00:00.000Z) !!
!! - 5.6 (planned End-of-Support date: 2025-07-01T00:00:00.000Z) !!
!! - 5.7 (planned End-of-Support date: 2025-09-15T00:00:00.000Z) !!
!! !!
Generated java constructs in the output directory: imports
PS E:\cdk> mvn clean install
>>
[INFO] Scanning for projects...
[INFO]
[INFO] ----------------------< com.mycompany.app:google >----------------------
[INFO] Building google 0.1
[INFO] from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- clean:3.2.0:clean (default-clean) @ google ---
[INFO]
[INFO] --- resources:3.3.1:resources (default-resources) @ google ---
[INFO] Copying 2 resources from src\main\resources to target\classes
[INFO]
[INFO] --- compiler:3.8.1:compile (default-compile) @ google ---
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-settings/2.2.1/maven-settings-2.2.1.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-settings/2.2.1/maven-settings-2.2.1.pom (2.2 kB at 8.5 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-model/2.2.1/maven-model-2.2.1.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-model/2.2.1/maven-model-2.2.1.pom (3.2 kB at 162 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/1.5.15/plexus-utils-1.5.15.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/1.5.15/plexus-utils-1.5.15.pom (6.8 kB at 761 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-interpolation/1.11/plexus-interpolat...
Downloaded from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-interpolation/1.11/plexus-interpolat... (889 B at 64 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-components/1.1.14/plexus-components-...
Downloaded from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-components/1.1.14/plexus-components-... (5.8 kB at 234 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-parameter-documenter/2.2.1/maven-...
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-parameter-documenter/2.2.1/maven-... (2.0 kB at 122 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/slf4j/slf4j-jdk14/1.5.6/slf4j-jdk14-1.5.6.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/slf4j/slf4j-jdk14/1.5.6/slf4j-jdk14-1.5.6.pom (1.9 kB at 127 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/slf4j/slf4j-parent/1.5.6/slf4j-parent-1.5.6.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/slf4j/slf4j-parent/1.5.6/slf4j-parent-1.5.6.pom (7.9 kB at 240 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/slf4j/slf4j-api/1.5.6/slf4j-api-1.5.6.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/slf4j/slf4j-api/1.5.6/slf4j-api-1.5.6.pom (3.0 kB at 176 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/slf4j/jcl-over-slf4j/1.5.6/jcl-over-slf4j-1.5.6.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/slf4j/jcl-over-slf4j/1.5.6/jcl-over-slf4j-1.5.6.pom (2.2 kB at 103 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-profile/2.2.1/maven-profile-2.2.1.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-profile/2.2.1/maven-profile-2.2.1.pom (2.2 kB at 362 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-artifact/2.2.1/maven-artifact-2.2.1.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-artifact/2.2.1/maven-artifact-2.2.1.pom (1.6 kB at 88 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-repository-metadata/2.2.1/maven-reposito...
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-repository-metadata/2.2.1/maven-reposito... (1.9 kB at 94 kB/s)Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-error-diagnostics/2.2.1/maven-error-diag...
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-error-diagnostics/2.2.1/maven-error-diag... (1.7 kB at 342 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-project/2.2.1/maven-project-2.2.1.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-project/2.2.1/maven-project-2.2.1.pom (2.8 kB at 185 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-artifact-manager/2.2.1/maven-artifact-ma...
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-artifact-manager/2.2.1/maven-artifact-ma... (3.1 kB at 163 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/backport-util-concurrent/backport-util-concurrent/3.1/backport-...
Downloaded from central: https://repo.maven.apache.org/maven2/backport-util-concurrent/backport-util-concurrent/3.1/backport-... (880 B at 98 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-registry/2.2.1/maven-plugin-regis...
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-registry/2.2.1/maven-plugin-regis... (1.9 kB at 138 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-descriptor/2.2.1/maven-plugin-des...
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-descriptor/2.2.1/maven-plugin-des... (2.1 kB at 121 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-monitor/2.2.1/maven-monitor-2.2.1.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-monitor/2.2.1/maven-monitor-2.2.1.pom (1.3 kB at 90 kB/s)
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 5723 source files to E:\cdk\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /E:/cdk/src/main/java/com/mycompany/app/Main.java:[13,22] cannot find symbol
symbol: class ServiceAccount
location: package imports.google
[ERROR] /E:/cdk/src/main/java/com/mycompany/app/Main.java:[14,22] cannot find symbol
symbol: class ServiceAccountKey
location: package imports.google
[ERROR] /E:/cdk/src/main/java/com/mycompany/app/Main.java:[41,13] cannot find symbol
symbol: class ServiceAccount
location: class com.mycompany.app.Main
[ERROR] /E:/cdk/src/main/java/com/mycompany/app/Main.java:[41,37] cannot find symbol
symbol: class ServiceAccount
location: class com.mycompany.app.Main
[ERROR] /E:/cdk/src/main/java/com/mycompany/app/Main.java:[42,35] package ServiceAccount does not exist
[ERROR] /E:/cdk/src/main/java/com/mycompany/app/Main.java:[48,13] cannot find symbol
symbol: class ServiceAccountKey
location: class com.mycompany.app.Main
[ERROR] /E:/cdk/src/main/java/com/mycompany/app/Main.java:[48,41] cannot find symbol
symbol: class ServiceAccountKey
location: class com.mycompany.app.Main
[ERROR] /E:/cdk/src/main/java/com/mycompany/app/Main.java:[49,38] package ServiceAccountKey does not exist
[ERROR] /E:/cdk/src/main/java/com/mycompany/app/Main.java:[55,44] method create in class com.hashicorp.cdktf.TerraformOutput.Builder cannot be applied to given types; required: software.constructs.Construct,java.lang.String
found: no arguments
reason: actual and formal argument lists differ in length
[INFO] 9 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 24.005 s
[INFO] Finished at: 2025-03-19T16:12:31+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project google: Compilation failure: Compilation failure:
[ERROR] /E:/cdk/src/main/java/com/mycompany/app/Main.java:[13,22] cannot find symbol
[ERROR] symbol: class ServiceAccount
[ERROR] location: package imports.google
[ERROR] /E:/cdk/src/main/java/com/mycompany/app/Main.java:[14,22] cannot find symbol
[ERROR] symbol: class ServiceAccountKey
[ERROR] location: package imports.google
[ERROR] /E:/cdk/src/main/java/com/mycompany/app/Main.java:[41,13] cannot find symbol
[ERROR] symbol: class ServiceAccount
[ERROR] location: class com.mycompany.app.Main
[ERROR] /E:/cdk/src/main/java/com/mycompany/app/Main.java:[41,37] cannot find symbol
[ERROR] symbol: class ServiceAccount
[ERROR] location: class com.mycompany.app.Main
[ERROR] /E:/cdk/src/main/java/com/mycompany/app/Main.java:[42,35] package ServiceAccount does not exist
[ERROR] /E:/cdk/src/main/java/com/mycompany/app/Main.java:[48,13] cannot find symbol
[ERROR] symbol: class ServiceAccountKey
[ERROR] location: class com.mycompany.app.Main
[ERROR] /E:/cdk/src/main/java/com/mycompany/app/Main.java:[48,41] cannot find symbol
[ERROR] symbol: class ServiceAccountKey
[ERROR] location: class com.mycompany.app.Main
[ERROR] /E:/cdk/src/main/java/com/mycompany/app/Main.java:[49,38] package ServiceAccountKey does not exist
[ERROR] /E:/cdk/src/main/java/com/mycompany/app/Main.java:[55,44] method create in class com.hashicorp.cdktf.TerraformOutput.Builder cannot be applied to given types;[ERROR] required: software.constructs.Construct,java.lang.String
[ERROR] found: no arguments
[ERROR] reason: actual and formal argument lists differ in length
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

Thanks, 
Darwin Vinoth.
Linkedin 




0 0 144
0 REPLIES 0