https://pulumi.com logo
#java
Title
# java
r

rapid-vase-55745

08/14/2023, 12:58 AM
I'm not sure if this is the correct place to comment, but I'm having a problem with AWS and Kotlin. I've reported a bug here: https://github.com/pulumi/pulumi-java/issues/1183 Is anyone else using this combo and have a difference experience?
r

rapid-postman-60756

09/26/2023, 2:42 PM
Hi Don, I use Kotlin too and define the policy using IamFunctions ... Just a sample here:
Copy code
private val assumeRole = IamFunctions.getPolicyDocument(
    GetPolicyDocumentArgs.builder()
        .statements(
            GetPolicyDocumentStatementArgs.builder()
                .effect("Allow")
                .actions("sts:AssumeRole")
                .principals(
                    GetPolicyDocumentStatementPrincipalArgs.builder()
                        .type("Service")
                        .identifiers("<http://glue.amazonaws.com|glue.amazonaws.com>")
                        .build()
                ).build()
        ).build()
)
and
Copy code
private val policy = IamFunctions.getPolicyDocument(
    GetPolicyDocumentArgs.builder()
        .statements(
            GetPolicyDocumentStatementArgs.builder()
                .effect("Allow")
                .actions("s3:GetObject*", "s3:ListObject*")
                .resources(makeBucketArns(dataCatalogInput.sourceBucket.arn()))
                .build()
        ).build()
)
... 
fun makeBucketArns(arn: Output<String>): Output<List<String>>? {
    return arn.applyValue { v: String ->
        listOf(v, "$v/*")
    }
}
r

rapid-vase-55745

12/01/2023, 3:39 PM
Thanks Kim, I only just saw this and it's very helpful!
2 Views