mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-12 13:29:04 +00:00
Merge branch 'main' of github.com:Hestia-Homes/Model into feature/address_trigger_from_frontend
This commit is contained in:
commit
2ffabe94d5
6 changed files with 42 additions and 5 deletions
|
|
@ -8,7 +8,8 @@ RUN chmod +x /usr/local/bin/aws-lambda-rie
|
||||||
WORKDIR /var/task
|
WORKDIR /var/task
|
||||||
|
|
||||||
COPY utils/ utils/
|
COPY utils/ utils/
|
||||||
COPY backend/pashub_fetcher/ backend/pashub_fetcher/
|
COPY backend/ backend/
|
||||||
|
COPY datatypes/ datatypes/
|
||||||
|
|
||||||
COPY backend/pashub_fetcher/handler/requirements.txt .
|
COPY backend/pashub_fetcher/handler/requirements.txt .
|
||||||
RUN pip install --no-cache-dir -r requirements.txt
|
RUN pip install --no-cache-dir -r requirements.txt
|
||||||
|
|
@ -22,5 +23,4 @@ ENTRYPOINT ["python", "-m", "awslambdaric"]
|
||||||
# -----------------------------
|
# -----------------------------
|
||||||
# Lambda handler
|
# Lambda handler
|
||||||
# -----------------------------
|
# -----------------------------
|
||||||
CMD ["backend.pashub_fetcher.handler.handler"]
|
CMD ["backend.pashub_fetcher.handler.handler.handler"]
|
||||||
# CMD ["backend.pashub_fetcher.handler.handler.handler"]
|
|
||||||
|
|
@ -2,4 +2,12 @@ awslambdaric
|
||||||
playwright==1.58.0
|
playwright==1.58.0
|
||||||
requests
|
requests
|
||||||
msal
|
msal
|
||||||
openpyxl
|
openpyxl
|
||||||
|
pydantic-settings
|
||||||
|
sqlalchemy
|
||||||
|
sqlmodel
|
||||||
|
psycopg2-binary
|
||||||
|
pytz
|
||||||
|
boto3==1.35.44
|
||||||
|
pandas==2.2.2
|
||||||
|
numpy<2.0
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,8 @@ services:
|
||||||
build:
|
build:
|
||||||
context: ../../../
|
context: ../../../
|
||||||
dockerfile: backend/pashub_fetcher/handler/Dockerfile
|
dockerfile: backend/pashub_fetcher/handler/Dockerfile
|
||||||
|
entrypoint: ["/usr/local/bin/aws-lambda-rie", "python", "-m", "awslambdaric"]
|
||||||
|
command: ["backend.pashub_fetcher.handler.handler.handler"]
|
||||||
ports:
|
ports:
|
||||||
- "9000:8080"
|
- "9000:8080"
|
||||||
env_file:
|
env_file:
|
||||||
|
|
|
||||||
|
|
@ -12,8 +12,9 @@ payload = {
|
||||||
{
|
{
|
||||||
"body": json.dumps(
|
"body": json.dumps(
|
||||||
{
|
{
|
||||||
"pashub_link": "https://pashub.net/jobs/00000000-0000-0000-0000-000000000000/details",
|
"pashub_link": "https://google.co.uk",
|
||||||
"uprn": "123456",
|
"uprn": "123456",
|
||||||
|
"hubspot_deal_id": "498926855369",
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -55,4 +55,25 @@ module "hubspot_deal_etl" {
|
||||||
resource "aws_iam_role_policy_attachment" "lambda_s3_policy" {
|
resource "aws_iam_role_policy_attachment" "lambda_s3_policy" {
|
||||||
role = module.hubspot_deal_etl.role_name
|
role = module.hubspot_deal_etl.role_name
|
||||||
policy_arn = data.terraform_remote_state.shared.outputs.hubspot_etl_s3_read_and_write_arn
|
policy_arn = data.terraform_remote_state.shared.outputs.hubspot_etl_s3_read_and_write_arn
|
||||||
|
}
|
||||||
|
|
||||||
|
# Create and attach S3 send policy for PasHub Fetcher queue
|
||||||
|
module "hubspot_deal_etl_sqs_policy" {
|
||||||
|
source = "../../modules/general_iam_policy"
|
||||||
|
|
||||||
|
policy_name = "hubspot-deal-etl-sqs-send-${var.stage}"
|
||||||
|
policy_description = "Allow Hubspot ETL Lambda to send messages to PasHub Fetcher queue"
|
||||||
|
|
||||||
|
actions = [
|
||||||
|
"sqs:SendMessage"
|
||||||
|
]
|
||||||
|
|
||||||
|
resources = [
|
||||||
|
data.terraform_remote_state.pashub_to_ara.outputs.pashub_to_ara_queue_arn
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "aws_iam_role_policy_attachment" "hubspot_deal_etl_sqs_send" {
|
||||||
|
role = module.hubspot_deal_etl.role_name
|
||||||
|
policy_arn = module.hubspot_deal_etl_sqs_policy.policy_arn
|
||||||
}
|
}
|
||||||
|
|
@ -2,3 +2,8 @@ output "pashub_to_ara_queue_url" {
|
||||||
value = module.lambda.queue_url
|
value = module.lambda.queue_url
|
||||||
description = "URL of the PasHub to Ara SQS queue"
|
description = "URL of the PasHub to Ara SQS queue"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
output "pashub_to_ara_queue_arn" {
|
||||||
|
value = module.lambda.queue_arn
|
||||||
|
description = "ARN of the PasHub to Ara SQS queue"
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue