https://kotlinlang.org logo
#kotless
Title
# kotless
h

homeless

10/17/2019, 1:04 PM
Hello all Can I deploy without terraform at kotless?
t

TanVD

10/17/2019, 1:05 PM
Hm, Kotless uses terraform to perform deployment. But you don't need to install it. It will be downloaded automatically.
Basically, you will not see any terraform files or download anything manually during deploy
Or the problem is that you cannot run terraform binary for some reason?
h

homeless

10/17/2019, 1:18 PM
I have never used terraform. So I thought of creating a jar/war file and then uploading it directly to lambda
t

TanVD

10/17/2019, 1:22 PM
Hm, with kotless you should not use terraform directly. Note, in a Getting Started I am asking the user to setup s3 bucket for terraform, but it does not meah that you will be using terraform directly.
It will be generated and applied by Kotless, you will not see it and you do not need experience with it 🙂
In example
examples/ktls-site
there is no Terraform
h

homeless

10/17/2019, 2:02 PM
Aha I understand 😄
But I excute
deploy
I saw error
like this..
t

TanVD

10/17/2019, 2:04 PM
Could you provide stacktrace? It looks like a configuration is not full. Probably should add better logging :))
Use
Run with --stacktrace
h

homeless

10/17/2019, 2:05 PM
There is stacktrace (Too long, cut in the middle)
It is my gradle script
t

TanVD

10/17/2019, 2:12 PM
Hm, you need to add webapp closure
Copy code
webapp {
        packages = setOf("io.kotless.examples")
        route53 = Route53("site", "<http://kotless.io|kotless.io>")
    }
Set the main package
And you will need a route 53 😞
BTW, actually it is possible to create without Route53. I will remove its requirement in 0.1.2
h

homeless

10/17/2019, 2:17 PM
I have route53 domain Can I put in the domain of my route53?
t

TanVD

10/17/2019, 2:21 PM
Yeah,
route53 = Route53("NAME_OF_APP", "ZONE_NAME")
And you need to create ACM certificate at us-east-1
It is free
h

homeless

10/17/2019, 2:38 PM
Just I get acm and tried deploy, but I got failed message with this log..
t

TanVD

10/17/2019, 2:41 PM
Hm, do you use kotlin 1.3.50?
Or what version 🙂
h

homeless

10/17/2019, 2:42 PM
I use 1.3.10
t

TanVD

10/17/2019, 2:43 PM
Hm, there were breaking changes in a compiler in 1.3.30 (as far as I remember). Can you update to 1.3.50?
h

homeless

10/17/2019, 2:51 PM
Sorry to keep asking.. 😭 that problem resolved to update kotlin version, but I confront about new error
message has been deleted
like this
t

TanVD

10/17/2019, 2:55 PM
It is not a problem at all, nor kotlin version, nor webapp requirement was not stated at docs. I will update them as soon as we will deploy your application)
Have you credentials for AWS settled up?
At
.aws
Oh, I see
move profile to
config
closure
like
Copy code
config {
   bucket = ""
   profile = ""
....
h

homeless

10/17/2019, 2:57 PM
message has been deleted
t

TanVD

10/17/2019, 2:58 PM
Yep, my mistake, it was right
h

homeless

10/17/2019, 2:58 PM
aha
t

TanVD

10/17/2019, 2:58 PM
Ok, back to the first question -- have you credentials at
.aws
?
h

homeless

10/17/2019, 2:58 PM
I will check aws credentials
wait
ah sorry
i will configure aws credentials and try again
t

TanVD

10/17/2019, 3:00 PM
Ok, I'll wait 🙂
h

homeless

10/17/2019, 3:16 PM
Same as before..
I give this permission
t

TanVD

10/17/2019, 3:17 PM
AdministratorAccess should be enough. But have you access key and secret key in
.aws
?
For programmatic access
h

homeless

10/17/2019, 3:18 PM
yes
t

TanVD

10/17/2019, 3:18 PM
and it is the same profile you've specified in config?
test-profile
Your
.aws/credentials
should be like
Copy code
[test-profile]
aws_access_key_id = ****
aws_secret_access_key = ****
h

homeless

10/17/2019, 3:31 PM
ah resolved that problem
[test-profile]
was
[default]
but I see new exception
like this
Is it caused by acm? (Of course, I have registered acm certificate.)
t

TanVD

10/17/2019, 3:33 PM
You've registered it at us-east-1?
It looks like your user is from ap-northeast-1
So just change the region at config
You trying to deploy to ap-northeast-1
So the region should be it 🙂
h

homeless

10/17/2019, 3:35 PM
ah yes
hmm… I changed region, but its same.. 🤔
ah, sorry.. I mistake about modify
t

TanVD

10/17/2019, 3:56 PM
So it is working?
h

homeless

10/17/2019, 4:05 PM
no..
No certificate for domain "<http://example.com|example.com>" found in this region
error like this
t

TanVD

10/17/2019, 4:09 PM
you should change region in a kotless config)
Not in a credentials
h

homeless

10/17/2019, 4:10 PM
yes
I changed
and then
like this error 😢
t

TanVD

10/17/2019, 4:11 PM
Hm, is the domain
kotless.pape.red
?
Your domain should be equal to certificate name)
Otherwise you need to specify certificate directly
In the example of shortener
Copy code
webapp {
        packages = setOf("io.kotless.examples")
        route53 = Route53("short", "<http://kotless.io|kotless.io>")
    }
<http://kotless.io|kotless.io>
-- ZONE
<http://short.kotless.io|short.kotless.io>
-- full name,
short
-- name in zone
And certificate is
<http://short.kotless.io|short.kotless.io>
h

homeless

10/17/2019, 4:17 PM
사용 중입니까?
=
In Use?
In use
is no now, is it relation with this error
t

TanVD

10/17/2019, 4:18 PM
Hm, and in webapp you have
route53 = Route53("kotless", "pape.red")
?
h

homeless

10/17/2019, 4:19 PM
yes
t

TanVD

10/17/2019, 4:20 PM
Hm, could you take a look at
/build/kotless-gen/?.tf
There should be a terraform file
And find there
Copy code
data "aws_acm_certificate" "short_kotless_io" {
  provider = "aws.us_east_1"
  domain = "<http://short.kotless.io|short.kotless.io>"
  statuses = ["ISSUED"]
}
Something like it
Or, BTW -- is the status of certificate
ISSUED
?
h

homeless

10/17/2019, 4:21 PM
oh yes
ISSUED
t

TanVD

10/17/2019, 4:22 PM
And it is in a N. Virgina?)
Send me here then this block of terraform code. In your case it will start with
data "aws_acm_certificate" "kotless_pape_red" {
h

homeless

10/17/2019, 4:24 PM
Copy code
kotlin
data "aws_acm_certificate" "kotless_pape_red" {
  provider = "aws.us_east_1"
  domain = "kotless.pape.red"
  statuses = ["ISSUED"]
}
yeah Virgina
t

TanVD

10/17/2019, 4:24 PM
Could you send me DM full log of deployment?
Generated terraform is right, certificate in the right place. The only strange moment -- it is in use)
h

homeless

10/17/2019, 4:29 PM
Sorry.. It was caused by a lot of problems with my Route53 DNS. So it was not kotless problem, only my problem..
now deployed very well
Thank you very much 😭😭😭
t

TanVD

10/17/2019, 4:33 PM
yay It works!
Great to hear it, I will update the README to be sure, that some crucial moments are described. For example, version of Kotlin required 🙂
h

homeless

10/17/2019, 4:34 PM
Yes.. very good idea
Thank you so much for helping me for three hours.
Korea is 1:34 pm, so I’ll go to bed. Have a nice day!
t

TanVD

10/17/2019, 4:37 PM
And you 🙂
3 Views