JetBrains / JetBrains/kotless

Kotless Hello World example fails deploying on AWS

Open
#79 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Kotlin
Stars
1.2k
Forks
54
PR merge metrics
No merged PRs in 30d

Description

I am experiencing issues when trying to deploy the "Hello World" example for Kotless. I'm using the latest version of Kotless `0.1.7-beta-4`.
```
> Task :deploy

data.aws_iam_policy_document.kotless_static_assume: Refreshing state...
data.aws_caller_identity.current: Refreshing state...
data.aws_region.current: Refreshing state...
aws_api_gateway_rest_api.karti4ko: Refreshing state... [id=a9aty1vil1]
data.aws_s3_bucket.kotless_bucket: Refreshing state...
data.aws_iam_policy_document.kotless_static_policy: Refreshing state...
aws_api_gateway_deployment.root: Creating...
aws_iam_role.kotless_static_role: Creating...

Error: Error creating API Gateway Deployment: BadRequestException: The REST API doesn't contain any methods

on karti4ko.tf line 14, in resource "aws_api_gateway_deployment" "root":
14: resource "aws_api_gateway_deployment" "root" {

Error: Error creating IAM Role kotless-static-role: EntityAlreadyExists: Role with name kotless-static-role already exists.
status code: 409, request id: 8b6b2879-29be-4cfe-8028-f585f3ec1ece

on karti4ko.tf line 31, in resource "aws_iam_role" "kotless_static_role":
31: resource "aws_iam_role" "kotless_static_role" {

BUILD SUCCESSFUL in 47s
6 actionable tasks: 2 executed, 4 up-to-date
22:47:36: Task execution finished 'deploy'.
```

I have 1 file, `Functions.kt`, containing the following:
```kotlin
package com.serverless.karti4ko

import io.kotless.dsl.lang.http.Get

@Get("/")
fun sayHello() = "Say Hello!"
```

My `build.gradle.kts` looks like this

```kotlin
import io.kotless.plugin.gradle.dsl.kotless

group = "com.serverless.karti4ko"
version = "1.0-SNAPSHOT"

plugins {
kotlin("jvm") version "1.3.72" apply true
id("io.kotless") version "0.1.7-beta-4" apply true
}

repositories {
jcenter()
}

dependencies {
implementation("io.kotless", "kotless-lang", "0.1.7-beta-4")
}

kotless {
config {
bucket = "my.serverless.bucket"

terraform {
profile = "my.kotless.user"
region = "eu-west-1"
}
}
webapp {
lambda {
kotless {
packages = setOf("com.serverless.karti4ko")
}
}
}
}
```
### Expected events

1. Gradle deployment task should not be successful when the deployment is unsuccessful.
2. The "Hello World" example as given on the README for Kotless should deploy successfully.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.