File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,11 +22,20 @@ resource "aws_cloudwatch_log_group" "lambda_logs" {
2222 tags = var. common_tags
2323}
2424
25+ # Create build directory if it doesn't exist
26+ resource "null_resource" "create_build_dir" {
27+ provisioner "local-exec" {
28+ command = " mkdir -p ${ path . module } /build"
29+ }
30+ }
31+
2532resource "null_resource" "build_trigger" {
2633 triggers = {
2734 source_py_hash = filesha256 (local. source_file )
2835 build_layer_exists = fileexists (" ${ path . module } /build/${ local . lambda_name } .zip" ) ? " yes" : " no"
2936 }
37+
38+ depends_on = [null_resource. create_build_dir ]
3039}
3140
3241# Package the lambda source file as a zip
@@ -47,6 +56,8 @@ resource "null_resource" "prepare_layer" {
4756 provisioner "local-exec" {
4857 command = " rm -fr ${ path . module } /build/layer/python && mkdir -p ${ path . module } /build/layer/ && cp -r ${ path . module } /src/layer ${ path . module } /build/layer/python && pip install -r ${ path . module } /build/layer/python/requirements.txt -t ${ path . module } /build/layer/python"
4958 }
59+
60+ depends_on = [null_resource. create_build_dir ]
5061}
5162
5263# Package the layer as a zip
Original file line number Diff line number Diff line change @@ -40,20 +40,6 @@ module "lambda" {
4040
4141}
4242
43- # External IAM Policies Module
44- # Depends on Lambda module (implicit via lambda_log_group_arn reference)
45- # This ensures: 1. Lambda created -> 2. CloudWatch log group output -> 3. Policies created
46- # module "external_policies" {
47- # source = "./modules/external_policies"
48- #
49- # collection_name = var.collection_name
50- # collection_arn = module.opensearch.collection_arn
51- # aws_region = var.aws_region
52- # account_id = data.aws_caller_identity.current.account_id
53- # common_tags = var.common_tags
54- # lambda_log_group_arn = module.lambda.lambda_log_group_arn
55- # }
56-
5743# API Gateway Module
5844# Integrates with Lambda function for /credentials endpoint
5945module "api_gateway" {
@@ -68,3 +54,5 @@ module "api_gateway" {
6854 aws_region = var. aws_region
6955 common_tags = var. common_tags
7056}
57+
58+ module " registry-api"
You can’t perform that action at this time.
0 commit comments