-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 85cea10
Showing
547 changed files
with
88,464 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: CI Lambda Rewrite Tests | ||
|
||
on: pull_request | ||
|
||
jobs: | ||
terraform-localstack: | ||
name: "CI: LocalStack Lambda Rewrite Tests" | ||
runs-on: ubuntu-latest | ||
env: | ||
DEFAULT_REGION: us-east-1 | ||
AWS_ACCOUNT_ID: "000000000000" | ||
AWS_ACCESS_KEY_ID: dummy-access-key | ||
AWS_SECRET_ACCESS_KEY: dummy-secret-key | ||
|
||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install terraform | ||
uses: hashicorp/setup-terraform@v2 | ||
with: | ||
terraform_version: 1.6.6 | ||
|
||
- name: Setup node.js 20.x | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20 | ||
|
||
- name: Install zip if using nektos/act | ||
run: apt-get update && apt-get install -y zip | ||
if: ${{ env.ACT }} | ||
|
||
- name: Install python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' | ||
|
||
- name: Install python modules | ||
run: pip install -r ./localstack/requirements.txt | ||
|
||
- name: Install docker-compose if using nektos/act | ||
run: | | ||
sudo curl -L https://github.com/docker/compose/releases/download/v2.6.1/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose | ||
sudo chmod +x /usr/local/bin/docker-compose | ||
if: ${{ env.ACT }} | ||
|
||
- name: Start LocalStack | ||
working-directory: ./localstack | ||
run: docker-compose up -d | ||
|
||
- name: Run rewrite tests | ||
working-directory: ./localstack | ||
run: ./run_lambda_test.sh | ||
|
||
- name: Report test results | ||
uses: EnricoMi/publish-unit-test-result-action@v1 | ||
if: always() | ||
with: | ||
files: localstack/testing_output/*.xml | ||
report_individual_runs: "true" | ||
|
||
- name: Stop LocalStack | ||
working-directory: ./localstack | ||
run: docker-compose down | ||
if: always() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: Update Semver | ||
on: | ||
push: | ||
branches-ignore: | ||
- '**' | ||
tags: | ||
- 'v*.*.*' | ||
jobs: | ||
update-semver: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: haya14busa/action-update-semver@v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
localstack/venv | ||
localstack/testing_dir | ||
localstack/testing_output | ||
**/.terraform | ||
**/sm-key* | ||
.DS_Store | ||
*.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Store the S3 access keys in 1password | ||
|
||
data "onepassword_vault" "s3_vault" { | ||
name = var.onepassword_vault | ||
} | ||
|
||
resource "onepassword_item" "s3_credentials" { | ||
vault = data.onepassword_vault.s3_vault.uuid | ||
title = local.domain | ||
category = "login" | ||
username = aws_iam_access_key.key.id | ||
password = aws_iam_access_key.key.secret | ||
url = local.domain | ||
|
||
section { | ||
label = "notes" | ||
field { | ||
label = "S3 Bucket" | ||
value = aws_s3_bucket.bucket.bucket | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
version: "3.9" | ||
services: | ||
build: | ||
image: public.ecr.aws/lambda/nodejs:${LAMBDA_RUNTIME} | ||
volumes: | ||
- ./:/app | ||
entrypoint: bash -c 'cd /app && npm install' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
version: "3.9" | ||
services: | ||
build: | ||
image: public.ecr.aws/lambda/nodejs:${LAMBDA_RUNTIME} | ||
volumes: | ||
- ./:/app | ||
entrypoint: bash -c 'cd /app && npm install' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
'use strict'; | ||
module.exports.handler = (event, context, callback) => { | ||
const request = event.Records[0].cf.request; | ||
const host = request.headers["host"][0].value; | ||
|
||
// Add an alternate way for the origin request Lambda to get the host header | ||
// without causing problems for S3 origin requests | ||
request.headers["x-forwarded-host"] = [{ | ||
key: "X-Forwarded-Host", | ||
value: host | ||
}]; | ||
|
||
callback(null, request); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"name": "cascade-www-edge-host-headers", | ||
"version": "1.0.0", | ||
"description": "HTTP host headers addition for CloudFront requests", | ||
"repository": "", | ||
"author": "Blake Dworaczyk<blaked@tamu.edu>", | ||
"license": "MIT", | ||
"dependencies": { | ||
}, | ||
"devDependencies": { | ||
} | ||
} |
Oops, something went wrong.