-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
87 lines (69 loc) · 1.97 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
group 'com.sreekar'
version '1.0-SNAPSHOT'
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.2'
}
}
apply plugin: 'com.github.johnrengelman.shadow'
repositories {
mavenCentral()
}
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "jp.classmethod.aws:gradle-aws-plugin:0.35"
}
}
import com.amazonaws.services.lambda.model.InvocationType
import jp.classmethod.aws.gradle.lambda.AWSLambdaInvokeTask
import jp.classmethod.aws.gradle.lambda.AWSLambdaMigrateFunctionTask
apply plugin: 'java'
apply plugin: "base"
apply plugin: "jp.classmethod.aws.lambda"
apply plugin: 'idea'
idea {
module {
downloadJavadoc = true
downloadSources = true
}
}
sourceCompatibility = 1.8
dependencies {
compile group: 'com.amazonaws', name: 'aws-java-sdk-core', version: '1.11.271'
compile group: 'com.amazonaws', name: 'aws-lambda-java-events', version: '2.0.2'
compile group: 'com.amazonaws', name: 'aws-lambda-java-core', version: '1.2.0'
compile group: 'com.amazonaws', name: 'aws-java-sdk-lambda', version: '1.11.271'
}
aws {
profileName = "default"
region = "us-east-2"
}
lambda {
region = "us-east-2"
}
def jarFilePath = 'build/libs/'
jarFilePath = jarFilePath + rootProject.name + '-'
jarFilePath = jarFilePath + rootProject.version
jarFilePath = jarFilePath + '-all.jar'
task deploy(type: AWSLambdaMigrateFunctionTask, dependsOn: shadowJar) {
functionName = "xxxxx"
role = "arn:aws:iam::xxxxx:role/xxxxx"
zipFile = file(jarFilePath)
handler = "com.sreekar.Main::handleRequest"
}
task invoke(type: AWSLambdaInvokeTask) {
functionName = "fbi_function"
invocationType = InvocationType.RequestResponse
payload = "{}"
doLast {
println "Lambda function result: " + new String(invokeResult.payload.array(), "UTF-8")
}
}