From 65328db4204413c49f81d852f811462a44895494 Mon Sep 17 00:00:00 2001 From: Damian Barrous-Dume Date: Thu, 4 May 2023 20:18:40 -0400 Subject: [PATCH 01/13] Fixed buildspec --- buildspec.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/buildspec.yml b/buildspec.yml index 647380d..2cacf48 100644 --- a/buildspec.yml +++ b/buildspec.yml @@ -3,6 +3,13 @@ version: 0.2 phases: pre_build: commands: + - | + if git describe --tags --exact-match > /dev/null 2>&1; then + echo "This is a tag push event" + else + echo "This is not a tag push event, setting PREFIX to 'Dev'" + PREFIX="Dev" + fi - echo Install dev dependencies - pip3 install -r requirements.txt - npm install -g aws-cdk @@ -30,17 +37,17 @@ phases: - | if [[ -z "${LAMBDA_PIPELINE}" ]];then echo Deploying Pipeline Architecture... - cdk deploy SDCAWSPipelineArchitectureStack -y --require-approval never + cdk deploy "${PREFIX}SDCAWSPipelineArchitectureStack" -y --require-approval never echo Start other Codebuilds aws codebuild start-build --project-name build_sdc_aws_base_docker_image --region us-east-2 aws codebuild start-build --project-name build_sdc_aws_sorting_lambda --region us-east-2 else if [[ $LAMBDA_PIPELINE == *"SORTING"* ]];then echo Deploying Sorting Lambda - cdk deploy SDCAWSSortingLambdaStack -y --require-approval never + cdk deploy "${PREFIX}SDCAWSSortingLambdaStack" -y --require-approval never else echo Deploying Processing Lambda - cdk deploy SDCAWSProcessingLambdaStack -y --require-approval never + cdk deploy "${PREFIX}SDCAWSProcessingLambdaStack" -y --require-approval never fi fi From aceaf2dd5b1834b91cd53f3237c18740935d85f5 Mon Sep 17 00:00:00 2001 From: Damian Barrous Dume Date: Wed, 17 May 2023 11:13:20 -0400 Subject: [PATCH 02/13] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0a09f4a..81df256 100755 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ |-|-| ### **Description**: -This repo contains the CDK Project that sets up all of the infrastructure the file processing pipeline requires. +This repo contains the CDK Project that sets up all of the infrastructure the file processing pipeline requires. This includes S3 Buckets, Public and Private ECR Repos, Timestream databases, Postgres RDS Servers, as well as Lambda Functions. # Information on working with a CDK Project From 09840010cba128563f2ab97b37c3d6d908292109 Mon Sep 17 00:00:00 2001 From: Damian Barrous-Dume Date: Mon, 12 Jun 2023 11:23:23 +0100 Subject: [PATCH 03/13] Fix acl error --- .../sdc_aws_pipeline_architecture.py | 30 ++++++++++++------- requirements.txt | 3 +- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/cdk_deployment/sdc_aws_pipeline_architecture.py b/cdk_deployment/sdc_aws_pipeline_architecture.py index 2c19fe9..549a4d2 100755 --- a/cdk_deployment/sdc_aws_pipeline_architecture.py +++ b/cdk_deployment/sdc_aws_pipeline_architecture.py @@ -97,16 +97,26 @@ def _create_s3_resources(self, config): if bucket == config["S3_SERVER_ACCESS_LOGS_BUCKET_NAME"]: continue - s3_bucket = aws_s3.Bucket( - self, - f"aws_sdc_{bucket}_bucket", - bucket_name=bucket, - removal_policy=RemovalPolicy.RETAIN, - auto_delete_objects=False, - server_access_logs_bucket=s3_server_access_bucket, - server_access_logs_prefix=f"{bucket}/", - versioned=True, - ) + if self.is_production: + s3_bucket = aws_s3.Bucket( + self, + f"aws_sdc_{bucket}_bucket", + bucket_name=bucket, + removal_policy=RemovalPolicy.RETAIN, + auto_delete_objects=False, + server_access_logs_bucket=s3_server_access_bucket, + server_access_logs_prefix=f"{bucket}/", + versioned=True, + ) + else: + s3_bucket = aws_s3.Bucket( + self, + f"aws_sdc_{bucket}_bucket", + bucket_name=bucket, + removal_policy=RemovalPolicy.RETAIN, + auto_delete_objects=False, + versioned=True, + ) if config["MISSION_NAME"] in bucket: topic_name = f"{bucket}-sns-topic" diff --git a/requirements.txt b/requirements.txt index 5ff622d..929e598 100755 --- a/requirements.txt +++ b/requirements.txt @@ -5,4 +5,5 @@ flake8==6.0.0 black==23.3.0 sphinx==6.1.3 sphinx-automodapi==0.15.0 -sphinx_rtd_theme==1.2.0 \ No newline at end of file +sphinx_rtd_theme==1.2.0 +pyyaml==6.0.0 From 323470b9e50fa417ed254fdfaaac4925b648260f Mon Sep 17 00:00:00 2001 From: Damian Barrous-Dume Date: Mon, 20 Nov 2023 11:37:06 +0000 Subject: [PATCH 04/13] Refactor Sorting Container --- config.yaml | 8 ++++---- terraform/.terraform-version | 1 + terraform/config.auto.tfvars | 6 +++--- terraform/main.tf | 2 +- terraform/sdc_aws_pipeline_infrastructure.tf | 7 +++++++ .../sdc_aws_processing_lambda_function.tf | 2 +- terraform/sdc_aws_sorting_lambda_function.tf | 10 +++------- terraform/variables.tf | 19 ++++++++++--------- 8 files changed, 30 insertions(+), 25 deletions(-) create mode 100644 terraform/.terraform-version diff --git a/config.yaml b/config.yaml index af731e4..1544546 100755 --- a/config.yaml +++ b/config.yaml @@ -29,10 +29,6 @@ INSTR_NAMES: # The names of the buckets that will be created for the mission INCOMING_BUCKET_NAME: swsoc-incoming -# S3 Sorting Lambda Bucket Name -# The name of the bucket that will be created to store the build artifacts for the sorting lambda -SORTING_LAMBDA_BUCKET_NAME: swsoc-sorting-lambda - # S3 Server Access Logs Bucket # The name of the bucket that will be created to store the s3 server access logs S3_SERVER_ACCESS_LOGS_BUCKET_NAME: swsoc-s3-server-access-logs @@ -41,6 +37,10 @@ S3_SERVER_ACCESS_LOGS_BUCKET_NAME: swsoc-s3-server-access-logs # The name of the ECR repository that will be created to store the processing lambda image PROCESSING_LAMBDA_PRIVATE_ECR_NAME: sdc_aws_processing_lambda +# S3 Sorting Lambda ECS Name +# The name of the ECR repository that will be created to store the build artifacts for the sorting lambda +SORTING_LAMBDA_PRIVATE_ECR_NAME: swsoc-sorting-lambda + # Docker Base ECR Repository Name # The name of the ECR repository that will be created to store the docker base image DOCKER_BASE_PUBLIC_ECR_NAME: swsoc-docker-lambda-base diff --git a/terraform/.terraform-version b/terraform/.terraform-version new file mode 100644 index 0000000..6463e95 --- /dev/null +++ b/terraform/.terraform-version @@ -0,0 +1 @@ +1.6.4 \ No newline at end of file diff --git a/terraform/config.auto.tfvars b/terraform/config.auto.tfvars index f59a92b..fc6ef18 100644 --- a/terraform/config.auto.tfvars +++ b/terraform/config.auto.tfvars @@ -25,9 +25,9 @@ timestream_s3_logs_table_name = "sdc_aws_s3_bucket_log_table" # The names of the buckets that will be created for the mission incoming_bucket_name = "swsoc-incoming" -# S3 Sorting Lambda Bucket Name -# The name of the bucket that will be created to store the build artifacts for the sorting lambda -sorting_lambda_bucket_name = "swsoc-sorting-lambda" +# S3 Sorting Lambda ECR Repository Name +# The name of the ECR repository that will be created to store the sorting lambda image +sorting_function_private_ecr_name = "sdc_aws_sorting_lambda" # S3 Server Access Logs Bucket # The name of the bucket that will be created to store the s3 server access logs diff --git a/terraform/main.tf b/terraform/main.tf index 4974ffa..0c06758 100644 --- a/terraform/main.tf +++ b/terraform/main.tf @@ -54,7 +54,7 @@ locals { last_data_level = element(var.valid_data_levels, length(var.valid_data_levels) - 1) instrument_bucket_names = [for bucket in var.instrument_names : "${var.mission_name}-${bucket}"] - bucket_list = concat([var.incoming_bucket_name], [var.sorting_lambda_bucket_name], local.instrument_bucket_names) + bucket_list = concat([var.incoming_bucket_name], local.instrument_bucket_names) } diff --git a/terraform/sdc_aws_pipeline_infrastructure.tf b/terraform/sdc_aws_pipeline_infrastructure.tf index 6ad16cd..47fb230 100644 --- a/terraform/sdc_aws_pipeline_infrastructure.tf +++ b/terraform/sdc_aws_pipeline_infrastructure.tf @@ -203,6 +203,13 @@ resource "aws_ecr_repository" "processing_function_private_ecr" { tags = local.standard_tags } +// Private ECR for the processing function +resource "aws_ecr_repository" "sorting_function_private_ecr" { + name = "${local.environment_short_name}${var.sorting_function_private_ecr_name}" + image_tag_mutability = "MUTABLE" + tags = local.standard_tags +} + // Public ECR for the docker base image resource "aws_ecrpublic_repository" "docker_base_public_ecr" { repository_name = "${local.environment_short_name}${var.docker_base_public_ecr_name}" diff --git a/terraform/sdc_aws_processing_lambda_function.tf b/terraform/sdc_aws_processing_lambda_function.tf index 0346d68..5c7d3d1 100644 --- a/terraform/sdc_aws_processing_lambda_function.tf +++ b/terraform/sdc_aws_processing_lambda_function.tf @@ -11,7 +11,7 @@ resource "aws_lambda_function" "aws_sdc_processing_lambda_function" { memory_size = 128 timeout = 900 - image_uri = "${aws_ecr_repository.processing_function_private_ecr.repository_url}:${var.image_tag}" + image_uri = "${aws_ecr_repository.processing_function_private_ecr.repository_url}:${var.pf_image_tag}" package_type = "Image" environment { diff --git a/terraform/sdc_aws_sorting_lambda_function.tf b/terraform/sdc_aws_sorting_lambda_function.tf index 548c6d0..9b1cddf 100644 --- a/terraform/sdc_aws_sorting_lambda_function.tf +++ b/terraform/sdc_aws_sorting_lambda_function.tf @@ -8,8 +8,6 @@ // Creates the Sorting Lambda function resource "aws_lambda_function" "sorting_lambda_function" { function_name = local.is_production ? "aws_sdc_sorting_lambda_function" : "dev_aws_sdc_sorting_lambda_function" - handler = "lambda_function.handler" - runtime = "python3.10" memory_size = 128 timeout = 600 @@ -21,8 +19,9 @@ resource "aws_lambda_function" "sorting_lambda_function" { } } - s3_bucket = "${local.environment_short_name}${var.sorting_lambda_bucket_name}" - s3_key = var.s3_key + image_uri = "${aws_ecr_repository.sorting_function_private_ecr.repository_url}:${var.sf_image_tag}" + package_type = "Image" + ephemeral_storage { size = 512 } @@ -31,9 +30,6 @@ resource "aws_lambda_function" "sorting_lambda_function" { mode = "PassThrough" } - architectures = ["x86_64"] - // The last object, assuming it's the latest - role = aws_iam_role.sorting_lambda_exec.arn tags = local.standard_tags diff --git a/terraform/variables.tf b/terraform/variables.tf index 0570509..bea8048 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -30,14 +30,14 @@ variable "mission_name" { description = "The list of missions" } -variable "sorting_lambda_bucket_name" { +variable "s3_server_access_logs_bucket_name" { type = string - description = "The name of the S3 bucket to create for storing the sorting lambda" + description = "The name of the S3 bucket to create for storing access logs" } -variable "s3_server_access_logs_bucket_name" { +variable "sorting_function_private_ecr_name" { type = string - description = "The name of the S3 bucket to create for storing access logs" + description = "Private ECR repository for the sorting function" } variable "processing_function_private_ecr_name" { @@ -64,15 +64,16 @@ variable "slack_channel" { sensitive = true } -variable "image_tag" { +variable "pf_image_tag" { type = string - description = "ECR image tag" + description = "Processing Function ECR image tag" default = "latest" } -variable "s3_key" { - type = string - description = "S3 key for the sorting lambda" +variable "sf_image_tag" { + type = string + description = "Sorting Function ECR image tag" + default = "latest" } variable "valid_data_levels" { From 3aa6ac9d20753340b6ec3d909fada715020eeb9f Mon Sep 17 00:00:00 2001 From: Damian Barrous-Dume Date: Mon, 20 Nov 2023 11:44:08 +0000 Subject: [PATCH 05/13] Fix buildspec --- buildspec.yml | 82 ++++++++++++++++++++++++++------------------------- 1 file changed, 42 insertions(+), 40 deletions(-) diff --git a/buildspec.yml b/buildspec.yml index 22877dd..f5e33a8 100755 --- a/buildspec.yml +++ b/buildspec.yml @@ -3,53 +3,55 @@ version: 0.2 phases: pre_build: commands: - - | - if git describe --tags --exact-match > /dev/null 2>&1; then - echo "This is a tag push event" - else - echo "This is not a tag push event, setting PREFIX to 'Dev'" - PREFIX="Dev" - fi - - echo Install dev dependencies + # Install dependencies + - echo "Installing dev dependencies" + - apt-get update + - apt-get install -y python3-pip make graphviz unzip - pip3 install -r requirements.txt - - npm install -g aws-cdk@2.77.0 - - Docs test - - apt-get update && apt-get install -y python3-pip - - apt-get install make graphviz -y + # Documentation Test + - echo "Generating documentation" - make html - - - echo Lint with Black - - black --check --diff app.py cdk_deployment - - - echo Lint with Flake - - flake8 --count --max-line-length 88 app.py cdk_deployment - - - echo CDK Test - - cdk synth + # Install Terraform + - echo "Installing Terraform" + - cd terraform + - curl -o terraform.zip https://releases.hashicorp.com/terraform/1.4.6/terraform_1.4.6_linux_amd64.zip + - unzip -o terraform.zip + - sudo mv terraform /usr/local/bin/ + - terraform --version + - terraform init && terraform validate - build: commands: - - echo Deploying Bootstrap Architecture... - - cdk bootstrap -y --require-approval never + # Deployment commands + - echo "Deploying Bootstrap Architecture..." - | - if [[ -z "${LAMBDA_PIPELINE}" ]];then - echo Deploying Pipeline Architecture... - cdk deploy "${PREFIX}SDCAWSPipelineArchitectureStack" -y --require-approval never - echo Start other Codebuilds - aws codebuild start-build --project-name build_sdc_aws_base_docker_image --region us-east-2 --environment-variables-override name=DEPLOYMENT_ENVIRONMENT,value=$CDK_ENVIRONMENT,type=PLAINTEXT - aws codebuild start-build --project-name build_sdc_aws_sorting_lambda --region us-east-2 --environment-variables-override name=DEPLOYMENT_ENVIRONMENT,value=$CDK_ENVIRONMENT,type=PLAINTEXT + if git describe --tags --exact-match > /dev/null 2>&1; then + echo "This is a tag push event" + PF_ECR_REPO=sdc_aws_processing_lambda + CDK_ENVIRONMENT=PRODUCTION + SF_ECR_REPO=sdc_aws_sorting_lambda + terraform workspace select prod + elif [ "${CDK_ENVIRONMENT}" = "PRODUCTION" ]; then + echo "This is a production environment" + PF_ECR_REPO=sdc_aws_processing_lambda + SF_ECR_REPO=sdc_aws_sorting_lambda + terraform workspace select prod else - if [[ $LAMBDA_PIPELINE == *"SORTING"* ]];then - echo Deploying Sorting Lambda - cdk deploy "${PREFIX}SDCAWSSortingLambdaStack" -y --require-approval never - else - echo Deploying Processing Lambda - cdk deploy "${PREFIX}SDCAWSProcessingLambdaStack" -y --require-approval never - fi - fi - + echo "This is a development environment" + PF_ECR_REPO=dev-sdc_aws_processing_lambda + SF_ECR_REPO=dev-sdc_aws_sorting_lambda + terraform workspace select dev + fi + + # Fetch latest image and SF image tag + - | + PF_IMAGE_TAG=$(aws ecr describe-images --repository-name $PF_ECR_REPO --region us-east-1 --query "sort_by(imageDetails,& imagePushedAt)[-1].imageTags[?!= 'latest'][0]" --output text) + SF_IMAGE_TAG=$(aws ecr describe-images --repository-name $SF_ECR_REPO --region us-east-1 --query "sort_by(imageDetails,& imagePushedAt)[-1].imageTags[?!= 'latest'][0]" --output text) + + # Run Terraform apply + - terraform apply -auto-approve -var "pf_image_tag=$PF_IMAGE_TAG" -var "sf_image_tag=$SF_IMAGE_TAG" - - echo Build completed on `date` \ No newline at end of file + # Completion message + - echo "Build completed on $(date)" \ No newline at end of file From e15ba25455d09b9ad95192d871eadbe9dbf6cfc3 Mon Sep 17 00:00:00 2001 From: Damian Barrous-Dume Date: Mon, 20 Nov 2023 11:48:23 +0000 Subject: [PATCH 06/13] Fix image tag filtering --- buildspec.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/buildspec.yml b/buildspec.yml index f5e33a8..4496098 100755 --- a/buildspec.yml +++ b/buildspec.yml @@ -47,8 +47,8 @@ phases: # Fetch latest image and SF image tag - | - PF_IMAGE_TAG=$(aws ecr describe-images --repository-name $PF_ECR_REPO --region us-east-1 --query "sort_by(imageDetails,& imagePushedAt)[-1].imageTags[?!= 'latest'][0]" --output text) - SF_IMAGE_TAG=$(aws ecr describe-images --repository-name $SF_ECR_REPO --region us-east-1 --query "sort_by(imageDetails,& imagePushedAt)[-1].imageTags[?!= 'latest'][0]" --output text) + PF_IMAGE_TAG=$(aws ecr describe-images --repository-name $PF_ECR_REPO --region us-east-1 --query "sort_by(imageDetails,& imagePushedAt)[-1].imageTags[]" --output text | grep -v latest | head -n 1) + SF_IMAGE_TAG=$(aws ecr describe-images --repository-name $SF_ECR_REPO --region us-east-1 --query "sort_by(imageDetails,& imagePushedAt)[-1].imageTags[]" --output text | grep -v latest | head -n 1) # Run Terraform apply - terraform apply -auto-approve -var "pf_image_tag=$PF_IMAGE_TAG" -var "sf_image_tag=$SF_IMAGE_TAG" From 3170c6f90a84fba837521bf2f96d1e600ceaedd7 Mon Sep 17 00:00:00 2001 From: Damian Barrous-Dume Date: Mon, 20 Nov 2023 11:51:56 +0000 Subject: [PATCH 07/13] Echo image tag --- buildspec.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/buildspec.yml b/buildspec.yml index 4496098..8123a88 100755 --- a/buildspec.yml +++ b/buildspec.yml @@ -48,7 +48,10 @@ phases: # Fetch latest image and SF image tag - | PF_IMAGE_TAG=$(aws ecr describe-images --repository-name $PF_ECR_REPO --region us-east-1 --query "sort_by(imageDetails,& imagePushedAt)[-1].imageTags[]" --output text | grep -v latest | head -n 1) + echo $PF_IMAGE_TAG SF_IMAGE_TAG=$(aws ecr describe-images --repository-name $SF_ECR_REPO --region us-east-1 --query "sort_by(imageDetails,& imagePushedAt)[-1].imageTags[]" --output text | grep -v latest | head -n 1) + echo $SF_IMAGE_TAG + # Run Terraform apply - terraform apply -auto-approve -var "pf_image_tag=$PF_IMAGE_TAG" -var "sf_image_tag=$SF_IMAGE_TAG" From 90d0a2bf630a35be21565f330feb9535011d1869 Mon Sep 17 00:00:00 2001 From: Damian Barrous-Dume Date: Mon, 20 Nov 2023 12:05:37 +0000 Subject: [PATCH 08/13] Fix parsing --- buildspec.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/buildspec.yml b/buildspec.yml index 8123a88..8e006a4 100755 --- a/buildspec.yml +++ b/buildspec.yml @@ -47,9 +47,10 @@ phases: # Fetch latest image and SF image tag - | - PF_IMAGE_TAG=$(aws ecr describe-images --repository-name $PF_ECR_REPO --region us-east-1 --query "sort_by(imageDetails,& imagePushedAt)[-1].imageTags[]" --output text | grep -v latest | head -n 1) + PF_IMAGE_TAG=$(aws-runas smce-swsoc aws ecr describe-images --repository-name $PF_ECR_REPO --region us-east-1 --query "sort_by(imageDetails,& imagePushedAt)[-1].imageTags[]" --output text | awk '{for(i=1;i<=NF;i++) if($i!="latest") print $i; exit}') echo $PF_IMAGE_TAG - SF_IMAGE_TAG=$(aws ecr describe-images --repository-name $SF_ECR_REPO --region us-east-1 --query "sort_by(imageDetails,& imagePushedAt)[-1].imageTags[]" --output text | grep -v latest | head -n 1) + + SF_IMAGE_TAG=$(aws-runas smce-swsoc aws ecr describe-images --repository-name $SF_ECR_REPO --region us-east-1 --query "sort_by(imageDetails,& imagePushedAt)[-1].imageTags[]" --output text | awk '{for(i=1;i<=NF;i++) if($i!="latest") print $i; exit}') echo $SF_IMAGE_TAG From 88760ebe804cb514e8f1c354a2a3928ea2180dc5 Mon Sep 17 00:00:00 2001 From: Damian Barrous-Dume Date: Mon, 20 Nov 2023 12:08:20 +0000 Subject: [PATCH 09/13] Fix parsing --- buildspec.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/buildspec.yml b/buildspec.yml index 8e006a4..981bf0f 100755 --- a/buildspec.yml +++ b/buildspec.yml @@ -47,10 +47,10 @@ phases: # Fetch latest image and SF image tag - | - PF_IMAGE_TAG=$(aws-runas smce-swsoc aws ecr describe-images --repository-name $PF_ECR_REPO --region us-east-1 --query "sort_by(imageDetails,& imagePushedAt)[-1].imageTags[]" --output text | awk '{for(i=1;i<=NF;i++) if($i!="latest") print $i; exit}') + PF_IMAGE_TAG=$(aws ecr describe-images --repository-name $PF_ECR_REPO --region us-east-1 --query "sort_by(imageDetails,& imagePushedAt)[-1].imageTags[]" --output text | awk '{for(i=1;i<=NF;i++) if($i!="latest") print $i; exit}') echo $PF_IMAGE_TAG - SF_IMAGE_TAG=$(aws-runas smce-swsoc aws ecr describe-images --repository-name $SF_ECR_REPO --region us-east-1 --query "sort_by(imageDetails,& imagePushedAt)[-1].imageTags[]" --output text | awk '{for(i=1;i<=NF;i++) if($i!="latest") print $i; exit}') + SF_IMAGE_TAG=$(aws ecr describe-images --repository-name $SF_ECR_REPO --region us-east-1 --query "sort_by(imageDetails,& imagePushedAt)[-1].imageTags[]" --output text | awk '{for(i=1;i<=NF;i++) if($i!="latest") print $i; exit}') echo $SF_IMAGE_TAG From fbcd64ebdf4a8f4d39d50814f0a5af90487536a5 Mon Sep 17 00:00:00 2001 From: Damian Barrous-Dume Date: Mon, 20 Nov 2023 12:53:30 +0000 Subject: [PATCH 10/13] Remove unneeded changes --- config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.yaml b/config.yaml index 1544546..252472b 100755 --- a/config.yaml +++ b/config.yaml @@ -48,4 +48,4 @@ DOCKER_BASE_PUBLIC_ECR_NAME: swsoc-docker-lambda-base # Timestream Database and Table Names for Logs # The names of the timestream database and table that will be created to store logs TIMESTREAM_DATABASE_NAME: sdc_aws_logs -TIMESTREAM_S3_LOGS_TABLE_NAME: sdc_aws_s3_bucket_log_table +TIMESTREAM_S3_LOGS_TABLE_NAME: sdc_aws_s3_bucket_log_table \ No newline at end of file From d2a1b3d224141e03032c67a7685f65fba5c67ef3 Mon Sep 17 00:00:00 2001 From: Damian Barrous-Dume Date: Mon, 20 Nov 2023 12:54:25 +0000 Subject: [PATCH 11/13] Remove unneeded changes --- .../sdc_aws_pipeline_architecture.py | 30 +++++++------------ 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/cdk_deployment/sdc_aws_pipeline_architecture.py b/cdk_deployment/sdc_aws_pipeline_architecture.py index 549a4d2..2c19fe9 100755 --- a/cdk_deployment/sdc_aws_pipeline_architecture.py +++ b/cdk_deployment/sdc_aws_pipeline_architecture.py @@ -97,26 +97,16 @@ def _create_s3_resources(self, config): if bucket == config["S3_SERVER_ACCESS_LOGS_BUCKET_NAME"]: continue - if self.is_production: - s3_bucket = aws_s3.Bucket( - self, - f"aws_sdc_{bucket}_bucket", - bucket_name=bucket, - removal_policy=RemovalPolicy.RETAIN, - auto_delete_objects=False, - server_access_logs_bucket=s3_server_access_bucket, - server_access_logs_prefix=f"{bucket}/", - versioned=True, - ) - else: - s3_bucket = aws_s3.Bucket( - self, - f"aws_sdc_{bucket}_bucket", - bucket_name=bucket, - removal_policy=RemovalPolicy.RETAIN, - auto_delete_objects=False, - versioned=True, - ) + s3_bucket = aws_s3.Bucket( + self, + f"aws_sdc_{bucket}_bucket", + bucket_name=bucket, + removal_policy=RemovalPolicy.RETAIN, + auto_delete_objects=False, + server_access_logs_bucket=s3_server_access_bucket, + server_access_logs_prefix=f"{bucket}/", + versioned=True, + ) if config["MISSION_NAME"] in bucket: topic_name = f"{bucket}-sns-topic" From 7a18c7de4cc51ec187504564adce67d0f0012860 Mon Sep 17 00:00:00 2001 From: Damian Barrous-Dume Date: Mon, 20 Nov 2023 12:55:26 +0000 Subject: [PATCH 12/13] Remove unneeded changes --- config.yaml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/config.yaml b/config.yaml index 252472b..03964db 100755 --- a/config.yaml +++ b/config.yaml @@ -29,18 +29,17 @@ INSTR_NAMES: # The names of the buckets that will be created for the mission INCOMING_BUCKET_NAME: swsoc-incoming +# S3 Sorting Lambda Bucket Name +# The name of the bucket that will be created to store the build artifacts for the sorting lambda +SORTING_LAMBDA_BUCKET_NAME: swsoc-sorting-lambda + # S3 Server Access Logs Bucket # The name of the bucket that will be created to store the s3 server access logs S3_SERVER_ACCESS_LOGS_BUCKET_NAME: swsoc-s3-server-access-logs - # Processing Lambda ECR Repository Name # The name of the ECR repository that will be created to store the processing lambda image PROCESSING_LAMBDA_PRIVATE_ECR_NAME: sdc_aws_processing_lambda -# S3 Sorting Lambda ECS Name -# The name of the ECR repository that will be created to store the build artifacts for the sorting lambda -SORTING_LAMBDA_PRIVATE_ECR_NAME: swsoc-sorting-lambda - # Docker Base ECR Repository Name # The name of the ECR repository that will be created to store the docker base image DOCKER_BASE_PUBLIC_ECR_NAME: swsoc-docker-lambda-base @@ -48,4 +47,4 @@ DOCKER_BASE_PUBLIC_ECR_NAME: swsoc-docker-lambda-base # Timestream Database and Table Names for Logs # The names of the timestream database and table that will be created to store logs TIMESTREAM_DATABASE_NAME: sdc_aws_logs -TIMESTREAM_S3_LOGS_TABLE_NAME: sdc_aws_s3_bucket_log_table \ No newline at end of file +TIMESTREAM_S3_LOGS_TABLE_NAME: sdc_aws_s3_bucket_log_table From f7ad253136d75eb138191a1c99bca3e269ee2075 Mon Sep 17 00:00:00 2001 From: Damian Barrous-Dume Date: Mon, 20 Nov 2023 12:56:44 +0000 Subject: [PATCH 13/13] Remove unneeded changes --- config.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/config.yaml b/config.yaml index 03964db..af731e4 100755 --- a/config.yaml +++ b/config.yaml @@ -36,6 +36,7 @@ SORTING_LAMBDA_BUCKET_NAME: swsoc-sorting-lambda # S3 Server Access Logs Bucket # The name of the bucket that will be created to store the s3 server access logs S3_SERVER_ACCESS_LOGS_BUCKET_NAME: swsoc-s3-server-access-logs + # Processing Lambda ECR Repository Name # The name of the ECR repository that will be created to store the processing lambda image PROCESSING_LAMBDA_PRIVATE_ECR_NAME: sdc_aws_processing_lambda