Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
91834a4
feat: add command to list the parameters in parameters store
sliedig Jun 26, 2025
facfcf1
refactor: renamed UnicornPropertiesNamespace to UnicornApprovalsNames…
sliedig Jun 26, 2025
1364fad
refactor: updated resolve:ssm references for UnicornPropertiesNamesp…
sliedig Jun 26, 2025
98d78f9
refactor: change event bus references from UnicornPropertiesEventBus …
sliedig Jul 7, 2025
4ab4699
chore: upgrade actions/upload-artifact from v3 to v4 in GitHub workflow
sliedig Jul 7, 2025
b498f6d
feat: refactored unicorn properties to approvals again. Renamed modul…
sliedig Jul 17, 2025
fa53715
refactor: updated POM file to rename groupId and artifactId from Prop…
sliedig Jul 17, 2025
5def8e5
chore: update .gitignore to include new target directories for Approv…
sliedig Jul 17, 2025
3d0c1da
refactor: simplify setUp method in CreateContractTests by removing un…
sliedig Jul 17, 2025
5191df7
refactor: simplify setUp method in ContractStatusTests by removing un…
sliedig Jul 17, 2025
36b6fb1
refactor: update POM files to rename artifactId and module names for …
sliedig Jul 17, 2025
6845a75
chore: update .gitignore to reflect the new directory structure for A…
sliedig Jul 17, 2025
917a42a
feat: refactored unicorn web into separate modules - ApprovalService …
sliedig Jul 17, 2025
1d262c7
chore: update Approvals readme
sliedig Jul 18, 2025
4a44175
chore: updated contracts readme
sliedig Jul 18, 2025
1bf88d1
chore: update web readme
sliedig Jul 18, 2025
0aaf501
chore: updated main readme
sliedig Jul 18, 2025
d93ae35
chore: update GitHub Actions workflows to use latest versions of acti…
sliedig Jul 18, 2025
8edaf98
chore: downgrade Maven compiler version to 17 in Common module
sliedig Jul 18, 2025
373616c
chore: reorder sections in README and update image placement
sliedig Jul 18, 2025
de4e8fb
chore: update README badge link to reflect new GitHub Actions workflow
sliedig Jul 18, 2025
18e1bec
chore: fix formatting in README by adjusting header and image placement
sliedig Jul 18, 2025
f5f24f9
refactor: change package name from search.requestapproval to approval…
sliedig Jul 21, 2025
be2fc06
chore: update architecture diagram
sliedig Jul 22, 2025
a0f8968
refactor: update event source and rule names to use 'unicorn.approvals'
sliedig Jul 22, 2025
d05b4ff
refactor: change package names from 'unicorn_properties' to 'unicorn_…
sliedig Jul 22, 2025
c764c36
refactor: rename ApprovalService to PublicationManagerService and rem…
sliedig Jul 28, 2025
6a63570
chore: minor update to readme file
sliedig Jul 31, 2025
9abc323
fix: update namespace for event schema
sliedig Jul 31, 2025
33af6da
fix: updated references to properties service to approvals service. F…
Jul 31, 2025
2cc2196
chore: updated approvals readme
sliedig Aug 5, 2025
c95189a
chore: updated readme and spelling mistakes
sliedig Aug 5, 2025
96c27cd
fix: syncing templates
sliedig Aug 7, 2025
cf2603f
Updated Java dependencies and Code (#47)
eldritchideen Aug 27, 2025
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
2 changes: 1 addition & 1 deletion .github/workflows/auto_assign.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ jobs:
add-reviews:
runs-on: ubuntu-latest
steps:
- uses: kentaro-m/auto-assign-action@v1.2.5
- uses: kentaro-m/auto-assign-action@v2.0.0
16 changes: 8 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ on:
branches: [develop, main]
paths:
- 'unicorn_contracts/**'
- 'unicorn_properties/**'
- 'unicorn_approvals/**'
- 'unicorn_web/**'
pull_request:
branches: [develop, main]
paths:
- 'unicorn_contracts/**'
- 'unicorn_properties/**'
- 'unicorn_approvals/**'
- 'unicorn_web/**'

defaults:
Expand All @@ -21,22 +21,22 @@ defaults:
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 5
timeout-minutes: 10
strategy:
max-parallel: 4
matrix:
# test against latest update of each major Java version, as well as specific updates of LTS versions:
java: [17]
# test against latest LTS Java versions
java: [17, 21]
name: Java ${{ matrix.java }}
env:
JAVA: ${{ matrix.java }}
AWS_REGION: us-west-2
steps:
- uses: actions/checkout@v3
- name: Setup java
- uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
distribution: 'temurin'
java-version: ${{ matrix.java }}
cache: maven
cache-dependency-path: '**/pom.xml'
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,24 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Java JDK
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
java-version: 21

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@2ca79b6fa8d3ec278944088b4aa5f46912db5d63 #v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@2ca79b6fa8d3ec278944088b4aa5f46912db5d63 #v2
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
Expand All @@ -56,4 +56,4 @@ jobs:
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@2ca79b6fa8d3ec278944088b4aa5f46912db5d63 #v2
uses: github/codeql-action/analyze@v3
4 changes: 2 additions & 2 deletions .github/workflows/label_pr_on_title.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: "Label PR based on title"
uses: actions/github-script@v6
uses: actions/github-script@v7
env:
PR_NUMBER: ${{ needs.get_pr_details.outputs.prNumber }}
PR_TITLE: ${{ needs.get_pr_details.outputs.prTitle }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/on_label_added.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ jobs:
issues: write
pull-requests: write
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
# Maintenance: Persist state per PR as an artifact to avoid spam on label add
- name: "Suggest split large Pull Request"
uses: actions/github-script@v6
uses: actions/github-script@v7
env:
PR_NUMBER: ${{ needs.get_pr_details.outputs.prNumber }}
PR_ACTION: ${{ needs.get_pr_details.outputs.prAction }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/on_merged_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ jobs:
runs-on: ubuntu-latest
if: needs.get_pr_details.outputs.prIsMerged == 'true'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: "Label PR related issue for release"
uses: actions/github-script@v6
uses: actions/github-script@v7
env:
PR_NUMBER: ${{ needs.get_pr_details.outputs.prNumber }}
PR_BODY: ${{ needs.get_pr_details.outputs.prBody }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/on_opened_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ jobs:
needs: get_pr_details
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: "Ensure related issue is present"
uses: actions/github-script@v6
uses: actions/github-script@v7
env:
PR_BODY: ${{ needs.get_pr_details.outputs.prBody }}
PR_NUMBER: ${{ needs.get_pr_details.outputs.prNumber }}
Expand All @@ -36,9 +36,9 @@ jobs:
needs: get_pr_details
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: "Ensure acknowledgement section is present"
uses: actions/github-script@v6
uses: actions/github-script@v7
env:
PR_BODY: ${{ needs.get_pr_details.outputs.prBody }}
PR_NUMBER: ${{ needs.get_pr_details.outputs.prNumber }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/record_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: "Extract PR details"
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
script: |
const script = require('.github/scripts/save_pr_details.js')
await script({github, context, core})
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: pr
path: pr.txt
4 changes: 2 additions & 2 deletions .github/workflows/reusable_export_pr_details.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ jobs:
prIsMerged: ${{ steps.prIsMerged.outputs.prIsMerged }}
steps:
- name: Checkout repository # in case caller workflow doesn't checkout thus failing with file not found
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: "Download previously saved PR"
uses: actions/github-script@v6
uses: actions/github-script@v7
env:
WORKFLOW_ID: ${{ inputs.record_pr_workflow_id }}
# For security, we only download artifacts tied to the successful PR recording workflow
Expand Down
14 changes: 9 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
unicorn_properties/PropertyFunctions/target/*
unicorn_contracts/ContractsFunction/target/**
unicorn_web/PropertyFunctions/target/**
unicorn_approvals/ApprovalsService/target/**
unicorn_contracts/ContractsService/target/**
unicorn_web/ApprovalService/target/**
unicorn_web/SearchService/target/**
unicorn_web/PublicationManagerService/target/**
unicorn_web/Common/target/**
**/.aws-sam/
.DS_Store**
.vscode/settings.json
buildall.sh
deleteall.sh
/.idea/**
/cloudapp.iml
/unicorn_properties/PropertyFunctions/PropertyService.iml
/unicorn_approvals/PropertyFunctions/PropertyService.iml
/unicorn_web/PropertyFunctions/PropertyWeb.iml
/unicorn_contracts/ContractsFunction/ContractsModule.iml
**/cdk.out/
**/cdk.out/
**/dependency-reduced-pom.xml
28 changes: 12 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,32 @@
<img src="./docs/workshop_logo.png" alt="AWS Serverless Developer Experience Workshop Reference Architecture" width="80%" />
[![Build & Test Workflow](https://github.com/aws-samples/aws-serverless-developer-experience-workshop-java/actions/workflows/build.yml/badge.svg)](https://github.com/aws-samples/aws-serverless-developer-experience-workshop-java/actions/workflows/build.yml)

# AWS Serverless Developer Experience workshop reference architecture (Java)

This repository contains the reference architecture for the AWS Serverless Developer Experience workshop.
<img src="./docs/workshop_logo.png" alt="AWS Serverless Developer Experience Workshop Reference Architecture" width="80%" />

This repository contains the Java reference architecture for the AWS Serverless Developer Experience workshop.

The AWS Serverless Developer Experience workshop provides you with an immersive experience as a serverless developer. The goal of this workshop is to provide you with hands-on experience building a serverless solution using the [**AWS Serverless Application Model (AWS SAM)**](https://aws.amazon.com/serverless/sam/) and **AWS SAM CLI**.
The AWS Serverless Developer Experience Workshop is a comprehensive, hands-on training program designed to equip developers with practical serverless development skills using the [**AWS Serverless Application Model (AWS SAM)**](https://aws.amazon.com/serverless/sam/) and **AWS SAM CLI**.

Along the way, you will learn about principals of distributed event-driven architectures, messaging patterns, orchestration, and observability and how to apply them in code. You will explore exciting open-source tools, the core features of Powertools for AWS Lambda, and simplified CI/CD deployments supported by AWS SAM Pipelines.
The workshop employs a practical, code-centric approach, emphasizing direct implementation and real-world scenario exploration to ensure you develop serverless development skills across several critical areas including distributed event-driven architectures, messaging patterns, orchestration, and observability. You will explore open-source tools, [Powertools for AWS](https://powertools.aws.dev/), and simplified CI/CD deployments with AWS SAM Pipelines. By the end, you will be familiar with serverless developer workflows, microservice composition using AWS SAM, serverless development best practices, and applied event-driven architectures.

At the end of this workshop, you will be familiar with Serverless developer workflows and microservice composition using AWS SAM, Serverless development best practices, and applied event-driven architectures.
The 6-8 hour workshop assumes your practical development skills in Python, TypeScript, Java, or .NET, and familiarity with [Amazon API Gateway](https://aws.amazon.com/apigateway/), [AWS Lambda](https://aws.amazon.com/lambda/), [Amazon EventBridge](https://aws.amazon.com/eventbridge/), [AWS Step Functions](https://aws.amazon.com/step-functions/), and [Amazon DynamoDB](https://aws.amazon.com/dynamodb/).

## Introducing the Unicorn Properties architecture

![AWS Serverless Developer Experience Workshop Reference Architecture](./docs/architecture.png)

Our use case is based on a real estate company called **Unicorn Properties**.

As a real estate agency, **Unicorn Properties** needs to manage the publishing of new property listings and sale contracts linked to individual properties, and provide a way for their customers to view approved property listings.

To support their needs, Unicorn Properties have adopted a serverless, event-driven approach to designing their architecture. This architecture is centred around two primary domains: **Contracts** (managed by the Contracts Service) and **Properties** (managed by the Web and Properties Services).

The **Unicorn Contracts** service (namespace: `Unicorn.Contracts`) is a simplified service that manages the contractual relationship between a seller of a property and Unicorn Properties. Contracts are drawn up that define the property for sale, the terms and conditions that Unicorn Properties sets, and how much it will cost the seller to engage the services of the agency.
Real estate company **Unicorn Properties** needs to manage publishing of new property listings and sale contracts linked to individual properties, and provide a way for customers to view approved listings. They adopted a serverless, event-driven architecture with two primary domains: **Contracts** (managed by the Contracts Service) and **Properties** (managed by the Web and Approvals Services).

The **Unicorn Web** (namespace: `Unicorn.Web`) manages the details of a property listing to be published on the Unicorn Properties website. Every property listing has an address, a sale price, a description of the property, and some photos that members of the public can look at to get them interested in purchasing the property. Only properties that have been approved for publication can be made visible to the public.
**Unicorn Contracts** (using the `Unicorn.Contracts` namespace) service manages contractual relationships between property sellers and Unicorn Approvals, defining properties for sale, terms, and engagement costs.

The **Unicorn Properties** service (namespace: `Unicorn.Properties`) approves a property listings. This service implements a workflow that checks for the existence of a contract, makes sure that the content and the images are safe to publish, and finally checks that the contract has been approved. We don’t want to publish a property until we have an approved contract!
**Unicorn Approvals** (using the `Unicorn.Approvals` namespace) service approves property listings by implementing a workflow that checks for contract existence, content and image safety, and contract approval before publishing.

Have a go at building this architecture yourself! Head over to the [Serverless Developer Experience Workshop](https://catalog.workshops.aws/serverless-developer-experience) for more details.
**Unicorn Web** (using the `Unicorn.Web` namespace) manages property listing details (address, sale price, description, photos) to be published on the website, with only approved listings visible to the public.

## Credits

Throughout this workshop we wanted to introduce you to some Open Source tools that can help you build serverless applications. This is not an exhaustive list, just a small selection of what we will be using in the workshop.
This workshop introduces you to some open-source tools that can help you build serverless applications. This is not an exhaustive list, but a small selection of what you will be using in the workshop.

Many thanks to all the AWS teams and community builders who have contributed to this list:

Expand Down
Binary file modified docs/architecture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 6 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
<modelVersion>4.0.0</modelVersion>

<groupId>unicornproperties</groupId>
<artifactId>cloudapp</artifactId>
<artifactId>UnicornProperties</artifactId>
<version>1.0</version>
<packaging>pom</packaging>

<modules>
<module>unicorn_contracts/ContractsFunction</module>
<module>unicorn_properties/PropertyFunctions</module>
<module>unicorn_web/PropertyFunctions</module>
<module>unicorn_contracts/ContractsService</module>
<module>unicorn_approvals/ApprovalsService</module>
<module>unicorn_web/PublicationManagerService</module>
<module>unicorn_web/SearchService</module>
<module>unicorn_web/Common</module>
</modules>
</project>
File renamed without changes.
Loading