diff --git a/.github/dependabot.yml b/.github/dependabot.yml
deleted file mode 100644
index ae6486f..0000000
--- a/.github/dependabot.yml
+++ /dev/null
@@ -1,16 +0,0 @@
-version: 2
-updates:
- - package-ecosystem: "maven"
- directory: "/java/SqsBatchProcessing/Functions"
- schedule:
- interval: "daily"
- labels:
- - "maven"
- - "dependencies"
- - package-ecosystem: "maven"
- directory: "/java/CoreUtilities/Functions"
- schedule:
- interval: "daily"
- labels:
- - "maven"
- - "dependencies"
\ No newline at end of file
diff --git a/.github/workflows/auto-merge.yml b/.github/workflows/auto-merge.yml
deleted file mode 100644
index 2f1cc34..0000000
--- a/.github/workflows/auto-merge.yml
+++ /dev/null
@@ -1,54 +0,0 @@
-name: Auto merge if dependabot PR
-
-on:
- workflow_run:
- workflows: ["Build"]
- types: [completed]
-
-jobs:
- merge-me:
- name: Merge me!
- runs-on: ubuntu-latest
- if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' && github.actor == 'dependabot[bot]'
- steps:
- - name: 'Download artifact'
- uses: actions/github-script@v3.1.0
- with:
- script: |
- var artifacts = await github.actions.listWorkflowRunArtifacts({
- owner: context.repo.owner,
- repo: context.repo.repo,
- run_id: ${{github.event.workflow_run.id }},
- });
- var matchArtifact = artifacts.data.artifacts.filter((artifact) => {
- return artifact.name == "pr"
- })[0];
- var download = await github.actions.downloadArtifact({
- owner: context.repo.owner,
- repo: context.repo.repo,
- artifact_id: matchArtifact.id,
- archive_format: 'zip',
- });
- var fs = require('fs');
- fs.writeFileSync('${{github.workspace}}/pr.zip', Buffer.from(download.data));
- - run: unzip pr.zip
- - name: Merge me!
- uses: actions/github-script@v3
- with:
- script: |
- var fs = require('fs');
- var issue_number = Number(fs.readFileSync('./NR'));
-
- github.pulls.createReview({
- owner: context.payload.repository.owner.login,
- repo: context.payload.repository.name,
- pull_number: issue_number,
- event: 'APPROVE'
- })
- github.pulls.merge({
- owner: context.payload.repository.owner.login,
- repo: context.payload.repository.name,
- pull_number: issue_number,
- merge_method: 'squash'
- })
- github-token: ${{ secrets.AUTOMERGE }}
\ No newline at end of file
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
deleted file mode 100644
index 20da16f..0000000
--- a/.github/workflows/build.yml
+++ /dev/null
@@ -1,75 +0,0 @@
-name: Build
-
-on:
- pull_request:
- branches:
- - main
- paths:
- - 'manifest.json'
- - 'java/**'
- - '.github/workflows/**'
- push:
- branches:
- - main
- paths:
- - 'manifest.json'
- - 'java/**'
- - '.github/workflows/**'
-
-jobs:
- prepare:
- runs-on: ubuntu-latest
- outputs:
- matrix: ${{ steps.set-matrix.outputs.matrix }}
- steps:
- - uses: actions/checkout@v2
- - id: set-matrix
- run: |
- JSON=$(cat ./manifest.json | jq [.[][]])
- JSON="${JSON//'%'/'%25'}"
- JSON="{\"include\":$JSON}"
- JSON="${JSON//$'\n'/'%0A'}"
- JSON="${JSON//$'\r'/'%0D'}"
- echo $JSON
- echo "-----------------------"
- echo "::set-output name=matrix::$JSON"
-
- build:
- needs: prepare
- runs-on: ubuntu-latest
- strategy:
- matrix: ${{fromJson(needs.prepare.outputs.matrix)}}
- env:
- OS: ${{ matrix.os }}
- JAVA: ${{ matrix.java-version }}
- AWS_REGION: eu-west-1
- steps:
- - uses: actions/checkout@v2
- - name: Setup java
- uses: actions/setup-java@v1
- with:
- java-version: ${{ matrix.javaVersion }}
- - name: Build with Maven
- if: ${{ matrix.dependencyManager == 'maven' }}
- run: mvn -B package --file ${{ matrix.directory }}/pom.xml
- - name: Build with Gradle
- if: ${{ matrix.dependencyManager == 'gradle' }}
- run: |
- cd ./${{ matrix.directory }}/
- ./gradlew build
-
- savepr:
- runs-on: ubuntu-latest
- name: Save PR number if running on PR by dependabot
- if: github.actor == 'dependabot[bot]'
- steps:
- - name: Create Directory and save issue
- run: |
- mkdir -p ./pr
- echo ${{ github.event.number }}
- echo ${{ github.event.number }} > ./pr/NR
- - uses: actions/upload-artifact@v2
- name: Updload artifact
- with:
- name: pr
- path: pr/
diff --git a/.gitignore b/.gitignore
deleted file mode 100644
index 87af344..0000000
--- a/.gitignore
+++ /dev/null
@@ -1,248 +0,0 @@
-
-# Created by https://www.gitignore.io/api/osx,linux,python,windows,pycharm,visualstudiocode
-
-### Linux ###
-*~
-
-# temporary files which can be created if a process still has a handle open of a deleted file
-.fuse_hidden*
-
-# KDE directory preferences
-.directory
-
-# Linux trash folder which might appear on any partition or disk
-.Trash-*
-
-# .nfs files are created when an open file is removed but is still being accessed
-.nfs*
-
-### OSX ###
-*.DS_Store
-.AppleDouble
-.LSOverride
-
-# Icon must end with two \r
-Icon
-
-# Thumbnails
-._*
-
-# Files that might appear in the root of a volume
-.DocumentRevisions-V100
-.fseventsd
-.Spotlight-V100
-.TemporaryItems
-.Trashes
-.VolumeIcon.icns
-.com.apple.timemachine.donotpresent
-
-# Directories potentially created on remote AFP share
-.AppleDB
-.AppleDesktop
-Network Trash Folder
-Temporary Items
-.apdisk
-
-### PyCharm ###
-# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
-# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
-
-# User-specific stuff:
-.idea/**/workspace.xml
-.idea/**/tasks.xml
-.idea/dictionaries
-
-# Sensitive or high-churn files:
-.idea/**/dataSources/
-.idea/**/dataSources.ids
-.idea/**/dataSources.xml
-.idea/**/dataSources.local.xml
-.idea/**/sqlDataSources.xml
-.idea/**/dynamic.xml
-.idea/**/uiDesigner.xml
-
-# Gradle:
-.idea/**/gradle.xml
-.idea/**/libraries
-
-# CMake
-cmake-build-debug/
-
-# Mongo Explorer plugin:
-.idea/**/mongoSettings.xml
-
-## File-based project format:
-*.iws
-
-## Plugin-specific files:
-
-# IntelliJ
-/out/
-
-# mpeltonen/sbt-idea plugin
-.idea_modules/
-
-# JIRA plugin
-atlassian-ide-plugin.xml
-
-# Cursive Clojure plugin
-.idea/replstate.xml
-
-# Ruby plugin and RubyMine
-/.rakeTasks
-
-# Crashlytics plugin (for Android Studio and IntelliJ)
-com_crashlytics_export_strings.xml
-crashlytics.properties
-crashlytics-build.properties
-fabric.properties
-
-### PyCharm Patch ###
-# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
-
-# *.iml
-# modules.xml
-# .idea/misc.xml
-# *.ipr
-
-# Sonarlint plugin
-.idea/sonarlint
-
-### Python ###
-# Byte-compiled / optimized / DLL files
-__pycache__/
-*.py[cod]
-*$py.class
-
-# C extensions
-*.so
-
-# Distribution / packaging
-.Python
-build/
-develop-eggs/
-dist/
-downloads/
-eggs/
-.eggs/
-lib/
-lib64/
-parts/
-sdist/
-var/
-wheels/
-*.egg-info/
-.installed.cfg
-*.egg
-
-# PyInstaller
-# Usually these files are written by a python script from a template
-# before PyInstaller builds the exe, so as to inject date/other infos into it.
-*.manifest
-*.spec
-
-# Installer logs
-pip-log.txt
-pip-delete-this-directory.txt
-
-# Unit test / coverage reports
-htmlcov/
-.tox/
-.coverage
-.coverage.*
-.cache
-.pytest_cache/
-nosetests.xml
-coverage.xml
-*.cover
-.hypothesis/
-
-# Translations
-*.mo
-*.pot
-
-# Flask stuff:
-instance/
-.webassets-cache
-
-# Scrapy stuff:
-.scrapy
-
-# Sphinx documentation
-docs/_build/
-
-# PyBuilder
-target/
-.idea/
-
-*.iml
-*dependency-reduced-pom.xml
-# Jupyter Notebook
-.ipynb_checkpoints
-
-# pyenv
-.python-version
-
-# celery beat schedule file
-celerybeat-schedule.*
-
-# SageMath parsed files
-*.sage.py
-
-# Environments
-.env
-.venv
-env/
-venv/
-ENV/
-env.bak/
-venv.bak/
-
-# Spyder project settings
-.spyderproject
-.spyproject
-
-# Rope project settings
-.ropeproject
-
-# mkdocs documentation
-/site
-
-# mypy
-.mypy_cache/
-
-### VisualStudioCode ###
-.vscode/*
-!.vscode/settings.json
-!.vscode/tasks.json
-!.vscode/launch.json
-!.vscode/extensions.json
-.history
-
-### Windows ###
-# Windows thumbnail cache files
-Thumbs.db
-ehthumbs.db
-ehthumbs_vista.db
-
-# Folder config file
-Desktop.ini
-
-# Recycle Bin used on file shares
-$RECYCLE.BIN/
-
-# Windows Installer files
-*.cab
-*.msi
-*.msm
-*.msp
-
-# Windows shortcuts
-*.lnk
-
-# Build folder
-
-*/build/*
-
-.aws-sam
-*.toml
\ No newline at end of file
diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
deleted file mode 100644
index 5b627cf..0000000
--- a/CODE_OF_CONDUCT.md
+++ /dev/null
@@ -1,4 +0,0 @@
-## Code of Conduct
-This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
-For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
-opensource-codeofconduct@amazon.com with any additional questions or comments.
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
deleted file mode 100644
index c4b6a1c..0000000
--- a/CONTRIBUTING.md
+++ /dev/null
@@ -1,59 +0,0 @@
-# Contributing Guidelines
-
-Thank you for your interest in contributing to our project. Whether it's a bug report, new feature, correction, or additional
-documentation, we greatly value feedback and contributions from our community.
-
-Please read through this document before submitting any issues or pull requests to ensure we have all the necessary
-information to effectively respond to your bug report or contribution.
-
-
-## Reporting Bugs/Feature Requests
-
-We welcome you to use the GitHub issue tracker to report bugs or suggest features.
-
-When filing an issue, please check existing open, or recently closed, issues to make sure somebody else hasn't already
-reported the issue. Please try to include as much information as you can. Details like these are incredibly useful:
-
-* A reproducible test case or series of steps
-* The version of our code being used
-* Any modifications you've made relevant to the bug
-* Anything unusual about your environment or deployment
-
-
-## Contributing via Pull Requests
-Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that:
-
-1. You are working against the latest source on the *main* branch.
-2. You check existing open, and recently merged, pull requests to make sure someone else hasn't addressed the problem already.
-3. You open an issue to discuss any significant work - we would hate for your time to be wasted.
-
-To send us a pull request, please:
-
-1. Fork the repository.
-2. Modify the source; please focus on the specific change you are contributing. If you also reformat all the code, it will be hard for us to focus on your change.
-3. Ensure local tests pass.
-4. Commit to your fork using clear commit messages.
-5. Send us a pull request, answering any default questions in the pull request interface.
-6. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation.
-
-GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and
-[creating a pull request](https://help.github.com/articles/creating-a-pull-request/).
-
-
-## Finding contributions to work on
-Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels (enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any 'help wanted' issues is a great place to start.
-
-
-## Code of Conduct
-This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
-For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
-opensource-codeofconduct@amazon.com with any additional questions or comments.
-
-
-## Security issue notifications
-If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public github issue.
-
-
-## Licensing
-
-See the [LICENSE](LICENSE) file for our project's licensing. We will ask you to confirm the licensing of your contribution.
diff --git a/README.md b/README.md
index 2af0aea..226fb41 100644
--- a/README.md
+++ b/README.md
@@ -1,13 +1,3 @@
## aws-lambda-powertools-examples
-This repo holds example projects demoing different types of utilities provided by aws-lambda-powertools project for different
-runtimes.
-
-## Security
-
-See [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more information.
-
-## License
-
-This library is licensed under the MIT-0 License. See the LICENSE file.
-
+⚠️⚠️ The samples previously stored here have moved to [the main AWS Lambda Powertools for Java repository](https://github.com/awslabs/aws-lambda-powertools-java). To get started, you can check them out in their new home and find the documentation [here](https://awslabs.github.io/aws-lambda-powertools-java/) ⚠️⚠️
diff --git a/java/CoreUtilities/.gitignore b/java/CoreUtilities/.gitignore
deleted file mode 100644
index e69de29..0000000
diff --git a/java/CoreUtilities/Function/pom.xml b/java/CoreUtilities/Function/pom.xml
deleted file mode 100644
index cc2da8a..0000000
--- a/java/CoreUtilities/Function/pom.xml
+++ /dev/null
@@ -1,123 +0,0 @@
-
- 4.0.0
- powertools
- Function
- 1.0
- jar
- A sample Hello World created for SAM CLI using powertools core utilities
-
- 11
- 11
- 2.17.1
- UTF-8
-
-
-
-
- software.amazon.lambda
- powertools-tracing
- 1.10.2
-
-
- software.amazon.lambda
- powertools-logging
- 1.10.2
-
-
- software.amazon.lambda
- powertools-metrics
- 1.10.2
-
-
- com.amazonaws
- aws-lambda-java-core
- 1.2.1
-
-
- com.amazonaws
- aws-lambda-java-events
- 3.11.0
-
-
- org.apache.logging.log4j
- log4j-core
- ${log4j.version}
-
-
- org.apache.logging.log4j
- log4j-api
- ${log4j.version}
-
-
-
- junit
- junit
- 4.13.2
- test
-
-
-
-
-
-
- org.codehaus.mojo
- aspectj-maven-plugin
- 1.14.0
-
- ${maven.compiler.source}
- ${maven.compiler.target}
- ${maven.compiler.target}
-
-
- software.amazon.lambda
- powertools-tracing
-
-
- software.amazon.lambda
- powertools-logging
-
-
- software.amazon.lambda
- powertools-metrics
-
-
-
-
-
-
- compile
-
-
-
-
-
- org.apache.maven.plugins
- maven-shade-plugin
- 3.2.4
-
-
- package
-
- shade
-
-
-
-
-
-
-
-
-
-
-
- com.github.edwgiz
- maven-shade-plugin.log4j2-cachefile-transformer
- 2.15
-
-
-
-
-
-
diff --git a/java/CoreUtilities/Function/src/main/java/helloworld/App.java b/java/CoreUtilities/Function/src/main/java/helloworld/App.java
deleted file mode 100644
index b454401..0000000
--- a/java/CoreUtilities/Function/src/main/java/helloworld/App.java
+++ /dev/null
@@ -1,115 +0,0 @@
-package helloworld;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.stream.Collectors;
-
-import com.amazonaws.services.lambda.runtime.Context;
-import com.amazonaws.services.lambda.runtime.RequestHandler;
-import com.amazonaws.services.lambda.runtime.events.APIGatewayProxyRequestEvent;
-import com.amazonaws.services.lambda.runtime.events.APIGatewayProxyResponseEvent;
-import com.amazonaws.xray.AWSXRay;
-import com.amazonaws.xray.entities.Entity;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
-import software.amazon.cloudwatchlogs.emf.model.DimensionSet;
-import software.amazon.cloudwatchlogs.emf.model.Unit;
-import software.amazon.lambda.powertools.logging.LoggingUtils;
-import software.amazon.lambda.powertools.logging.Logging;
-import software.amazon.lambda.powertools.metrics.Metrics;
-import software.amazon.lambda.powertools.tracing.CaptureMode;
-import software.amazon.lambda.powertools.tracing.TracingUtils;
-import software.amazon.lambda.powertools.tracing.Tracing;
-
-import static software.amazon.lambda.powertools.metrics.MetricsUtils.metricsLogger;
-import static software.amazon.lambda.powertools.metrics.MetricsUtils.withSingleMetric;
-import static software.amazon.lambda.powertools.tracing.TracingUtils.putMetadata;
-import static software.amazon.lambda.powertools.tracing.TracingUtils.withEntitySubsegment;
-
-/**
- * Handler for requests to Lambda function.
- */
-public class App implements RequestHandler {
- private final static Logger log = LogManager.getLogger(App.class);
-
- @Logging(logEvent = true, samplingRate = 0.7)
- @Tracing(captureMode = CaptureMode.RESPONSE_AND_ERROR)
- @Metrics(namespace = "ServerlessAirline", service = "payment", captureColdStart = true)
- public APIGatewayProxyResponseEvent handleRequest(final APIGatewayProxyRequestEvent input, final Context context) {
- Map headers = new HashMap<>();
-
- headers.put("Content-Type", "application/json");
- headers.put("X-Custom-Header", "application/json");
-
- metricsLogger().putMetric("CustomMetric1", 1, Unit.COUNT);
-
- withSingleMetric("CustomMetrics2", 1, Unit.COUNT, "Another", (metric) -> {
- metric.setDimensions(DimensionSet.of("AnotherService", "CustomService"));
- metric.setDimensions(DimensionSet.of("AnotherService1", "CustomService1"));
- });
-
- LoggingUtils.appendKey("test", "willBeLogged");
-
- APIGatewayProxyResponseEvent response = new APIGatewayProxyResponseEvent()
- .withHeaders(headers);
- try {
- final String pageContents = this.getPageContents("https://checkip.amazonaws.com");
- log.info(pageContents);
- TracingUtils.putAnnotation("Test", "New");
- String output = String.format("{ \"message\": \"hello world\", \"location\": \"%s\" }", pageContents);
-
- TracingUtils.withSubsegment("loggingResponse", subsegment -> {
- String sampled = "log something out";
- log.info(sampled);
- log.info(output);
- });
-
- threadOption1();
-
- threadOption2();
-
- log.info("After output");
- return response
- .withStatusCode(200)
- .withBody(output);
- } catch (IOException | InterruptedException e) {
- return response
- .withBody("{}")
- .withStatusCode(500);
- }
- }
-
- private void threadOption1() throws InterruptedException {
- final Entity traceEntity = AWSXRay.getTraceEntity();
- assert traceEntity != null;
- traceEntity.run(new Thread(this::log));
- }
-
- private void threadOption2() throws InterruptedException {
- Entity traceEntity = AWSXRay.getTraceEntity();
- Thread anotherThread = new Thread(() -> withEntitySubsegment("inlineLog", traceEntity, subsegment -> {
- String var = "somethingToProcess";
- log.info("inside threaded logging inline {}", var);
- }));
- anotherThread.start();
- anotherThread.join();
- }
-
- @Tracing
- private void log() {
- log.info("inside threaded logging for function");
- }
-
- @Tracing(namespace = "getPageContents", captureMode = CaptureMode.DISABLED)
- private String getPageContents(String address) throws IOException {
- URL url = new URL(address);
- putMetadata("getPageContents", address);
- try (BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()))) {
- return br.lines().collect(Collectors.joining(System.lineSeparator()));
- }
- }
-}
diff --git a/java/CoreUtilities/Function/src/main/java/helloworld/AppStream.java b/java/CoreUtilities/Function/src/main/java/helloworld/AppStream.java
deleted file mode 100644
index aed048e..0000000
--- a/java/CoreUtilities/Function/src/main/java/helloworld/AppStream.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package helloworld;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.Map;
-
-import com.amazonaws.services.lambda.runtime.Context;
-import com.amazonaws.services.lambda.runtime.RequestStreamHandler;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import software.amazon.lambda.powertools.logging.Logging;
-import software.amazon.lambda.powertools.metrics.Metrics;
-
-public class AppStream implements RequestStreamHandler {
- private static final ObjectMapper mapper = new ObjectMapper();
-
- @Override
- @Logging(logEvent = true)
- @Metrics(namespace = "ServerlessAirline", service = "payment", captureColdStart = true)
- public void handleRequest(InputStream input, OutputStream output, Context context) throws IOException {
- Map map = mapper.readValue(input, Map.class);
-
- System.out.println(map.size());
- }
-}
diff --git a/java/CoreUtilities/Function/src/main/resources/log4j2.xml b/java/CoreUtilities/Function/src/main/resources/log4j2.xml
deleted file mode 100644
index e1fd14c..0000000
--- a/java/CoreUtilities/Function/src/main/resources/log4j2.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/java/CoreUtilities/Function/src/test/java/helloworld/AppTest.java b/java/CoreUtilities/Function/src/test/java/helloworld/AppTest.java
deleted file mode 100644
index b584ee9..0000000
--- a/java/CoreUtilities/Function/src/test/java/helloworld/AppTest.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package helloworld;
-
-import com.amazonaws.services.lambda.runtime.events.APIGatewayProxyResponseEvent;
-import com.amazonaws.xray.AWSXRay;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import static org.junit.Assert.*;
-
-public class AppTest {
-
- @Before
- public void setup() {
- if(null == System.getenv("LAMBDA_TASK_ROOT")) {
- AWSXRay.beginSegment("test");
- }
- }
-
- @After
- public void tearDown() {
- if (AWSXRay.getCurrentSubsegmentOptional().isPresent()) {
- AWSXRay.endSubsegment();
- }
-
- if(null == System.getenv("LAMBDA_TASK_ROOT")) {
- AWSXRay.endSegment();
- }
- }
-
- @Test
- public void successfulResponse() {
- App app = new App();
- APIGatewayProxyResponseEvent result = app.handleRequest(null, null);
- assertEquals(result.getStatusCode().intValue(), 200);
- assertEquals(result.getHeaders().get("Content-Type"), "application/json");
- String content = result.getBody();
- assertNotNull(content);
- assertTrue(content.contains("\"message\""));
- assertTrue(content.contains("\"hello world\""));
- assertTrue(content.contains("\"location\""));
- }
-}
diff --git a/java/CoreUtilities/README.md b/java/CoreUtilities/README.md
deleted file mode 100644
index f4bdc39..0000000
--- a/java/CoreUtilities/README.md
+++ /dev/null
@@ -1,138 +0,0 @@
-# CoreUtilities
-
-This project contains source code and supporting files for a serverless application that you can deploy with the SAM CLI. It includes [Lambda Powertools for operational best practices](https://github.com/awslabs/aws-lambda-powertools-java), and the following files and folders.
-
-- HelloWorldFunction/src/main - Code for the application's Lambda function.
-- events - Invocation events that you can use to invoke the function.
-- HelloWorldFunction/src/test - Unit tests for the application code.
-- template.yaml - A template that defines the application's AWS resources.
-
-The application uses several AWS resources, including Lambda functions and an API Gateway API. These resources are defined in the `template.yaml` file in this project. You can update the template to add AWS resources through the same deployment process that updates your application code.
-
-If you prefer to use an integrated development environment (IDE) to build and test your application, you can use the AWS Toolkit.
-The AWS Toolkit is an open source plug-in for popular IDEs that uses the SAM CLI to build and deploy serverless applications on AWS. The AWS Toolkit also adds a simplified step-through debugging experience for Lambda function code. See the following links to get started.
-
-* [PyCharm](https://docs.aws.amazon.com/toolkit-for-jetbrains/latest/userguide/welcome.html)
-* [IntelliJ](https://docs.aws.amazon.com/toolkit-for-jetbrains/latest/userguide/welcome.html)
-* [VS Code](https://docs.aws.amazon.com/toolkit-for-vscode/latest/userguide/welcome.html)
-* [Visual Studio](https://docs.aws.amazon.com/toolkit-for-visual-studio/latest/user-guide/welcome.html)
-
-## Deploy the sample application
-
-The Serverless Application Model Command Line Interface (SAM CLI) is an extension of the AWS CLI that adds functionality for building and testing Lambda applications. It uses Docker to run your functions in an Amazon Linux environment that matches Lambda. It can also emulate your application's build environment and API.
-
-To use the SAM CLI, you need the following tools.
-
-* SAM CLI - [Install the SAM CLI](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install.html)
-* Java11 - [Install the Java 11](https://docs.aws.amazon.com/corretto/latest/corretto-11-ug/downloads-list.html)
-* Maven - [Install Maven](https://maven.apache.org/install.html)
-* Docker - [Install Docker community edition](https://hub.docker.com/search/?type=edition&offering=community)
-
-To build and deploy your application for the first time, run the following in your shell:
-
-```bash
-Coreutilities$ sam build
-Coreutilities$ sam deploy --guided
-```
-
-The first command will build the source of your application. The second command will package and deploy your application to AWS, with a series of prompts:
-
-* **Stack Name**: The name of the stack to deploy to CloudFormation. This should be unique to your account and region, and a good starting point would be something matching your project name.
-* **AWS Region**: The AWS region you want to deploy your app to.
-* **Confirm changes before deploy**: If set to yes, any change sets will be shown to you before execution for manual review. If set to no, the AWS SAM CLI will automatically deploy application changes.
-* **Allow SAM CLI IAM role creation**: Many AWS SAM templates, including this example, create AWS IAM roles required for the AWS Lambda function(s) included to access AWS services. By default, these are scoped down to minimum required permissions. To deploy an AWS CloudFormation stack which creates or modified IAM roles, the `CAPABILITY_IAM` value for `capabilities` must be provided. If permission isn't provided through this prompt, to deploy this example you must explicitly pass `--capabilities CAPABILITY_IAM` to the `sam deploy` command.
-* **Save arguments to samconfig.toml**: If set to yes, your choices will be saved to a configuration file inside the project, so that in the future you can just re-run `sam deploy` without parameters to deploy changes to your application.
-
-You can find your API Gateway Endpoint URL in the output values displayed after deployment.
-
-## Use the SAM CLI to build and test locally
-
-Build your application with the `sam build` command.
-
-```bash
-Coreutilities$ sam build
-```
-
-The SAM CLI installs dependencies defined in `HelloWorldFunction/pom.xml`, creates a deployment package, and saves it in the `.aws-sam/build` folder.
-
-Test a single function by invoking it directly with a test event. An event is a JSON document that represents the input that the function receives from the event source. Test events are included in the `events` folder in this project.
-
-Run functions locally and invoke them with the `sam local invoke` command.
-
-```bash
-Coreutilities$ sam local invoke HelloWorldFunction --event events/event.json
-```
-
-The SAM CLI can also emulate your application's API. Use the `sam local start-api` to run the API locally on port 3000.
-
-```bash
-Coreutilities$ sam local start-api
-Coreutilities$ curl http://localhost:3000/
-```
-
-The SAM CLI reads the application template to determine the API's routes and the functions that they invoke. The `Events` property on each function's definition includes the route and method for each path.
-
-```yaml
- Events:
- HelloWorld:
- Type: Api
- Properties:
- Path: /hello
- Method: get
-```
-
-## Add a resource to your application
-The application template uses AWS Serverless Application Model (AWS SAM) to define application resources. AWS SAM is an extension of AWS CloudFormation with a simpler syntax for configuring common serverless application resources such as functions, triggers, and APIs. For resources not included in [the SAM specification](https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md), you can use standard [AWS CloudFormation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html) resource types.
-
-## Fetch, tail, and filter Lambda function logs
-
-To simplify troubleshooting, SAM CLI has a command called `sam logs`. `sam logs` lets you fetch logs generated by your deployed Lambda function from the command line. In addition to printing the logs on the terminal, this command has several nifty features to help you quickly find the bug.
-
-`NOTE`: This command works for all AWS Lambda functions; not just the ones you deploy using SAM.
-
-```bash
-Coreutilities$ sam logs -n HelloWorldFunction --stack-name --tail
-```
-
-You can find more information and examples about filtering Lambda function logs in the [SAM CLI Documentation](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-logging.html).
-
-## Unit tests
-
-Tests are defined in the `HelloWorldFunction/src/test` folder in this project.
-
-```bash
-Coreutilities$ cd HelloWorldFunction
-HelloWorldFunction$ mvn test
-```
-
-## Cleanup
-
-To delete the sample application that you created, use the AWS CLI. Assuming you used your project name for the stack name, you can run the following:
-
-```bash
-aws cloudformation delete-stack --stack-name
-```
-
-# Appendix
-
-## Powertools
-
-**Tracing**
-
-[Tracing utility](https://awslabs.github.io/aws-lambda-powertools-java/core/tracing/) provides functionality to reduce the overhead of performing common tracing tasks. It traces the execution of this sample code including the response and exceptions as tracing metadata - You can visualize them in AWS X-Ray.
-
-**Logger**
-
-[Logging utility](https://awslabs.github.io/aws-lambda-powertools-java/core/logging/) creates an opinionated application Logger with structured logging as the output, dynamically samples a percentage (samplingRate) of your logs in DEBUG mode for concurrent invocations, log incoming events as your function is invoked, and injects key information from Lambda context object into your Logger - You can visualize them in Amazon CloudWatch Logs.
-
-**Metrics**
-
-[Metrics utility](https://awslabs.github.io/aws-lambda-powertools-java/core/metrics/) captures cold start metric of your Lambda invocation, and could add additional metrics to help you understand your application KPIs - You can visualize them in Amazon CloudWatch.
-
-## Resources
-
-See the [AWS SAM developer guide](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/what-is-sam.html) for an introduction to SAM specification, the SAM CLI, and serverless application concepts.
-
-Check the [AWS Lambda Powertools Java](https://awslabs.github.io/aws-lambda-powertools-java/) for more information on how to use and configure such tools
-
-Next, you can use AWS Serverless Application Repository to deploy ready to use Apps that go beyond hello world samples and learn how authors developed their applications: [AWS Serverless Application Repository main page](https://aws.amazon.com/serverless/serverlessrepo/)
diff --git a/java/CoreUtilities/events/event.json b/java/CoreUtilities/events/event.json
deleted file mode 100644
index 3822fad..0000000
--- a/java/CoreUtilities/events/event.json
+++ /dev/null
@@ -1,63 +0,0 @@
-{
- "body": "{\"message\": \"hello world\"}",
- "resource": "/{proxy+}",
- "path": "/path/to/resource",
- "httpMethod": "POST",
- "isBase64Encoded": false,
- "queryStringParameters": {
- "foo": "bar"
- },
- "pathParameters": {
- "proxy": "/path/to/resource"
- },
- "stageVariables": {
- "baz": "qux"
- },
- "headers": {
- "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
- "Accept-Encoding": "gzip, deflate, sdch",
- "Accept-Language": "en-US,en;q=0.8",
- "Cache-Control": "max-age=0",
- "CloudFront-Forwarded-Proto": "https",
- "CloudFront-Is-Desktop-Viewer": "true",
- "CloudFront-Is-Mobile-Viewer": "false",
- "CloudFront-Is-SmartTV-Viewer": "false",
- "CloudFront-Is-Tablet-Viewer": "false",
- "CloudFront-Viewer-Country": "US",
- "Host": "1234567890.execute-api.us-east-1.amazonaws.com",
- "Upgrade-Insecure-Requests": "1",
- "User-Agent": "Custom User Agent String",
- "Via": "1.1 08f323deadbeefa7af34d5feb414ce27.cloudfront.net (CloudFront)",
- "X-Amz-Cf-Id": "cDehVQoZnx43VYQb9j2-nvCh-9z396Uhbp027Y2JvkCPNLmGJHqlaA==",
- "X-Forwarded-For": "127.0.0.1, 127.0.0.2",
- "X-Forwarded-Port": "443",
- "X-Forwarded-Proto": "https"
- },
- "requestContext": {
- "accountId": "123456789012",
- "resourceId": "123456",
- "stage": "prod",
- "requestId": "c6af9ac6-7b61-11e6-9a41-93e8deadbeef",
- "requestTime": "09/Apr/2015:12:34:56 +0000",
- "requestTimeEpoch": 1428582896000,
- "identity": {
- "cognitoIdentityPoolId": null,
- "accountId": null,
- "cognitoIdentityId": null,
- "caller": null,
- "accessKey": null,
- "sourceIp": "127.0.0.1",
- "cognitoAuthenticationType": null,
- "cognitoAuthenticationProvider": null,
- "userArn": null,
- "userAgent": "Custom User Agent String",
- "user": null
- },
- "path": "/prod/path/to/resource",
- "resourcePath": "/{proxy+}",
- "httpMethod": "POST",
- "apiId": "1234567890",
- "protocol": "HTTP/1.1"
- }
- }
-
\ No newline at end of file
diff --git a/java/CoreUtilities/template.yaml b/java/CoreUtilities/template.yaml
deleted file mode 100644
index ed05286..0000000
--- a/java/CoreUtilities/template.yaml
+++ /dev/null
@@ -1,66 +0,0 @@
-AWSTemplateFormatVersion: '2010-09-09'
-Transform: AWS::Serverless-2016-10-31
-Description: >
- CoreUtilities
-
-# More info about Globals: https://github.com/awslabs/serverless-application-model/blob/master/docs/globals.rst
-Globals:
- Function:
- Timeout: 20
- Runtime: java11
- MemorySize: 512
- Tracing: Active # https://docs.aws.amazon.com/lambda/latest/dg/lambda-x-ray.html
- Environment:
- Variables:
- # Powertools env vars: https://awslabs.github.io/aws-lambda-powertools-python/#environment-variables
- POWERTOOLS_LOG_LEVEL: INFO
- POWERTOOLS_LOGGER_SAMPLE_RATE: 0.1
- POWERTOOLS_LOGGER_LOG_EVENT: true
- POWERTOOLS_METRICS_NAMESPACE: Coreutilities
-
-Resources:
- HelloWorldFunction:
- Type: AWS::Serverless::Function # More info about Function Resource: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunction
- Properties:
- CodeUri: Function
- Handler: helloworld.App::handleRequest
- Environment: # More info about Env Vars: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#environment-object
- Variables:
- POWERTOOLS_SERVICE_NAME: hello
- Events:
- HelloWorld:
- Type: Api # More info about API Event Source: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#api
- Properties:
- Path: /hello
- Method: get
-
- HelloWorldStreamFunction:
- Type: AWS::Serverless::Function
- Properties:
- CodeUri: Function
- Handler: helloworld.AppStream::handleRequest
- MemorySize: 512
- Tracing: Active
- Environment:
- Variables:
- POWERTOOLS_LOGGER_SAMPLE_RATE: 0.7
- Events:
- HelloWorld:
- Type: Api
- Properties:
- Path: /hellostream
- Method: get
-
-Outputs:
- # ServerlessRestApi is an implicit API created out of Events key under Serverless::Function
- # Find out more about other implicit resources you can reference within SAM
- # https://github.com/awslabs/serverless-application-model/blob/master/docs/internals/generated_resources.rst#api
- HelloWorldApi:
- Description: "API Gateway endpoint URL for Prod stage for Hello World function"
- Value: !Sub "https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/hello/"
- HelloWorldFunction:
- Description: "Hello World Lambda Function ARN"
- Value: !GetAtt HelloWorldFunction.Arn
- HelloWorldFunctionIamRole:
- Description: "Implicit IAM Role created for Hello World function"
- Value: !GetAtt HelloWorldFunctionRole.Arn
diff --git a/java/Idempotency/Function/pom.xml b/java/Idempotency/Function/pom.xml
deleted file mode 100644
index 499f30e..0000000
--- a/java/Idempotency/Function/pom.xml
+++ /dev/null
@@ -1,180 +0,0 @@
-
- 4.0.0
- powertools
- Function
- 1.0
- jar
- A sample Hello World using powertools idempotency
-
- 11
- 11
- 2.17.1
- UTF-8
-
-
-
-
- software.amazon.lambda
- powertools-tracing
- 1.11.0
-
-
- software.amazon.lambda
- powertools-logging
- 1.11.0
-
-
- software.amazon.lambda
- powertools-idempotency
- 1.11.0
-
-
- com.amazonaws
- aws-lambda-java-core
- 1.2.1
-
-
- com.amazonaws
- aws-lambda-java-events
- 3.11.0
-
-
- org.apache.logging.log4j
- log4j-core
- ${log4j.version}
-
-
- org.apache.logging.log4j
- log4j-api
- ${log4j.version}
-
-
-
- org.mockito
- mockito-core
- 4.3.1
- test
-
-
- org.junit.jupiter
- junit-jupiter-api
- 5.8.2
- test
-
-
- com.amazonaws
- DynamoDBLocal
- [1.12,2.0)
- test
-
-
- com.amazonaws
- aws-lambda-java-tests
- 1.1.1
-
-
-
-
-
-
- org.codehaus.mojo
- aspectj-maven-plugin
- 1.14.0
-
- ${maven.compiler.source}
- ${maven.compiler.target}
- ${maven.compiler.target}
-
-
- software.amazon.lambda
- powertools-tracing
-
-
- software.amazon.lambda
- powertools-logging
-
-
- software.amazon.lambda
- powertools-idempotency
-
-
-
-
-
-
- compile
-
-
-
-
-
- org.apache.maven.plugins
- maven-dependency-plugin
-
-
- copy
- test-compile
-
- copy-dependencies
-
-
- test
- so,dll,dylib
- ${project.build.directory}/native-libs
-
-
-
-
-
- org.apache.maven.plugins
- maven-surefire-plugin
- 3.0.0-M5
-
-
- ${project.build.directory}/native-libs
-
-
- idempotency
- eu-central-1
- LOG_ERROR
-
-
-
-
- org.apache.maven.plugins
- maven-shade-plugin
- 3.2.4
-
-
- package
-
- shade
-
-
-
-
-
-
-
-
-
-
-
- com.github.edwgiz
- maven-shade-plugin.log4j2-cachefile-transformer
- 2.15
-
-
-
-
-
-
-
- dynamodb-local-oregon
- DynamoDB Local Release Repository
- https://s3.eu-central-1.amazonaws.com/dynamodb-local-frankfurt/release
-
-
-
diff --git a/java/Idempotency/Function/src/main/java/helloworld/App.java b/java/Idempotency/Function/src/main/java/helloworld/App.java
deleted file mode 100644
index 3fe3fc4..0000000
--- a/java/Idempotency/Function/src/main/java/helloworld/App.java
+++ /dev/null
@@ -1,92 +0,0 @@
-package helloworld;
-
-import com.amazonaws.services.lambda.runtime.Context;
-import com.amazonaws.services.lambda.runtime.RequestHandler;
-import com.amazonaws.services.lambda.runtime.events.APIGatewayProxyRequestEvent;
-import com.amazonaws.services.lambda.runtime.events.APIGatewayProxyResponseEvent;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
-import software.amazon.awssdk.services.dynamodb.DynamoDbClient;
-import software.amazon.lambda.powertools.idempotency.Idempotency;
-import software.amazon.lambda.powertools.idempotency.IdempotencyConfig;
-import software.amazon.lambda.powertools.idempotency.Idempotent;
-import software.amazon.lambda.powertools.idempotency.persistence.DynamoDBPersistenceStore;
-import software.amazon.lambda.powertools.logging.Logging;
-import software.amazon.lambda.powertools.utilities.JsonConfig;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.stream.Collectors;
-
-public class App implements RequestHandler {
- private final static Logger log = LogManager.getLogger(App.class);
-
- public App() {
- this(null);
- }
-
- public App(DynamoDbClient client) {
- Idempotency.config().withConfig(
- IdempotencyConfig.builder()
- .withEventKeyJMESPath("powertools_json(body).address") // will retrieve the address field in the body which is a string transformed to json with `powertools_json`
- .build())
- .withPersistenceStore(
- DynamoDBPersistenceStore.builder()
- .withDynamoDbClient(client)
- .withTableName(System.getenv("IDEMPOTENCY_TABLE"))
- .build()
- ).configure();
- }
-
- /**
- * Try with:
- *
First call will execute the handleRequest normally, and store the response in the idempotency table (Look into DynamoDB)
- *
Second call (and next ones) will retrieve from the cache (if cache is enabled, which is by default) or from the store, the handler won't be called. Until the expiration happens (by default 1 hour).