Skip to content

Commit

Permalink
fix: lambda zip shuold be created from code ci
Browse files Browse the repository at this point in the history
  • Loading branch information
notdodo committed Oct 13, 2024
1 parent 806ac29 commit 78d561d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
11 changes: 4 additions & 7 deletions pulumi/__main__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""An AWS Python Pulumi program"""

import pulumi
import pulumi_cloudflare
from lambda_utils import create_lambda_layer, create_lambda_zip
from pulumi_aws import (
apigatewayv2,
cloudwatch,
Expand All @@ -12,9 +12,9 @@
scheduler,
secretsmanager,
)
from telegram_provider import Webhook

import pulumi
from lambda_utils import create_lambda_layer
from telegram_provider import Webhook

RESOURCES_PREFIX = "erfiume"
SYNC_MINUTES_RATE_NORMAL = 24 * 60 # Once a day
Expand Down Expand Up @@ -158,14 +158,12 @@
)

lambda_layer = create_lambda_layer(RESOURCES_PREFIX)
lambda_zip = create_lambda_zip(RESOURCES_PREFIX)
fetcher_lambda = lambda_.Function(
f"{RESOURCES_PREFIX}-fetcher",
code=pulumi.FileArchive("./dummy.zip"),
name=f"{RESOURCES_PREFIX}-fetcher",
role=fetcher_role.arn,
handler="bootstrap",
# source_code_hash=lambda_zip.zip_sha256,
runtime=lambda_.Runtime.CUSTOM_AL2023,
environment={
"variables": {
Expand All @@ -179,11 +177,10 @@

bot_lambda = lambda_.Function(
f"{RESOURCES_PREFIX}-bot",
code=lambda_zip.zip_path,
code=pulumi.FileArchive("./dummy.zip"),
name=f"{RESOURCES_PREFIX}-bot",
role=bot_role.arn,
handler="erfiume_bot.handler",
source_code_hash=lambda_zip.zip_sha256,
layers=[lambda_layer.arn],
runtime=lambda_.Runtime.PYTHON3D12,
environment={
Expand Down
3 changes: 1 addition & 2 deletions pulumi/lambda_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@

from dataclasses import dataclass

import pulumi
import pulumi_aws as aws
from pulumi_command import local

import pulumi


@dataclass
class LambdaZip:
Expand Down

0 comments on commit 78d561d

Please sign in to comment.