Skip to content

Commit 72f4543

Browse files
authored
v0.0.3
Various bug fixes (#10) * update lambda concurrency * lambda@edge in us-east-1 * remove region pin * bump version * doc update
1 parent cde1f25 commit 72f4543

File tree

8 files changed

+11
-7
lines changed

8 files changed

+11
-7
lines changed

.config/functional_tests/pre-entrypoint-helpers.sh

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ cd ${PROJECT_PATH}
1313

1414
#********** TFC Env Vars *************
1515
export AWS_DEFAULT_REGION=us-west-2
16+
export AWS_REGION=us-west-2
1617
export TFE_TOKEN=`aws secretsmanager get-secret-value --secret-id abp/hcp/token --region $AWS_DEFAULT_REGION | jq -r ".SecretString"`
1718
export TF_TOKEN_app_terraform_io=`aws secretsmanager get-secret-value --secret-id abp/hcp/token --region $AWS_DEFAULT_REGION | jq -r ".SecretString"`
1819

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ To use this module you need have the following:
188188
| <a name="input_lambda_architecture"></a> [lambda\_architecture](#input\_lambda\_architecture) | Lambda architecture (arm64 or x86\_64) | `string` | `"x86_64"` | no |
189189
| <a name="input_lambda_default_timeout"></a> [lambda\_default\_timeout](#input\_lambda\_default\_timeout) | Lambda default timeout in seconds | `number` | `120` | no |
190190
| <a name="input_lambda_python_runtime"></a> [lambda\_python\_runtime](#input\_lambda\_python\_runtime) | Lambda Python runtime | `string` | `"python3.11"` | no |
191-
| <a name="input_lambda_reserved_concurrency"></a> [lambda\_reserved\_concurrency](#input\_lambda\_reserved\_concurrency) | Maximum Lambda reserved concurrency, make sure your AWS quota is sufficient | `number` | `100` | no |
191+
| <a name="input_lambda_reserved_concurrency"></a> [lambda\_reserved\_concurrency](#input\_lambda\_reserved\_concurrency) | Maximum Lambda reserved concurrency, make sure your AWS quota is sufficient | `number` | `10` | no |
192192
| <a name="input_name_prefix"></a> [name\_prefix](#input\_name\_prefix) | Name to be used on all the resources as identifier. | `string` | `"runtask-tf-plan-analyzer"` | no |
193193
| <a name="input_recovery_window"></a> [recovery\_window](#input\_recovery\_window) | Number of days that AWS Secrets Manager waits before it can delete the secret | `number` | `0` | no |
194194
| <a name="input_run_task_iam_roles"></a> [run\_task\_iam\_roles](#input\_run\_task\_iam\_roles) | List of IAM roles to be attached to the Lambda function | `list(string)` | `null` | no |

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v0.0.2
1+
v0.0.3

lambda.tf

+1
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ resource "aws_cloudwatch_log_group" "runtask_callback" {
127127

128128
################# Run task Edge ##################
129129
resource "aws_lambda_function" "runtask_edge" {
130+
provider = aws.cloudfront_waf # Lambda@Edge must be in us-east-1
130131
function_name = "${local.solution_prefix}-runtask-edge"
131132
description = "HCP Terraform run task - Lambda@Edge handler"
132133
role = aws_iam_role.runtask_edge.arn

lambda/runtask_fulfillment/ai.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ def guardrail_inspection(input_text, input_mode = 'OUTPUT'):
263263

264264
else:
265265
return True, "Guardrail inspection skipped"
266-
266+
267267
def clean_response(json_str):
268268
# Remove any tags in the format <tag> or </tag>
269269
cleaned_str = re.sub(r'<\/?[\w\s]+>', '', json_str)

lambda/runtask_fulfillment/tools/get_ami_releases.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
from utils import logger
55

66
session = boto3.Session()
7-
aws_region = "us-east-1"
8-
ec2_client = session.client(service_name="ec2", region_name=aws_region)
9-
7+
ec2_client = session.client(service_name="ec2")
108

119
class GetECSAmisReleases:
1210
def execute(self, ami_ids):

tests/01_mandatory.tftest.hcl

+4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
# create additional *.tftest.hcl for your own unit / integration tests
44
# use tests/*.auto.tfvars to add non-default variables
55

6+
provider "aws" {
7+
region = "us-west-2"
8+
}
9+
610
run "mandatory_plan_basic" {
711
command = plan
812
module {

variables.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ variable "recovery_window" {
8383
variable "lambda_reserved_concurrency" {
8484
description = "Maximum Lambda reserved concurrency, make sure your AWS quota is sufficient"
8585
type = number
86-
default = 100
86+
default = 10
8787
}
8888

8989
variable "lambda_default_timeout" {

0 commit comments

Comments
 (0)