Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tuva Aarseth #9

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .aws-sam/build.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This file is auto generated by SAM CLI build command

[function_build_definitions.d34c7d63-1cb5-4ff0-901c-c235818f1762]
codeuri = "C:\\Users\\TAarse\\IdeaProjects\\java-cloud-aws-day-3"
runtime = "java21"
architecture = "x86_64"
handler = "com.booleanuk.StreamLambdaHandler::handleRequest"
manifest_hash = ""
packagetype = "Zip"
functions = ["TodoAppFunction"]

[layer_build_definitions]
2 changes: 2 additions & 0 deletions .aws-sam/build/TodoAppFunction/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Manifest-Version: 1.0

31 changes: 31 additions & 0 deletions .aws-sam/build/template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: TODO api new
Globals:
Api:
EndpointConfiguration: REGIONAL
Resources:
TodoAppFunction:
Type: AWS::Serverless::Function
Properties:
Handler: com.booleanuk.StreamLambdaHandler::handleRequest
Runtime: java21
CodeUri: TodoAppFunction
MemorySize: 1512
Policies: AWSLambdaBasicExecutionRole
Timeout: 60
Events:
HttpApiEvent:
Type: HttpApi
Properties:
TimeoutInMillis: 20000
PayloadFormatVersion: '1.0'
Metadata:
SamResourceId: TodoAppFunction
Outputs:
SpringBootTodoNEW2Api:
Description: URL for application
Value:
Fn::Sub: https://${ServerlessHttpApi}.execute-api.${AWS::Region}.amazonaws.com/todos
Export:
Name: tuva-NEW-1
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
replay_pid*

application.yml
Binary file added .gradle/8.10.2/checksums/checksums.lock
Binary file not shown.
Binary file added .gradle/8.10.2/checksums/md5-checksums.bin
Binary file not shown.
Binary file added .gradle/8.10.2/checksums/sha1-checksums.bin
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
Binary file added .gradle/8.10.2/expanded/expanded.lock
Binary file not shown.
Binary file added .gradle/8.10.2/fileChanges/last-build.bin
Binary file not shown.
Binary file added .gradle/8.10.2/fileHashes/fileHashes.bin
Binary file not shown.
Binary file added .gradle/8.10.2/fileHashes/fileHashes.lock
Binary file not shown.
Binary file added .gradle/8.10.2/fileHashes/resourceHashesCache.bin
Binary file not shown.
Empty file added .gradle/8.10.2/gc.properties
Empty file.
Binary file added .gradle/buildOutputCleanup/buildOutputCleanup.lock
Binary file not shown.
2 changes: 2 additions & 0 deletions .gradle/buildOutputCleanup/cache.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#Fri Oct 11 09:14:23 CEST 2024
gradle.version=8.10.2
Binary file added .gradle/buildOutputCleanup/outputFiles.bin
Binary file not shown.
Binary file added .gradle/file-system.probe
Binary file not shown.
Empty file added .gradle/vcs-1/gc.properties
Empty file.
3 changes: 3 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions .idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules/TodoApp.main.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added PETS_api.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added PetStore_works.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Screenshots

### Petstore

![PetStore_works.png](PetStore_works.png)
![PETS_api.png](PETS_api.png)

### Todo app, using same database as Dag

![todo-working.png](todo-working.png)

![tuva-todo-dashbaord-lambda.png](tuva-todo-dashbaord-lambda.png)


# JAVA Cloud AWS - Day Three

## Learning Objectives
Expand Down
56 changes: 56 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
plugins {
id 'java'
id 'org.springframework.boot' version '3.3.4'
id 'io.spring.dependency-management' version '1.1.6'
}

group = 'com.booleanuk'
version = '0.0.8'

java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}

configurations {
compileOnly {
extendsFrom annotationProcessor
}
}

repositories {
mavenLocal()
mavenCentral()
maven {url "https://repo.spring.io/milestone"}
maven {url "https://repo.spring.io/snapshot"}
}

dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation('org.springframework.boot:spring-boot-starter-web') {
exclude group: 'org.springframework.boot', module: 'spring-boot-starter-tomcat'
}
compileOnly 'org.projectlombok:lombok'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
runtimeOnly 'org.postgresql:postgresql'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'

implementation 'com.amazonaws.serverless:aws-serverless-java-container-springboot3:2.0.3'
}


task buildZip(type: Zip) {
from compileJava
from processResources
into('lib') {
from(configurations.compileClasspath) {
exclude 'tomcat-embed-*'
}
}
}

build.dependsOn buildZip

1 change: 1 addition & 0 deletions build/resolvedMainClassName
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
com.booleanuk.Main
2 changes: 2 additions & 0 deletions build/tmp/bootJar/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Manifest-Version: 1.0

Binary file not shown.
3 changes: 3 additions & 0 deletions build/tmp/jar/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Manifest-Version: 1.0
Main-Class: com.booleanuk.Main

7 changes: 7 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading