Skip to content

Commit 177564b

Browse files
jangidmstbelmega
authored andcommitted
Update to version v2.3.1
1 parent 7458699 commit 177564b

File tree

130 files changed

+25952
-428
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+25952
-428
lines changed

.github/workflows/gh-page.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main # Set a branch name to trigger deployment
7+
pull_request:
8+
9+
jobs:
10+
deploy:
11+
runs-on: ubuntu-20.04
12+
steps:
13+
- uses: actions/checkout@v2
14+
with:
15+
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
16+
17+
- name: Setup Python
18+
uses: actions/setup-python@v2
19+
with:
20+
python-version: "3.9"
21+
22+
- name: Install dependencies
23+
run: |
24+
python3 -m pip install mkdocs==1.3.1 # install mkdocs
25+
python3 -m pip install mkdocs-material==8.5.3 # install material theme
26+
python3 -m pip install mkdocs-macros-plugin==0.7.0 # install macros plugin
27+
python3 -m pip install mkdocs-include-markdown-plugin==3.8.1 # install include-markdown
28+
29+
- name: Build mkdocs
30+
run: |
31+
mkdocs build -f ./docs/mkdocs.en.yml
32+
mkdocs build -f ./docs/mkdocs.zh.yml
33+
cp -av ./docs/index.html ./docs/site
34+
35+
- name: Deploy
36+
uses: peaceiris/actions-gh-pages@v3
37+
if: ${{ github.ref == 'refs/heads/main' }}
38+
with:
39+
github_token: ${{ secrets.GITHUB_TOKEN }}
40+
publish_dir: ./docs/site

.gitignore

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
# Typescript
12
source/*/*.js
23
*.d.ts
34
*.js
5+
!.nightswatch/**/*.js
46
node_modules/
57

68
# CDK asset staging directory
@@ -13,21 +15,19 @@ cdk.out
1315
# Jetbrains project
1416
.idea/
1517

16-
# mkdocs documentation
17-
docs/site/
18-
1918
# MaxMind GeoIP database
2019
source/constructs/lambda/plugin/standard/assets/GeoLite2-City.mmdb
2120
source/constructs/lambda/microbatch/utils/enrichment/maxminddb/GeoLite2-City.mmdb
2221

2322
# Test folder including coverage report
2423
source/tests/
24+
source/test/
2525

2626
# Deployment
27-
staging
28-
global-s3-assets
29-
regional-s3-assets
30-
viperlight
27+
deployment/global-s3-assets/
28+
deployment/regional-s3-assets/
29+
deployment/viperlight
30+
deployment/staging/
3131

3232
### macOS ###
3333
# General
@@ -49,7 +49,7 @@ __pycache__/
4949
pip-log.txt
5050
pip-delete-this-directory.txt
5151

52-
## Distribution / packaging
52+
# Distribution / packaging
5353
*.egg-info/
5454

5555
# Unit test / coverage reports
@@ -78,3 +78,7 @@ ENV/
7878
env.bak/
7979
venv.bak/
8080

81+
*.mmdb
82+
83+
#requirement files
84+
source/constructs/**/*requirement*.txt

CHANGELOG.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,24 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [2.3.0] - 2024-12-17
8+
## [2.3.1] - 2025-02-24
9+
10+
### Changed
11+
12+
- Migrated to Poetry for Python dependency management
13+
14+
### Fixed
15+
16+
- Fixed S3 permission issue when creating cross-account Lambda log ingestion pipeline [Issue #312](https://github.com/aws-solutions/centralized-logging-with-opensearch/issues/312)
17+
- Fixed STS credential expiration handling when ingesting logs from cross-account sources
18+
- Fixed Opensearch index rollover timeout issue
19+
20+
### Security
21+
22+
- Updated serialize-javascript package to address [CVE-2024-11831](https://avd.aquasec.com/nvd/2024/cve-2024-11831/)
23+
- Updated cryptography package to address [CVE-2024-12797](https://avd.aquasec.com/nvd/2024/cve-2024-12797/)
24+
25+
## [2.3.0] - 2024-12-11
926

1027
### Added
1128

@@ -26,7 +43,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2643
- Fix the issue that the EKS DaemonSet Guide is not refreshed after editing the log config. #241
2744
- Fix the user interface issue that a wrong S3 bucket prefix is using when creating WAF log pipeline if the logging has already been enabled. #67
2845

29-
3046
## [2.2.2] - 2024-08-23
3147

3248
### Changed

CUSTOM_BUILD.md

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,22 @@ Before you start customizing the solution, make sure you have the following prer
1010
- Python (>=3.9)
1111
- NodeJS (v18 or later)
1212
- Docker
13-
1413
> if you are using ARM CPU like Apple M1 chip, please run `export DOCKER_DEFAULT_PLATFORM=linux/amd64` for building amd64 container image.
14+
- Install Poetry. Below is one of the ways to install poetry. For other ways to install poetry, refer [Poetry installation instructions](https://python-poetry.org/docs/#installation)
15+
16+
```shell
17+
## Install pipx via pip
18+
python3 -m pip install --user pipx
19+
python3 -m pipx ensurepath
20+
21+
## OR Install pipx via brew
22+
brew install pipx
23+
pipx ensurepath
24+
25+
## Install poetry
26+
pipx install poetry
27+
pipx inject poetry poetry-plugin-export
28+
```
1529

1630
Clone the repository and make desired code changes.
1731

@@ -29,6 +43,7 @@ The following is the file structure of the solution. You can customize the solut
2943
│ ├── cdk-solution-helper/ - helper function for converting CDK output to a format compatible with the AWS Solutions pipelines.
3044
│ ├── build-open-source-dist.sh - builds the open source package with cleaned assets and builds a .zip file in the /open-source folder for distribution to GitHub
3145
│ ├── build-s3-dist.sh - builds the solution and copies artifacts to the appropriate /global-s3-assets or /regional-s3-assets folders.
46+
│ ├── run-unit-tests.sh - runs all the unit tests within the /source folder
3247
├── source/
3348
│ ├── constructs
3449
│ │ ├── bin
@@ -58,9 +73,9 @@ The following is the file structure of the solution. You can customize the solut
5873
After you have customized the solution. Run the unit tests to ensure the solution is working as expected. Review the generated coverage report.
5974

6075
```
61-
cd ./source
62-
chmod +x ./run-all-tests.sh
63-
./run-all-tests.sh
76+
cd ./deployment
77+
chmod +x ./run-unit-tests.sh
78+
./run-unit-tests.sh
6479
cd ..
6580
```
6681

NOTICE.txt

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1717,6 +1717,28 @@ yocto-queue under the MIT license
17171717
zen-observable under the MIT license
17181718
zen-observable-ts under the MIT license
17191719
zen-push under the MIT license
1720+
urlgrabber under the LGPL-2.0-or-later license.
1721+
pygpgme under the LGPL-2.1-only license.
1722+
pycurl under the MIT license.
1723+
call-bind-apply-helpers under the MIT license.
1724+
dunder-proto under the MIT license.
1725+
highlightjs-vue under the CC0-1.0 license.
1726+
@rtsao/scc under the MIT license.
1727+
regjsgen under the MIT license.
1728+
@babel/plugin-transform-regexp-modifiers under the MIT license.
1729+
color-support under the ISC license.
1730+
@aws-solutions-constructs/resources under the Apache-2.0 license.
1731+
charset-normalizer under the MIT license.
1732+
python-dateutil under the Apache-2.0 license.
1733+
six under the MIT license.
1734+
typing-extensions under the PSF-2.0 license.
1735+
jinja2 under the 0BSD license.
1736+
markupsafe under the 0BSD license.
1737+
packaging under the Apache-2.0 license.
1738+
pywin32 under the PSF-2.0 license.
1739+
werkzeug under the 0BSD license.
1740+
commonlib under the 0BSD license.
1741+
pyopenssl under the Apache-2.0 license.
17201742

17211743

17221744
********************
@@ -1738,4 +1760,5 @@ Python-2.0 - https://opensource.org/licenses/Python-2.0
17381760
Unlicense - https://opensource.org/licenses/Unlicense
17391761
LGPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
17401762
LGPL-2.1-only - https://spdx.org/licenses/LGPL-2.1-only.html
1741-
Zlib - https://spdx.org/licenses/Zlib.html
1763+
Zlib - https://spdx.org/licenses/Zlib.html
1764+
PSF-2.0 - https://opensource.org/licenses/Python-2.0

arch.png

-1.67 MB
Binary file not shown.

deployment/build-s3-dist.sh

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,15 @@ do_cmd()
7373
fi
7474
}
7575

76+
if command -v poetry >/dev/null 2>&1; then
77+
export POETRY_COMMAND="poetry"
78+
elif [ -n "$POETRY_HOME" ] && [ -x "$POETRY_HOME/bin/poetry" ]; then
79+
export POETRY_COMMAND="$POETRY_HOME/bin/poetry"
80+
else
81+
echo "Poetry is not available. Aborting script." >&2
82+
exit 1
83+
fi
84+
7685
sedi()
7786
{
7887
# cross-platform for sed -i
@@ -284,9 +293,37 @@ t do_cmd npm run build # build javascript from typescript to validate the
284293

285294

286295
echo "------------------------------------------------------------------------------"
287-
echo "${bold}[Create] Templates${normal}"
296+
echo "[Install] Install dependencies for Lambda functions & layers"
288297
echo "------------------------------------------------------------------------------"
289298

299+
do_cmd cd $source_dir/constructs/lib/microbatch/main/services/lambda/layer
300+
"$POETRY_COMMAND" export --format requirements.txt --output requirements-boto3.txt --without-hashes --only boto3
301+
"$POETRY_COMMAND" export --format requirements.txt --output requirements-pyarrow.txt --without-hashes --only pyarrow
302+
"$POETRY_COMMAND" export --format requirements.txt --output requirements-utils.txt --without-hashes --only utils
303+
"$POETRY_COMMAND" export --format requirements.txt --output requirements-enrichment.txt --without-hashes --only enrichment
304+
305+
lambda_paths=(
306+
"common-lib"
307+
"api/app_log_ingestion"
308+
"api/app_pipeline"
309+
"api/cluster"
310+
"api/log_source"
311+
"plugin/standard"
312+
"api/pipeline_ingestion_flow"
313+
)
314+
315+
base_lambda_dir="$source_dir/constructs/lambda"
316+
for path in "${lambda_paths[@]}"; do
317+
full_path="$base_lambda_dir/$path"
318+
do_cmd cd "$full_path"
319+
"$POETRY_COMMAND" export --format requirements.txt --output requirements.txt --without-hashes --without dev
320+
done
321+
322+
323+
echo "------------------------------------------------------------------------------"
324+
echo "${bold}[Create] Templates${normal}"
325+
echo "------------------------------------------------------------------------------"
326+
do_cmd cd $source_dir/constructs
290327
if fn_exists create_template_${template_format}; then
291328
t create_template_${template_format}
292329
else
@@ -375,3 +412,18 @@ cd $template_dir
375412
# build ecr
376413
echo "Run s3_list_objects_dir/build.sh"
377414
t do_cmd $s3_list_objects_dir/build.sh
415+
416+
# cleanup requirement.txt files
417+
paths=(
418+
"$source_dir/constructs/lib/microbatch/main/services/lambda/layer"
419+
"$source_dir/constructs/lambda/common-lib"
420+
"$source_dir/constructs/lambda/api/app_log_ingestion"
421+
"$source_dir/constructs/lambda/api/app_pipeline"
422+
"$source_dir/constructs/lambda/api/cluster"
423+
"$source_dir/constructs/lambda/api/log_source"
424+
"$source_dir/constructs/lambda/plugin/standard"
425+
"$source_dir/constructs/lambda/api/pipeline_ingestion_flow"
426+
)
427+
for path in "${paths[@]}"; do
428+
rm $path/requirements*.txt
429+
done

deployment/ecr/clo-s3-list-objects/Dockerfile

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1-
FROM public.ecr.aws/lambda/python:3.11.2024.11.22.15 AS builder
1+
FROM public.ecr.aws/lambda/python:3.12.2025.01.24.11 AS builder
22

33
WORKDIR /build
44

5-
COPY common-lib .
5+
COPY common-lib ./common-lib
6+
COPY pyproject.toml poetry.lock ./
67

78
RUN python -m venv .venv && \
89
source .venv/bin/activate && \
910
pip install --upgrade build && \
10-
pip install --upgrade pip && \
11-
pip install setuptools==70.0.0 && \
12-
python3 -m build -s
11+
pip install poetry==2.0.1 && \
12+
poetry self add poetry-plugin-export && \
13+
poetry export --format requirements.txt --output requirements.txt --without-hashes --without dev && \
14+
cd common-lib && \
15+
poetry build
1316

14-
15-
FROM public.ecr.aws/lambda/python:3.11.2024.11.22.15
17+
FROM public.ecr.aws/lambda/python:3.12.2025.01.24.11
1618

1719
WORKDIR /ws
1820

19-
COPY requirements.txt .
20-
COPY --from=builder /build/dist/commonlib-0.1.0.tar.gz .
21+
COPY --from=builder /build/common-lib/dist/commonlib-0.1.0.tar.gz .
22+
COPY --from=builder /build/requirements.txt .
2123

2224
RUN pip install --no-cache-dir -r requirements.txt && \
23-
pip install --upgrade pip && \
24-
pip install setuptools==70.0.0 && \
2525
pip install --no-cache-dir commonlib-0.1.0.tar.gz
2626

2727
COPY . .

0 commit comments

Comments
 (0)