diff --git a/.config/functional_tests/pre-entrypoint-helpers.sh b/.config/functional_tests/pre-entrypoint-helpers.sh index 74b7406..8128453 100644 --- a/.config/functional_tests/pre-entrypoint-helpers.sh +++ b/.config/functional_tests/pre-entrypoint-helpers.sh @@ -13,6 +13,7 @@ cd ${PROJECT_PATH} #********** TFC Env Vars ************* export AWS_DEFAULT_REGION=us-west-2 +export AWS_REGION=us-west-2 export TFE_TOKEN=`aws secretsmanager get-secret-value --secret-id abp/hcp/token --region $AWS_DEFAULT_REGION | jq -r ".SecretString"` export TF_TOKEN_app_terraform_io=`aws secretsmanager get-secret-value --secret-id abp/hcp/token --region $AWS_DEFAULT_REGION | jq -r ".SecretString"` diff --git a/README.md b/README.md index d28c7c0..cc1a8b6 100644 --- a/README.md +++ b/README.md @@ -188,7 +188,7 @@ To use this module you need have the following: | [lambda\_architecture](#input\_lambda\_architecture) | Lambda architecture (arm64 or x86\_64) | `string` | `"x86_64"` | no | | [lambda\_default\_timeout](#input\_lambda\_default\_timeout) | Lambda default timeout in seconds | `number` | `120` | no | | [lambda\_python\_runtime](#input\_lambda\_python\_runtime) | Lambda Python runtime | `string` | `"python3.11"` | no | -| [lambda\_reserved\_concurrency](#input\_lambda\_reserved\_concurrency) | Maximum Lambda reserved concurrency, make sure your AWS quota is sufficient | `number` | `100` | no | +| [lambda\_reserved\_concurrency](#input\_lambda\_reserved\_concurrency) | Maximum Lambda reserved concurrency, make sure your AWS quota is sufficient | `number` | `10` | no | | [name\_prefix](#input\_name\_prefix) | Name to be used on all the resources as identifier. | `string` | `"runtask-tf-plan-analyzer"` | no | | [recovery\_window](#input\_recovery\_window) | Number of days that AWS Secrets Manager waits before it can delete the secret | `number` | `0` | no | | [run\_task\_iam\_roles](#input\_run\_task\_iam\_roles) | List of IAM roles to be attached to the Lambda function | `list(string)` | `null` | no | diff --git a/VERSION b/VERSION index 90ab6e9..8ce995b 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v0.0.2 \ No newline at end of file +v0.0.3 \ No newline at end of file diff --git a/lambda.tf b/lambda.tf index fcc6fa9..5e29017 100644 --- a/lambda.tf +++ b/lambda.tf @@ -127,6 +127,7 @@ resource "aws_cloudwatch_log_group" "runtask_callback" { ################# Run task Edge ################## resource "aws_lambda_function" "runtask_edge" { + provider = aws.cloudfront_waf # Lambda@Edge must be in us-east-1 function_name = "${local.solution_prefix}-runtask-edge" description = "HCP Terraform run task - Lambda@Edge handler" role = aws_iam_role.runtask_edge.arn diff --git a/lambda/runtask_fulfillment/ai.py b/lambda/runtask_fulfillment/ai.py index 4ac72da..aed428b 100644 --- a/lambda/runtask_fulfillment/ai.py +++ b/lambda/runtask_fulfillment/ai.py @@ -263,7 +263,7 @@ def guardrail_inspection(input_text, input_mode = 'OUTPUT'): else: return True, "Guardrail inspection skipped" - + def clean_response(json_str): # Remove any tags in the format or cleaned_str = re.sub(r'<\/?[\w\s]+>', '', json_str) diff --git a/lambda/runtask_fulfillment/tools/get_ami_releases.py b/lambda/runtask_fulfillment/tools/get_ami_releases.py index a60d34d..57c20d1 100644 --- a/lambda/runtask_fulfillment/tools/get_ami_releases.py +++ b/lambda/runtask_fulfillment/tools/get_ami_releases.py @@ -4,9 +4,7 @@ from utils import logger session = boto3.Session() -aws_region = "us-east-1" -ec2_client = session.client(service_name="ec2", region_name=aws_region) - +ec2_client = session.client(service_name="ec2") class GetECSAmisReleases: def execute(self, ami_ids): diff --git a/tests/01_mandatory.tftest.hcl b/tests/01_mandatory.tftest.hcl index efbda7b..ac68398 100644 --- a/tests/01_mandatory.tftest.hcl +++ b/tests/01_mandatory.tftest.hcl @@ -3,6 +3,10 @@ # create additional *.tftest.hcl for your own unit / integration tests # use tests/*.auto.tfvars to add non-default variables +provider "aws" { + region = "us-west-2" +} + run "mandatory_plan_basic" { command = plan module { diff --git a/variables.tf b/variables.tf index 953b3d2..bb0dcbb 100644 --- a/variables.tf +++ b/variables.tf @@ -83,7 +83,7 @@ variable "recovery_window" { variable "lambda_reserved_concurrency" { description = "Maximum Lambda reserved concurrency, make sure your AWS quota is sufficient" type = number - default = 100 + default = 10 } variable "lambda_default_timeout" {