Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
6b7232d
feat: add command to list the parameters in parameters store
sliedig Jun 26, 2025
0ebc6b4
refactor: renamed UnicornPropertiesNamespace to UnicornApprovalsNames…
sliedig Jun 26, 2025
d9be46c
refactor: updated resolve:ssm references for UnicornPropertiesNamesp…
sliedig Jun 26, 2025
7d73fd6
refactor: deleting Unicorn Properties
sliedig Jul 6, 2025
3db2f32
feat: added Approvals
sliedig Jul 6, 2025
05538e6
refactor: updated shared resources and references to properties
sliedig Jul 6, 2025
684cefa
chore: upgrade actions/upload-artifact from v3 to v4 in GitHub workflow
sliedig Jul 7, 2025
b26204c
chore: update Approvals readme
sliedig Jul 18, 2025
7c766f3
chore: update web readme
sliedig Jul 18, 2025
795af32
chore: updated main readme
sliedig Jul 18, 2025
40f1fe1
chore: upgrade actions/checkout and actions/github-script to v4 and v…
sliedig Jul 18, 2025
f0c1741
chore: update README to reflect new build workflow and correct image tag
sliedig Jul 18, 2025
34611e9
chore: upgrade CodeQL action versions to v3 in GitHub workflows
sliedig Jul 18, 2025
51a6892
chore: update architecture diagram
sliedig Jul 22, 2025
084038e
refactor: update event source and rule names to use 'unicorn.approvals'
sliedig Jul 22, 2025
6018122
refactor: renames ApprovalService to PublicationManagerService for ha…
sliedig Jul 24, 2025
79830ab
chore: minor update to readme file
sliedig Jul 31, 2025
184df86
chore: bumping dependencies
sliedig Aug 4, 2025
1df96a6
fix: resolving some inconsistencies with cookiecutters
sliedig Aug 5, 2025
3138e9f
chore: updated bus name in test events
sliedig Aug 5, 2025
24aad40
chore: updated readme and spelling mistakes
sliedig Aug 5, 2025
dcc4add
fix: updated resource name
sliedig Aug 5, 2025
667a683
fix: syncing templates
sliedig Aug 7, 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
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup .NET 8.0
uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a
with:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@ jobs:

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

# 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 @@ -49,4 +49,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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
**/.aws-sam/
*.DotSettings.user
.vscode/*
UnicornProperties.sln.DotSettings.user
UnicornApprovals.sln.DotSettings.user
**/cdk.out/
**/obj/**
41 changes: 18 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,38 @@
<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-dotnet/actions/workflows/build.yml/badge.svg)](https://github.com/aws-samples/aws-serverless-developer-experience-workshop-dotnet/actions/workflows/build.yml)

# AWS Serverless Developer Experience workshop reference architecture (.NET)

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 .NET 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:

| Tools | Description | Download / Installation Instructions |
| --------------------- | ----------- | --------------------------------------- |
| cfn-lint | Validate AWS CloudFormation yaml/json templates against the AWS CloudFormation Resource Specification and additional checks. | https://github.com/aws-cloudformation/cfn-lint |
| cfn-lint-serverless | Compilation of rules to validate infrastructure-as-code templates against recommended practices for serverless applications. | https://github.com/awslabs/serverless-rules |
| @mhlabs/iam-policies-cli| CLI for generating AWS IAM policy documents or SAM policy templates based on the JSON definition used in the AWS Policy Generator. | https://github.com/mhlabs/iam-policies-cli |
| @mhlabs/evb-cli | Pattern generator and debugging tool for Amazon EventBridge | https://github.com/mhlabs/evb-cli |
| Tools | Description | Download / Installation Instructions |
| ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------- |
| cfn-lint | Validate AWS CloudFormation yaml/json templates against the AWS CloudFormation Resource Specification and additional checks. | https://github.com/aws-cloudformation/cfn-lint |
| cfn-lint-serverless | Compilation of rules to validate infrastructure-as-code templates against recommended practices for serverless applications. | https://github.com/awslabs/serverless-rules |
| @mhlabs/iam-policies-cli | CLI for generating AWS IAM policy documents or SAM policy templates based on the JSON definition used in the AWS Policy Generator. | https://github.com/mhlabs/iam-policies-cli |
| @mhlabs/evb-cli | Pattern generator and debugging tool for Amazon EventBridge | https://github.com/mhlabs/evb-cli |
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<AssemblyName>Unicorn.Properties.PropertiesService.Tests</AssemblyName>
<RootNamespace>Unicorn.Properties.PropertiesService.Tests</RootNamespace>
<AssemblyName>Unicorn.Approvals.ApprovalsService.Tests</AssemblyName>
<RootNamespace>Unicorn.Approvals.ApprovalsService.Tests</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Amazon.Lambda.Core" Version="2.5.1" />
<PackageReference Include="Amazon.Lambda.TestUtilities" Version="2.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.0" />
<PackageReference Include="Amazon.Lambda.Core" Version="2.7.0" />
<PackageReference Include="Amazon.Lambda.TestUtilities" Version="3.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
<PackageReference Include="NSubstitute" Version="5.3.0" />
<PackageReference Include="NSubstitute.Analyzers.CSharp" Version="1.0.17">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.0">
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\PropertiesService\PropertiesService.csproj" />
<ProjectReference Include="..\ApprovalsService\ApprovalsService.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="events\DynamoDbStreamEvents\contract_status_changed_draft.json">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using Xunit;
using Xunit.Abstractions;

namespace Unicorn.Properties.PropertiesService.Tests;
namespace Unicorn.Approvals.ApprovalsService.Tests;

[Collection("Sequential")]
public class PropertiesApprovalSyncFunctionTest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
using Amazon.Lambda.Serialization.SystemTextJson;
using Amazon.Lambda.TestUtilities;

namespace Unicorn.Properties.PropertiesService.Tests;
namespace Unicorn.Approvals.ApprovalsService.Tests;

public static class TestHelpers
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
"DetailType": "ContractStatusChanged",
"Source": "unicorn.contracts",
"EventBusName": "UnicornPropertiesBus-local",
"EventBusName": "UnicornApprovalsBus-local",
"Detail": "{ \"ContractUpdatedOn\": \"10/08/2022 19:56:30\", \"ContractId\": \"f2bedc80-3dc8-4544-9140-9b606d71a6ee\", \"PropertyId\": \"usa/anytown/main-street/111\", \"ContractStatus\": \"APPROVED\" }"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
"DetailType": "ContractStatusChanged",
"Source": "unicorn.contracts",
"EventBusName": "UnicornPropertiesBus-local",
"EventBusName": "UnicornApprovalsBus-local",
"Detail": "{ \"ContractUpdatedOn\": \"10/08/2022 19:56:30\", \"ContractId\": \"f2bedc80-3dc8-4544-9140-9b606d71a6ee\", \"PropertyId\": \"usa/anytown/main-street/111\", \"ContractStatus\": \"DRAFT\" }"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
"DetailType": "ContractStatusChanged",
"Source": "unicorn.contracts",
"EventBusName": "UnicornPropertiesBus-local",
"EventBusName": "UnicornApprovalsBus-local",
"Detail": "{ \"ContractUpdatedOn\": \"10/08/2022 19:56:30\", \"ContractId\": \"9183453b-d284-4466-a2d9-f00b1d569ad7\", \"PropertyId\": \"usa/anytown/main-street/222\", \"ContractStatus\": \"APPROVED\" }"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
"DetailType": "ContractStatusChanged",
"Source": "unicorn.contracts",
"EventBusName": "UnicornPropertiesBus-local",
"EventBusName": "UnicornApprovalsBus-local",
"Detail": "{ \"ContractUpdatedOn\": \"10/08/2022 19:56:30\", \"ContractId\": \"9183453b-d284-4466-a2d9-f00b1d569ad7\", \"PropertyId\": \"usa/anytown/main-street/222\", \"ContractStatus\": \"DRAFT\" }"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
"DetailType": "PublicationApprovalRequested",
"Source": "unicorn.web",
"EventBusName": "UnicornPropertiesBus-local",
"EventBusName": "UnicornApprovalsBus-local",
"Detail": "{\"PropertyId\":\"usa/anytown/main-street/222\",\"Address\":{\"Country\":\"USA\",\"City\":\"Anytown\",\"Street\":\"Main Street\",\"Number\":222},\"Description\":\"This classic Anytown estate comes with a covetable lake view. The romantic and comfortable backyard is the perfect setting for unicorn get-togethers. The open concept Main Stable is fully equipped with all the desired amenities. Second floor features 6 straw bales including large Rainbow Suite with private training pool terrace and Jr Sparkles Suite.\",\"Contract\":\"sale\",\"ListPrice\":200,\"Currency\":\"SPL\",\"Images\":[\"property_images/prop1_exterior1.jpg\",\"property_images/prop1_interior1.jpg\",\"property_images/prop1_interior2.jpg\",\"property_images/prop1_interior3.jpg\"]}"
}
]
Loading
Loading