-
-
Notifications
You must be signed in to change notification settings - Fork 248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to specify source directory for Lambda@Edge submodule #260
Changes from all commits
30e46ed
a25e584
b704e0e
8369ce0
97ea48f
6472f53
6439e68
bb768ac
98a5bac
bf69589
47a2489
0731f52
429502b
ce3226b
c652905
09b6df1
6a3d642
1bd83e7
cc6ecc4
22335e4
1b5fb58
814dc66
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
--- | ||
name: Bug report | ||
description: Create a report to help us improve | ||
labels: ["bug"] | ||
assignees: [""] | ||
body: | ||
- type: markdown | ||
attributes: | ||
value: | | ||
Found a bug? | ||
Please checkout our [Slack Community](https://slack.cloudposse.com) | ||
or visit our [Slack Archive](https://archive.sweetops.com/). | ||
[![Slack Community](https://slack.cloudposse.com/badge.svg)](https://slack.cloudposse.com) | ||
- type: textarea | ||
id: concise-description | ||
attributes: | ||
label: Describe the Bug | ||
description: A clear and concise description of what the bug is. | ||
placeholder: What is the bug about? | ||
validations: | ||
required: true | ||
|
||
- type: textarea | ||
id: expected | ||
attributes: | ||
label: Expected Behavior | ||
description: A clear and concise description of what you expected. | ||
placeholder: What happened? | ||
validations: | ||
required: true | ||
|
||
- type: textarea | ||
id: reproduction-steps | ||
attributes: | ||
label: Steps to Reproduce | ||
description: Steps to reproduce the behavior. | ||
placeholder: How do we reproduce it? | ||
validations: | ||
required: true | ||
|
||
- type: textarea | ||
id: screenshots | ||
attributes: | ||
label: Screenshots | ||
description: If applicable, add screenshots or logs to help explain. | ||
validations: | ||
required: false | ||
|
||
- type: textarea | ||
id: environment | ||
attributes: | ||
label: Environment | ||
description: Anything that will help us triage the bug. | ||
placeholder: | | ||
- OS: [e.g. Linux, OSX, WSL, etc] | ||
- Version [e.g. 10.15] | ||
- Module version | ||
- Terraform version | ||
validations: | ||
required: false | ||
|
||
- type: textarea | ||
id: additional | ||
attributes: | ||
label: Additional Context | ||
description: | | ||
Add any other context about the problem here. | ||
validations: | ||
required: false |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
--- | ||
name: Feature Request | ||
description: Suggest an idea for this project | ||
labels: ["feature request"] | ||
assignees: [""] | ||
body: | ||
- type: markdown | ||
attributes: | ||
value: | | ||
Have a question? | ||
|
||
Please checkout our [Slack Community](https://slack.cloudposse.com) | ||
or visit our [Slack Archive](https://archive.sweetops.com/). | ||
|
||
[![Slack Community](https://slack.cloudposse.com/badge.svg)](https://slack.cloudposse.com) | ||
|
||
- type: textarea | ||
id: concise-description | ||
attributes: | ||
label: Describe the Feature | ||
description: A clear and concise description of what the feature is. | ||
placeholder: What is the feature about? | ||
validations: | ||
required: true | ||
|
||
- type: textarea | ||
id: expected | ||
attributes: | ||
label: Expected Behavior | ||
description: A clear and concise description of what you expected. | ||
placeholder: What happened? | ||
validations: | ||
required: true | ||
|
||
- type: textarea | ||
id: use-case | ||
attributes: | ||
label: Use Case | ||
description: | | ||
Is your feature request related to a problem/challenge you are trying | ||
to solve? | ||
|
||
Please provide some additional context of why this feature or | ||
capability will be valuable. | ||
validations: | ||
required: true | ||
|
||
- type: textarea | ||
id: ideal-solution | ||
attributes: | ||
label: Describe Ideal Solution | ||
description: A clear and concise description of what you want to happen. | ||
validations: | ||
required: true | ||
|
||
- type: textarea | ||
id: alternatives-considered | ||
attributes: | ||
label: Alternatives Considered | ||
description: Explain alternative solutions or features considered. | ||
validations: | ||
required: false | ||
|
||
- type: textarea | ||
id: additional | ||
attributes: | ||
label: Additional Context | ||
description: | | ||
Add any other context about the problem here. | ||
validations: | ||
required: false |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,21 @@ | ||
## what | ||
* Describe high-level what changed as a result of these commits (i.e. in plain-english, what do these changes mean?) | ||
* Use bullet points to be concise and to the point. | ||
|
||
<!-- | ||
- Describe high-level what changed as a result of these commits (i.e. in plain-english, what do these changes mean?) | ||
- Use bullet points to be concise and to the point. | ||
--> | ||
|
||
## why | ||
* Provide the justifications for the changes (e.g. business case). | ||
* Describe why these changes were made (e.g. why do these commits fix the problem?) | ||
* Use bullet points to be concise and to the point. | ||
|
||
<!-- | ||
- Provide the justifications for the changes (e.g. business case). | ||
- Describe why these changes were made (e.g. why do these commits fix the problem?) | ||
- Use bullet points to be concise and to the point. | ||
--> | ||
|
||
## references | ||
* Link to any supporting github issues or helpful documentation to add some context (e.g. stackoverflow). | ||
* Use `closes #123`, if this PR closes a GitHub issue `#123` | ||
|
||
<!-- | ||
- Link to any supporting github issues or helpful documentation to add some context (e.g. stackoverflow). | ||
- Use `closes #123`, if this PR closes a GitHub issue `#123` | ||
--> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,7 @@ jobs: | |
make init | ||
make github/init/context.tf | ||
make readme/build | ||
echo "::set-output name=create_pull_request::true" | ||
echo "create_pull_request=true" >> "$GITHUB_OUTPUT" | ||
fi | ||
else | ||
echo "This module has not yet been updated to support the context.tf pattern! Please update in order to support automatic updates." | ||
|
@@ -37,7 +37,7 @@ jobs: | |
if: steps.update.outputs.create_pull_request == 'true' | ||
uses: cloudposse/actions/github/[email protected] | ||
with: | ||
token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }} | ||
token: ${{ secrets.REPO_ACCESS_TOKEN }} | ||
committer: 'cloudpossebot <[email protected]>' | ||
author: 'cloudpossebot <[email protected]>' | ||
commit-message: Update context.tf from origin source | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ jobs: | |
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
run: | | ||
default_branch=$(gh repo view --json defaultBranchRef --jq .defaultBranchRef.name) | ||
printf "::set-output name=defaultBranch::%s\n" "${default_branch}" | ||
echo "defaultBranch=${default_branch}" >> "$GITHUB_OUTPUT" | ||
printf "defaultBranchRef.name=%s\n" "${default_branch}" | ||
- name: Update readme | ||
|
@@ -52,7 +52,7 @@ jobs: | |
# If a PR of the auto-update/readme branch is open, this action will just update it, not create a new PR. | ||
uses: cloudposse/actions/github/[email protected] | ||
with: | ||
token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }} | ||
token: ${{ secrets.REPO_ACCESS_TOKEN }} | ||
commit-message: Update README.md and docs | ||
title: Update README.md and docs | ||
body: |- | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ jobs: | |
- name: "Handle common commands" | ||
uses: cloudposse/actions/github/[email protected] | ||
with: | ||
token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }} | ||
token: ${{ secrets.REPO_ACCESS_TOKEN }} | ||
reaction-token: ${{ secrets.GITHUB_TOKEN }} | ||
repository: cloudposse/actions | ||
commands: rebuild-readme, terraform-fmt | ||
|
@@ -26,7 +26,7 @@ jobs: | |
- name: "Run tests" | ||
uses: cloudposse/actions/github/[email protected] | ||
with: | ||
token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }} | ||
token: ${{ secrets.REPO_ACCESS_TOKEN }} | ||
reaction-token: ${{ secrets.GITHUB_TOKEN }} | ||
repository: cloudposse/actions | ||
commands: test | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,7 @@ jobs: | |
checks: "syntax,owners,duppatterns" | ||
owner_checker_allow_unowned_patterns: "false" | ||
# GitHub access token is required only if the `owners` check is enabled | ||
github_access_token: "${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}" | ||
github_access_token: "${{ secrets.REPO_ACCESS_TOKEN }}" | ||
- uses: mszostok/[email protected] | ||
if: github.event.pull_request.head.repo.full_name != github.repository | ||
name: "Syntax check of CODEOWNERS" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
'use strict'; | ||
|
||
exports.handler = (event, context, callback) => { | ||
const response = event.Records[0].cf.response; | ||
const headers = response.headers; | ||
|
||
// Add a custom header to the response | ||
headers['x-custom-header'] = [{ key: 'X-Custom-Header', value: 'My custom value' }]; | ||
|
||
callback(null, response); | ||
}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sample |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
terraform { | ||
required_version = ">= 0.13.0" | ||
required_version = ">= 1.3" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. bumped version in order to support |
||
|
||
required_providers { | ||
aws = { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ locals { | |
# Encapsulate logic here so that it is not lost/scattered among the configuration | ||
website_enabled = local.enabled && var.website_enabled | ||
website_password_enabled = local.website_enabled && var.s3_website_password_enabled | ||
s3_origin_enabled = local.enabled && ! var.website_enabled | ||
s3_origin_enabled = local.enabled && !var.website_enabled | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. bridgecrew insisted |
||
create_s3_origin_bucket = local.enabled && var.origin_bucket == null | ||
s3_access_logging_enabled = local.enabled && (var.s3_access_logging_enabled == null ? length(var.s3_access_log_bucket_name) > 0 : var.s3_access_logging_enabled) | ||
create_cf_log_bucket = local.cloudfront_access_logging_enabled && local.cloudfront_access_log_create_bucket | ||
|
@@ -52,7 +52,7 @@ locals { | |
|
||
override_origin_bucket_policy = local.enabled && var.override_origin_bucket_policy | ||
|
||
lookup_cf_log_bucket = local.cloudfront_access_logging_enabled && ! local.cloudfront_access_log_create_bucket | ||
lookup_cf_log_bucket = local.cloudfront_access_logging_enabled && !local.cloudfront_access_log_create_bucket | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. bridgecrew insisted |
||
cf_log_bucket_domain = local.cloudfront_access_logging_enabled ? ( | ||
local.lookup_cf_log_bucket ? data.aws_s3_bucket.cf_logs[0].bucket_domain_name : module.logs.bucket_domain_name | ||
) : "" | ||
|
@@ -418,7 +418,7 @@ resource "aws_cloudfront_distribution" "default" { | |
origin_path = var.origin_path | ||
|
||
dynamic "s3_origin_config" { | ||
for_each = ! var.website_enabled ? [1] : [] | ||
for_each = !var.website_enabled ? [1] : [] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Ensure AWS CloudFront attached WAFv2 WebACL is configured with AMR for Log4j Vulnerability
|
||
content { | ||
origin_access_identity = local.cf_access.path | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,15 @@ output "lambda_function_association" { | |
lambda_arn = aws_lambda_function.default[k].qualified_arn | ||
} | ||
] | ||
} | ||
} | ||
|
||
output "lambda_functions" { | ||
description = "The Lambda@Edge functions" | ||
value = { | ||
for key, value in local.functions : key => { | ||
arn = aws_lambda_function.default[key].arn, | ||
qualified_arn = aws_lambda_function.default[key].qualified_arn, | ||
role_arn = aws_lambda_function.default[key].role | ||
} | ||
} | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Exporting role arn so policy attachment can be added to lambda. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more type of lambda@edge cloudfront function. Needed to test
source_dir