https://pulumi.com logo
Title
s

steep-minister-28895

01/02/2023, 5:48 PM
Hello 👋 Recently, our team (at VirtusLab) released a proof of concept for Kotlin support: https://github.com/VirtuslabRnD/pulumi-kotlin. See the comment under "Support for idiomatic Kotlin" issue for more context. Open the Getting started guide if you want to try it. Any kind of feedback is greatly appreciated 🙂.
e

enough-garden-22763

01/05/2023, 2:04 PM
I'm looking forward to taking some time to play with this! It's a huge contribution to the Pulumi ecosystem.
What are some of your top needs from Pulumi core to support Kotlin further?
One thing that I am anticipating is keeping up to date with Pulumi provider releases and extending the matrix of support to the entire ecosystem of official providers. I think one possibility is subscribing to / scraping https://mvnrepository.com/artifact/com.pulumi RSS-feed-like document to get notified on new provider releases. Every provider release is a MVN artifact with a matching resource provider. It currently is possible to script Pulumi CLI to fetch the resource provider and extracting Pulumi Package schema from it based on ID/version.
Another issue @purple-potato-34526 brought up is supporting --convert targets for generating Kotlin programs. There might be a bit more legwork there. Zaid is experimenting with wire formats for Intermediate Representation of programs to pass through from CLI to the code-generating backend.
Anything else obvious I'm missing?
s

steep-minister-28895

01/10/2023, 4:56 PM
Hi Anton, thanks for feedback!
What are some of your top needs from Pulumi core to support Kotlin further?
I'd say that
--convert
and Kotlin code sample generation are the biggest unknowns for us. I predict these will also require a lot of further work in the code generation machinery. The rest is mainly about "elegant" integration with the Pulumi release pipeline, Pulumi Registry and
pulumi
CLI.
r

rapid-vase-55745

03/10/2023, 3:31 AM
Do you know of anyone trying to use your PoC with Gradle/aws? I've got it building, but get a runtime error where it's looking for SBT (a scala build tool) even though my
Pulumi.yaml
has
runtime: java
The actual error is:
error: failed to discover plugin requirements: language host could not determine Pulumi packages: could not find ./sbt, sbt on the $PATH: exec: "sbt": executable file not found in $PATH
s

steep-minister-28895

03/15/2023, 3:34 PM
Hi @rapid-vase-55745 Sorry, I didn't notice this message before. Are you still having problems? I've used Gradle with Pulumi Kotlin SDK a couple of times before and it worked fine. I'll create a brand new Pulumi project and try to reproduce this. Thanks for letting me know about this! Also, if you know of other, important details (e.g. versions of Pulumi/Gradle/Kotlin), please paste it here — this could really speed up any investigations.
r

rapid-vase-55745

03/15/2023, 8:19 PM
------------------------------------------------------------
Gradle 7.4
------------------------------------------------------------

Build time:   2022-02-08 09:58:38 UTC
Revision:     f0d9291c04b90b59445041eaa75b2ee744162586

Kotlin:       1.5.31
Groovy:       3.0.9
Ant:          Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM:          19 (Oracle Corporation 19+36-2238)
OS:           Mac OS X 13.2.1 x86_64
plugins {
    kotlin("jvm") version "1.7.10"
    application
}

group = "ca.kittle"
version = "0.0.1-SNAPSHOT"
description = "DM Seer and Buddies app infrastructure"

repositories {
    mavenCentral()
    mavenLocal()
}

kotlin {
    jvmToolchain {
        languageVersion.set(JavaLanguageVersion.of(11))
    }
}

java {
    toolchain {
        languageVersion.set(JavaLanguageVersion.of(11))
    }
}

dependencies {
    implementation("com.pulumi:pulumi:(,1.0]")
    implementation("org.virtuslab:pulumi-aws-kotlin:5.29.1.1")
    implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
    implementation("org.jetbrains.kotlin:kotlin-reflect")
}

application {
    mainClass.set(
        project.findProperty("mainClass") as? String ?: "${group}.MainKt"
    )
}
org.virtuuslab.pulumi.* is a "nice" DSL for creating configs. I can backtrack on my code and use the code that Pulumi CLI created...
Actually, I have it all working now! Pulumi is really fantastic to work with~!
b

billowy-telephone-70602

03/17/2023, 9:49 AM
@rapid-vase-55745 Did you figure out what the issue was? Anything we should fix? 😊
r

rapid-vase-55745

03/17/2023, 11:19 AM
It's odd, I have gradle in my path, but pulumi kept complaining that it couldn't find 'mvn'. When I copied the gradle folder and executable into the infra project folder, it stopped looking for maven and was executing gradle like it was supposed to.
I also had some problems with
pulumi config
I was specifying the aws profile to use but it kept complaining that credentials weren't configured. As soon as I used the environment variable
AWS_PROFILE
, the credentials problem went away. My credentials are stored in ~/.aws/credentials