mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
get queue name from settings
This commit is contained in:
parent
bd891a7a85
commit
62fe46adc4
5 changed files with 18 additions and 2 deletions
2
.github/workflows/deploy_terraform.yml
vendored
2
.github/workflows/deploy_terraform.yml
vendored
|
|
@ -505,7 +505,7 @@ jobs:
|
|||
# Deploy Hubspot ETL Lambda
|
||||
# ============================================================
|
||||
hubspot_etl_lambda:
|
||||
needs: [hubspot_etl_image, determine_stage]
|
||||
needs: [hubspot_etl_image, determine_stage, pashub_to_ara_lambda]
|
||||
uses: ./.github/workflows/_deploy_lambda.yml
|
||||
with:
|
||||
lambda_name: hubspot-etl-to-ara
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ class Settings(BaseSettings):
|
|||
PLAN_TRIGGER_BUCKET: str = "changeme"
|
||||
ENGINE_SQS_URL: str = "changeme"
|
||||
CATEGORISATION_SQS_URL: str = "changeme"
|
||||
PASHUB_TO_ARA_SQS_URL: str = "changeme"
|
||||
|
||||
# Third parties
|
||||
EPC_AUTH_TOKEN: str = "changeme"
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import json
|
|||
import boto3
|
||||
from typing import Any, Dict, Optional
|
||||
|
||||
from backend.app.config import get_settings
|
||||
from etl.hubspot.hubspotClient import HubspotClient
|
||||
from etl.hubspot.hubspotDataTodB import CompanyData, HubspotDataToDb
|
||||
from etl.hubspot.hubspot_deal_differ import HubspotDealDiffer
|
||||
|
|
@ -21,7 +22,7 @@ def handler(body: dict[str, Any], context: Any) -> None:
|
|||
hubspot_client = HubspotClient()
|
||||
|
||||
sqs_client = boto3.client("sqs")
|
||||
PASHUB_TRIGGER_QUEUE_URL = "pashub_to_ara-queue-dev" # TODO: get from env var
|
||||
PASHUB_TRIGGER_QUEUE_URL = get_settings().PASHUB_TO_ARA_SQS_URL
|
||||
|
||||
payload = HubspotTriggerOrchestratorTriggerRequest.model_validate(body)
|
||||
hubspot_deal_id: str = payload.hubspot_deal_id
|
||||
|
|
|
|||
|
|
@ -7,6 +7,14 @@ data "terraform_remote_state" "shared" {
|
|||
}
|
||||
}
|
||||
|
||||
data "terraform_remote_state" "pashub_to_ara" {
|
||||
backend = "s3"
|
||||
config = {
|
||||
bucket = "pashub-to-ara-terraform-state"
|
||||
key = "ev:/${var.stage}/terraform.tfstate"
|
||||
region = "eu-west-2"
|
||||
}
|
||||
}
|
||||
|
||||
data "aws_secretsmanager_secret_version" "db_credentials" {
|
||||
secret_id = "${var.stage}/assessment_model/db_credentials"
|
||||
|
|
@ -39,6 +47,8 @@ module "hubspot_deal_etl" {
|
|||
DB_NAME = var.db_name
|
||||
DB_PORT = var.db_port
|
||||
HUBSPOT_API_KEY = var.hubspot_api_key
|
||||
|
||||
PASHUB_TO_ARA_SQS_URL = data.terraform_remote_state.pashub_to_ara.pashhub_to_ara_queue_url
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
4
infrastructure/terraform/lambda/pashub_to_ara/outputs.tf
Normal file
4
infrastructure/terraform/lambda/pashub_to_ara/outputs.tf
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
output "pashhub_to_ara_queue_url" {
|
||||
value = module.lambda.queue_url
|
||||
description = "URL of the PasHub to Ara SQS queue"
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue