-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add ecr_proxy support, documentation improvements
- Loading branch information
1 parent
41aa6ab
commit 69e50f0
Showing
11 changed files
with
163 additions
and
7 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,30 @@ | ||
# EditorConfig is awesome: http://EditorConfig.org | ||
# Uses editorconfig to maintain consistent coding styles | ||
|
||
# top-most EditorConfig file | ||
root = true | ||
|
||
# Unix-style newlines with a newline ending every file | ||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
indent_size = 2 | ||
indent_style = space | ||
insert_final_newline = true | ||
max_line_length = 80 | ||
trim_trailing_whitespace = true | ||
|
||
[*.{tf,tfvars}] | ||
indent_size = 2 | ||
indent_style = space | ||
|
||
[*.md] | ||
max_line_length = 0 | ||
trim_trailing_whitespace = false | ||
|
||
[Makefile] | ||
tab_width = 2 | ||
indent_style = tab | ||
|
||
[COMMIT_EDITMSG] | ||
max_line_length = 0 |
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
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
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,16 @@ | ||
resource "aws_ecr_repository" "lambda_proxy" { | ||
count = var.enable_ecr_proxy ? 0 : 1 | ||
name = var.ecr_repository_prefix | ||
image_tag_mutability = "MUTABLE" | ||
force_delete = true | ||
image_scanning_configuration { | ||
scan_on_push = false | ||
} | ||
} | ||
|
||
resource "aws_ecr_pull_through_cache_rule" "docker_hub" { | ||
count = var.enable_ecr_proxy ? 0 : 1 | ||
ecr_repository_prefix = var.ecr_repository_prefix | ||
upstream_registry_url = "registry-1.docker.io" | ||
credential_arn = var.dockerhub_proxy_secret_arn | ||
} |
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 @@ | ||
module "letsencrypt_lambda" { | ||
source = "[email protected]:kvendingoldo/aws-letsencrypt-lambda.git//files/terraform/module?ref=rc/0.9.0" | ||
|
||
blank_name = "test-letsencrypt-lambda" | ||
tags = var.tags | ||
|
||
cron_schedule = var.letsencrypt_lambda_cron_schedule | ||
image_uri = var.letsencrypt_lambda_image_uri | ||
events = var.letsencrypt_lambda_events | ||
|
||
enable_ecr_proxy = false | ||
ecr_image_uri = "<YOUR_ACCOUNT_ID>.dkr.ecr.us-east-2.amazonaws.com/aws_letsencrypt_lambda:<VERSION>" | ||
} |
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,31 @@ | ||
variable "tags" { | ||
default = { | ||
testTagKey : "testTagValue" | ||
} | ||
} | ||
variable "letsencrypt_lambda_cron_schedule" { | ||
default = "rate(168 hours)" | ||
} | ||
variable "letsencrypt_lambda_image_uri" { | ||
default = "<YOUR_ACCOUNT_ID>.dkr.ecr.us-east-2.amazonaws.com/aws_letsencrypt_lambda:<VERSION>" | ||
} | ||
variable "letsencrypt_lambda_events" { | ||
default = [ | ||
{ | ||
"domainName" : "<TEST_DOMAIN_1>", | ||
"acmeUrl" : "stage", | ||
"acmeEmail" : "<EMAIL_1>", | ||
"reImportThreshold" : 10, | ||
"issueType" : "force" | ||
}, | ||
{ | ||
"acmRegion" : "us-east-2", | ||
"route53Region" : "us-east-1", | ||
"domainName" : "<TEST_DOMAIN_2>", | ||
"acmeUrl" : "prod", | ||
"acmeEmail" : "<EMAIL_2>", | ||
"reImportThreshold" : 30, | ||
"issueType" : "default" | ||
} | ||
] | ||
} |
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,10 @@ | ||
module "letsencrypt_lambda" { | ||
source = "[email protected]:kvendingoldo/aws-letsencrypt-lambda.git//files/terraform/module?ref=rc/0.9.0" | ||
|
||
blank_name = "test-letsencrypt-lambda" | ||
tags = var.tags | ||
|
||
cron_schedule = var.letsencrypt_lambda_cron_schedule | ||
image_uri = var.letsencrypt_lambda_image_uri | ||
events = var.letsencrypt_lambda_events | ||
} |
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,24 @@ | ||
variable "tags" { | ||
default = { | ||
testTagKey : "testTagValue" | ||
} | ||
} | ||
variable "letsencrypt_lambda_cron_schedule" { | ||
default = "rate(168 hours)" | ||
} | ||
variable "letsencrypt_lambda_image_uri" { | ||
default = "<YOUR_ACCOUNT_ID>.dkr.ecr.us-east-2.amazonaws.com/aws_letsencrypt_lambda:<VERSION>" | ||
} | ||
variable "letsencrypt_lambda_events" { | ||
default = [ | ||
{ | ||
"acmRegion" : "us-east-2", | ||
"route53Region" : "us-east-1", | ||
"domainName" : "<TEST_DOMAIN_2>", | ||
"acmeUrl" : "prod", | ||
"acmeEmail" : "<EMAIL_2>", | ||
"reImportThreshold" : 30, | ||
"issueType" : "default" | ||
} | ||
] | ||
} |
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 |
---|---|---|
@@ -1,4 +1,7 @@ | ||
locals { | ||
events = { for event in var.events : event["domainName"] => event if var.cron_enabled } | ||
image = "${data.aws_caller_identity.current.account_id}.dkr.ecr.${data.aws_region.current.name}.amazonaws.com/${var.ecr_proxy_repository_prefix}/${var.image}" | ||
events = {for event in var.events : event["domainName"] => event if var.cron_enabled} | ||
|
||
ecr_domain = "${data.aws_caller_identity.current.account_id}.dkr.ecr.${data.aws_region.current.name}.amazonaws.com" | ||
image_prefix = var.enable_ecr_proxy ? "${local.ecr_domain}/${var.ecr_repository_prefix}/" : "" | ||
lambda_image = var.enable_ecr_proxy ? "${local.image_prefix}${var.dockerhub_image}" : var.ecr_image_uri | ||
} |
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
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