Hello all Can I deploy without terraform at kotles...
# kotless
h
Hello all Can I deploy without terraform at kotless?
t
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
I have never used terraform. So I thought of creating a jar/war file and then uploading it directly to lambda
t
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
Aha I understand 😄
But I excute
deploy
I saw error
like this..
t
Could you provide stacktrace? It looks like a configuration is not full. Probably should add better logging :))
Use
Run with --stacktrace
h
There is stacktrace (Too long, cut in the middle)
It is my gradle script
t
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
I have route53 domain Can I put in the domain of my route53?
t
Yeah,
route53 = Route53("NAME_OF_APP", "ZONE_NAME")
And you need to create ACM certificate at us-east-1
It is free
h
Just I get acm and tried deploy, but I got failed message with this log..
t
Hm, do you use kotlin 1.3.50?
Or what version 🙂
h
I use 1.3.10
t
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
Sorry to keep asking.. 😭 that problem resolved to update kotlin version, but I confront about new error
message has been deleted
like this
t
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
message has been deleted
t
Yep, my mistake, it was right
h
aha
t
Ok, back to the first question -- have you credentials at
.aws
?
h
I will check aws credentials
wait
ah sorry
i will configure aws credentials and try again
t
Ok, I'll wait 🙂
h
Same as before..
I give this permission
t
AdministratorAccess should be enough. But have you access key and secret key in
.aws
?
For programmatic access
h
yes
t
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
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
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
ah yes
hmm… I changed region, but its same.. 🤔
ah, sorry.. I mistake about modify
t
So it is working?
h
no..
No certificate for domain "<http://example.com|example.com>" found in this region
error like this
t
you should change region in a kotless config)
Not in a credentials
h
yes
I changed
and then
like this error 😢
t
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
사용 중입니까?
=
In Use?
In use
is no now, is it relation with this error
t
Hm, and in webapp you have
route53 = Route53("kotless", "pape.red")
?
h
yes
t
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
oh yes
ISSUED
t
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
Copy code
kotlin
data "aws_acm_certificate" "kotless_pape_red" {
  provider = "aws.us_east_1"
  domain = "kotless.pape.red"
  statuses = ["ISSUED"]
}
yeah Virgina
t
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
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
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
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
And you 🙂