Thread
#kotless
    h

    homeless

    2 years ago
    Hello all Can I deploy without terraform at kotless?
    TanVD

    TanVD

    2 years ago
    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

    2 years ago
    I have never used terraform. So I thought of creating a jar/war file and then uploading it directly to lambda
    TanVD

    TanVD

    2 years ago
    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

    2 years ago
    Aha I understand 😄
    But I excute
    deploy
    I saw error
    like this..
    TanVD

    TanVD

    2 years ago
    Could you provide stacktrace? It looks like a configuration is not full. Probably should add better logging 😃)
    Use
    Run with --stacktrace
    h

    homeless

    2 years ago
    There is stacktrace (Too long, cut in the middle)
    It is my gradle script
    TanVD

    TanVD

    2 years ago
    Hm, you need to add webapp closure
    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

    2 years ago
    I have route53 domain Can I put in the domain of my route53?
    TanVD

    TanVD

    2 years ago
    Yeah,
    route53 = Route53("NAME_OF_APP", "ZONE_NAME")
    And you need to create ACM certificate at us-east-1
    It is free
    h

    homeless

    2 years ago
    Just I get acm and tried deploy, but I got failed message with this log..
    TanVD

    TanVD

    2 years ago
    Hm, do you use kotlin 1.3.50?
    Or what version 🙂
    h

    homeless

    2 years ago
    I use 1.3.10
    TanVD

    TanVD

    2 years ago
    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

    2 years ago
    Sorry to keep asking.. 😭 that problem resolved to update kotlin version, but I confront about new error
    like this
    TanVD

    TanVD

    2 years ago
    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
    config {
       bucket = ""
       profile = ""
    ....
    h

    homeless

    2 years ago
    TanVD

    TanVD

    2 years ago
    Yep, my mistake, it was right
    h

    homeless

    2 years ago
    aha
    TanVD

    TanVD

    2 years ago
    Ok, back to the first question -- have you credentials at
    .aws
    ?
    h

    homeless

    2 years ago
    I will check aws credentials
    wait
    ah sorry
    i will configure aws credentials and try again
    TanVD

    TanVD

    2 years ago
    Ok, I'll wait 🙂
    h

    homeless

    2 years ago
    Same as before..
    I give this permission
    TanVD

    TanVD

    2 years ago
    AdministratorAccess should be enough. But have you access key and secret key in
    .aws
    ?
    For programmatic access
    h

    homeless

    2 years ago
    yes
    TanVD

    TanVD

    2 years ago
    and it is the same profile you've specified in config?
    test-profile
    Your
    .aws/credentials
    should be like
    [test-profile]
    aws_access_key_id = ****
    aws_secret_access_key = ****
    h

    homeless

    2 years ago
    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.)
    TanVD

    TanVD

    2 years ago
    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

    2 years ago
    ah yes
    hmm… I changed region, but its same.. 🤔
    ah, sorry.. I mistake about modify
    TanVD

    TanVD

    2 years ago
    So it is working?
    h

    homeless

    2 years ago
    no..
    No certificate for domain "<http://example.com|example.com>" found in this region
    error like this
    TanVD

    TanVD

    2 years ago
    you should change region in a kotless config)
    Not in a credentials
    h

    homeless

    2 years ago
    yes
    I changed
    and then
    like this error 😢
    TanVD

    TanVD

    2 years ago
    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
    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

    2 years ago
    사용 중입니까?
    =
    In Use?
    In use
    is no now, is it relation with this error
    TanVD

    TanVD

    2 years ago
    Hm, and in webapp you have
    route53 = Route53("kotless", "pape.red")
    ?
    h

    homeless

    2 years ago
    yes
    TanVD

    TanVD

    2 years ago
    Hm, could you take a look at
    /build/kotless-gen/?.tf
    There should be a terraform file
    And find there
    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

    2 years ago
    oh yes
    ISSUED
    TanVD

    TanVD

    2 years ago
    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

    2 years ago
    kotlin
    data "aws_acm_certificate" "kotless_pape_red" {
      provider = "aws.us_east_1"
      domain = "kotless.pape.red"
      statuses = ["ISSUED"]
    }
    yeah Virgina
    TanVD

    TanVD

    2 years ago
    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

    2 years ago
    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 😭😭😭
    TanVD

    TanVD

    2 years ago
    :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

    2 years ago
    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!
    TanVD

    TanVD

    2 years ago
    And you 🙂