-
Notifications
You must be signed in to change notification settings - Fork 25
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
[fix] Various fixes for TF AWS 3.0 compatibility #324
Changes from all commits
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 |
---|---|---|
|
@@ -81,14 +81,6 @@ data "aws_region" "current" {} | |
data "aws_caller_identity" "current" {} | ||
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.
|
||
|
||
# TODO scope this policy down | ||
# | ||
# I would love to use "${aws_cloudwatch_log_group.log.arn}", as the | ||
# resource here, but the provider returns an ARN that looks like: | ||
# arn:aws:logs:us-west-2:123456789:log-group:/foo/bar:* | ||
# Unfortunately you need to use an ARN like: | ||
# arn:aws:logs:us-west-2:123456789:log-group:/foo/bar | ||
# to match operations on the log group(like creating a new stream.) So instead we construct one | ||
# without the colon before the *, so that we can match both log groups and log streams. | ||
data "aws_iam_policy_document" "lambda_logging_policy" { | ||
statement { | ||
effect = "Allow" | ||
|
@@ -101,7 +93,7 @@ data "aws_iam_policy_document" "lambda_logging_policy" { | |
resources = [ | ||
var.at_edge ? | ||
"*" : | ||
"arn:aws:logs:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:log-group:${aws_cloudwatch_log_group.log.name}*", | ||
"${aws_cloudwatch_log_group.log.arn}:*" | ||
] | ||
} | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ locals { | |
|
||
module "sg" { | ||
source = "terraform-aws-modules/security-group/aws" | ||
version = "3.12.0" | ||
version = "4.3.0" | ||
name = local.name | ||
description = "Allow traffic to Redis." | ||
vpc_id = var.vpc_id | ||
|
@@ -56,7 +56,7 @@ resource "aws_elasticache_cluster" "default" { | |
num_cache_nodes = 1 | ||
parameter_group_name = var.parameter_group_name | ||
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. 📝 [tflint] reported by reviewdog 🐶 |
||
subnet_group_name = aws_elasticache_subnet_group.default.name | ||
security_group_ids = [module.sg.this_security_group_id] | ||
security_group_ids = [module.sg.security_group_id] | ||
apply_immediately = var.apply_immediately | ||
availability_zone = var.availability_zone | ||
tags = local.tags | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -87,7 +87,7 @@ resource "aws_s3_bucket_public_access_block" "bucket" { | |
module "security_headers_lambda" { | ||
source = "../aws-lambda-edge-add-security-headers" | ||
|
||
function_name = replace("${local.website_fqdn}-static-site-security-headers", ".", "-") | ||
function_name = replace("${local.website_fqdn}-headers", ".", "-") | ||
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. Reduce issue where this string is >64 characters long. Forces redeploy of lambda for anything already deployed with HSTS headers (which should just be a single deployment in Along), and the redeploy should be safe. |
||
|
||
project = var.project | ||
owner = var.owner | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
provider "aws" {} | ||
|
||
provider "aws" { | ||
alias = "us-east-1" | ||
region = "us-east-1" | ||
|
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.
Missing version constraint for provider "aws" in "required_providers"