Skip to content

Commit 3a3fb36

Browse files
Merge pull request #1 from aws-samples/main
merging latest
2 parents df55763 + 765e7a1 commit 3a3fb36

8,507 files changed

Lines changed: 2211809 additions & 5857 deletions

File tree

Some content is hidden

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

.github/ISSUE_TEMPLATE/new-serverless-pattern-submission.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,19 @@ name: New serverless pattern submission
33
about: Submit your a new pattern
44
title: New pattern submission
55
labels: ''
6-
assignees: jbesw
6+
assignees:
77

88
---
99

1010
To submit a template to the Serverless Patterns Collection, submit an issue with the following information.
1111

12+
**IMPORTANT**
13+
Patterns are intended to be primarily IaC-focused implementations of 2-4 AWS services, with minimum custom code. They should be commonly used combinations that help developers get started quickly. If you have a utility, demo, or application, submit these to the [Serverless Repos Collection](https://serverlessland.com/repos) instead.
14+
15+
**ONLY SUBMIT ONE PATTERN CHANGE PER PR**. Multiple patterns or files spanning multiple pattern directories will be automatically rejected.
16+
17+
Patterns may take up to 4-6 weeks to review, test, and merge but there is no SLA and can take significantly longer due to other work the team has.
18+
1219
**To learn more about submitting a pattern, read the [publishing guidelines page](https://github.com/aws-samples/serverless-patterns/blob/main/PUBLISHING.md).**
1320

1421
1. Use the model template located at https://github.com/aws-samples/serverless-patterns/tree/main/_pattern-model to set up a README, template and any associated code.
@@ -18,7 +25,6 @@ To submit a template to the Serverless Patterns Collection, submit an issue with
1825
Note the following information for the model:
1926
- Description (intro.text) should be a 300-500 word explanation of how the pattern works.
2027
- Resources should like to AWS documentation and AWS blogs related to the post (1-5 maximum).
21-
- Framework: currently, we support SAM or CDK.
2228
- Author bio may include a LinkedIn and/or Twitter reference and a 1-sentence bio.
2329

2430
You must ensure that the sections of the model README.md are completed in full.

.github/dependabot.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
5+
6+
version: 2
7+
updates:
8+
# Maintain dependencies for npm
9+
- package-ecosystem: "npm"
10+
directory: "/"
11+
schedule:
12+
interval: "weekly"
13+
14+
# Maintain dependencies for PIP
15+
- package-ecosystem: "pip"
16+
directory: "/"
17+
schedule:
18+
interval: "weekly"
Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
name: Create and Update Releases
2+
permissions:
3+
contents: write
4+
5+
on:
6+
push:
7+
branches:
8+
- main
9+
10+
jobs:
11+
get-release:
12+
runs-on: ubuntu-latest
13+
outputs:
14+
latest_release: ${{ steps.get_latest_release.outputs.latest_release }}
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v3
18+
19+
- name: Get the latest release tag
20+
id: get_latest_release
21+
env:
22+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23+
run: |
24+
LATEST_RELEASE=$(gh release list --limit 1 --json tagName --jq '.[0].tagName' || echo "none")
25+
echo "Latest release tag: $LATEST_RELEASE"
26+
echo "::set-output name=latest_release::$LATEST_RELEASE"
27+
echo "latest_release=${latest_release}" >> $GITHUB_ENV
28+
continue-on-error: true
29+
30+
create-release:
31+
needs: get-release
32+
runs-on: ubuntu-latest
33+
if: needs.get-release.outputs.latest_release == ''
34+
steps:
35+
- name: print latest release output
36+
run: echo "Latest release ${{ needs.get-release.outputs.latest_release }}"
37+
38+
- name: Checkout repository
39+
uses: actions/checkout@v3
40+
41+
- name: Release doesn't exist so create one
42+
id: create_release
43+
env:
44+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
run: |
46+
gh release create v1.0.0 --notes "Initial release v1.0.0" --prerelease=false
47+
echo "Release created"
48+
49+
- name: Zip files of folders
50+
id: zip_folders
51+
run: |
52+
mkdir -p temp
53+
for folder in */; do
54+
if [ -d "$folder" ]; then
55+
folder_name=$(basename "$folder")
56+
zip -r "temp/${folder_name}.zip" "$folder_name"
57+
fi
58+
done
59+
echo "Zip files created"
60+
61+
- name: upload files to the release
62+
id: upload_files
63+
env:
64+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
65+
run: |
66+
for file in temp/*.zip; do
67+
if [ -f "$file" ]; then
68+
gh release upload v1.0.0 "$file" --clobber
69+
echo "Uploaded $file, waiting to avoid rate limits..."
70+
sleep 3
71+
else
72+
echo "File $file not found"
73+
fi
74+
done
75+
76+
update-release:
77+
needs: get-release
78+
runs-on: ubuntu-latest
79+
if: needs.get-release.outputs.latest_release != ''
80+
steps:
81+
- name: Checkout repository
82+
uses: actions/checkout@v3
83+
84+
- name: Fetch latest tags
85+
run: |
86+
git fetch --tags
87+
88+
- name: Get changed files
89+
id: get_changes
90+
run: |
91+
if [ -n "${{ needs.get-release.outputs.latest_release }}" ]; then
92+
git fetch origin refs/tags/${{ needs.get-release.outputs.latest_release }}:refs/tags/${{ needs.get-release.outputs.latest_release }}
93+
changed_files=$(git diff --name-only ${{ needs.get-release.outputs.latest_release }} HEAD)
94+
echo "Changed files: $changed_files"
95+
echo "$changed_files" > changed_files.txt
96+
else
97+
echo "No latest release found"
98+
echo "" > changed_files.txt
99+
fi
100+
101+
- name: Identify changed folders
102+
id: identify_folders
103+
run: |
104+
if [ -s changed_files.txt ]; then
105+
changed_folders=$(awk -F/ '{print $1}' changed_files.txt | sort | uniq)
106+
echo "Changed folders: $changed_folders"
107+
echo "$changed_folders" > changed_folders.txt
108+
else
109+
echo "No changed files"
110+
echo "" > changed_folders.txt
111+
fi
112+
113+
- name: Archive changed folders
114+
run: |
115+
mkdir -p temp_archives
116+
while IFS= read -r folder; do
117+
if [ -d "$folder" ]; then
118+
zip -r "temp_archives/$folder.zip" "$folder"
119+
echo "Archived $folder"
120+
else
121+
echo "Folder $folder does not exist"
122+
fi
123+
done < changed_folders.txt
124+
125+
- name: Upload archives to release
126+
if: needs.get-release.outputs.latest_release != ''
127+
env:
128+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
129+
run: |
130+
while IFS= read -r folder; do
131+
archive="temp_archives/$folder.zip"
132+
if [ -f "$archive" ]; then
133+
gh release upload ${{ needs.get-release.outputs.latest_release }} "$archive" --clobber
134+
echo "Uploaded $archive, waiting to avoid rate limits..."
135+
else
136+
echo "Archive $archive not found"
137+
fi
138+
done < changed_folders.txt
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Manual trigger that will Copy pattern to SLand
2+
name: Manual Copy to SLand-team-test
3+
4+
on:
5+
workflow_dispatch:
6+
inputs:
7+
fileName:
8+
description: "new pattern filename"
9+
required: true
10+
dirName:
11+
description: "new pattern dir"
12+
required: true
13+
14+
jobs:
15+
copy:
16+
runs-on: ubuntu-latest
17+
env:
18+
NODE_ENV: dev
19+
fileName: ${{ inputs.fileName }}
20+
steps:
21+
- name: Check if user is a member of the team
22+
uses: tspascoal/get-user-teams-membership@v2
23+
id: checkUserMember
24+
with:
25+
username: ${{ github.actor }}
26+
team: 'aws-serverless-da'
27+
GITHUB_TOKEN: ${{ secrets.GET_USER_TEAMS_MEMBERSHIP }}
28+
- name: Copycat
29+
if: ${{ steps.checkUserMember.outputs.isTeamMember == 'true' }}
30+
uses: andstor/copycat-action@v3
31+
with:
32+
personal_token: ${{ secrets.patterns_pat }}
33+
dst_path: /submissions/patterns/
34+
dst_owner: bls20AWS
35+
dst_repo_name: serverless-land
36+
dst_branch: master
37+
src_branch: main
38+
file_filter: "*.json"
39+
src_path: /${{ inputs.dirName }}/${{ inputs.fileName }}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Manual trigger that will Copy pattern to SLand
2+
name: Manual Copy to SLand
3+
4+
on:
5+
workflow_dispatch:
6+
inputs:
7+
fileName:
8+
description: "new pattern filename"
9+
required: true
10+
dirName:
11+
description: "new pattern dir"
12+
required: true
13+
14+
jobs:
15+
copy:
16+
runs-on: ubuntu-latest
17+
if: ${{ (github.actor == 'bls20aws') || (github.actor == 'singledigit') || (github.actor == 'boyney123') || (github.actor == 'mavi888') || (github.actor == 'julianwood') }}
18+
env:
19+
NODE_ENV: dev
20+
fileName: ${{ inputs.fileName }}
21+
steps:
22+
- name: Copycat
23+
uses: andstor/copycat-action@v3
24+
with:
25+
personal_token: ${{ secrets.patterns_pat }}
26+
dst_path: /submissions/patterns/
27+
dst_owner: bls20AWS
28+
dst_repo_name: serverless-land
29+
dst_branch: master
30+
src_branch: main
31+
file_filter: "*.json"
32+
src_path: /${{ inputs.dirName }}/${{ inputs.fileName }}

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414

1515
- name: Get changed files using defaults
1616
id: changed-files
17-
uses: tj-actions/changed-files@v19
17+
uses: tj-actions/changed-files@e9772d140489982e0e3704fea5ee93d536f1e275
1818
with:
1919
separator: ","
2020

.github/workflows/manual-validate-for-pattern.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ jobs:
2424
# run a custom script to get the SHA, and then finally checkout the PR branch
2525
- name: Checkout Repo
2626
uses: actions/checkout@v3
27+
# Use the fork repo URL in subsequent steps
28+
- name: Get repo URL
29+
run: echo "REPO_NAME=${{ github.event.repository.name }}" >> $GITHUB_ENV
30+
- name: Dump github context
31+
run: echo "$GITHUB_CONTEXT"
32+
shell: bash
33+
env:
34+
GITHUB_CONTEXT: ${{ toJson(github) }}
2735
- name: Extract PR details
2836
id: extract_PR_details
2937
uses: actions/github-script@v6
@@ -44,5 +52,4 @@ jobs:
4452
MODIFIED_FILES: ${{ steps.extract_PR_details.outputs.files }}
4553
ADDED_FILES: "${{ steps.changed-files.outputs.added_files }}"
4654
PR_NUMBER: ${{ inputs.prNumber }}
47-
ACTOR: ${{ steps.extract_PR_details.outputs.user }}
4855
TOKEN: "${{ secrets.GITHUB_TOKEN }}"

.github/workflows/schema-validation.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
name: "Schema Validation"
2+
permissions:
3+
contents: read
24

35
on: [pull_request]
46

@@ -15,7 +17,7 @@ jobs:
1517

1618
- name: Get changed files using defaults
1719
id: changed-files
18-
uses: tj-actions/changed-files@v19
20+
uses: tj-actions/changed-files@e9772d140489982e0e3704fea5ee93d536f1e275
1921
with:
2022
separator: ","
2123

.gitignore

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,8 @@ crash.log
206206
crash.*.log
207207

208208
# Exclude all .tfvars files, which are likely to contain sensitive data, such as
209-
# password, private keys, and other secrets. These should not be part of version
210-
# control as they are data points which are potentially sensitive and subject
209+
# password, private keys, and other secrets. These should not be part of version
210+
# control as they are data points which are potentially sensitive and subject
211211
# to change depending on the environment.
212212
*.tfvars
213213
*.tfvars.json
@@ -234,4 +234,7 @@ terraform.rc
234234

235235
#Ignore Intellij files
236236
*.iml
237-
*.idea
237+
*.idea
238+
239+
# This file gets generated as part of Maven shade plugin which can be ignored
240+
dependency-reduced-pom.xml

0 commit comments

Comments
 (0)