Skip to content

Commit

Permalink
Merge pull request #882 from DemocracyClub/restore-management-function
Browse files Browse the repository at this point in the history
Restore management function, remove event
  • Loading branch information
symroe authored Oct 25, 2024
2 parents 19f6642 + cf3ddd9 commit 27285c6
Showing 1 changed file with 25 additions and 34 deletions.
59 changes: 25 additions & 34 deletions sam-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -129,40 +129,31 @@ Resources:
Method: ANY


# Add this back in if we have any management commands that we want to run on a cron
# DCWebsiteManagementFunction:
# Type: AWS::Serverless::Function
# Properties:
# FunctionName: DCWebsiteManagementFunction
# Timeout: 60
# Role: !Sub "arn:aws:iam::${AWS::AccountId}:role/DCWebsiteLambdaExecutionRole"
# CodeUri: .
# Handler: democracy_club.lambda_awsgi.management_handler
# Layers:
# - !Ref DependenciesLayer
# Runtime: python3.8
# MemorySize: 512
# Environment:
# Variables:
# SECRET_KEY: !Ref AppSecretKey
# SENTRY_DSN: !Ref AppSentryDSN
# DJANGO_SETTINGS_MODULE: !Ref AppDjangoSettingsModule
# APP_IS_BEHIND_CLOUDFRONT: !Ref AppIsBehindCloudFront
# GIT_HASH: !Ref GitHash
# DATABASE_HOST: !Ref AppPostgresHost
# POSTGRES_DATABASE_NAME: !Ref AppPostgresDatabaseName
# DATABASE_PASS: !Ref AppPostgresPassword
# FQDN: !Ref FQDN
# STORAGE_BUCKET_NAME: !Ref AppStorageBucketName
# SENDGRID_API_KEY: !Ref AppSendgridAPIKey
# Events:
# SyncToSendgrid:
# Type: Schedule
# Properties:
# Schedule: rate(1 day)
# Name: sync_to_sendgrid
# Description: Sync emails to sendgrid
# Input: '{"command": "sync_to_sendgrid"}'
DCWebsiteManagementFunction:
Type: AWS::Serverless::Function
Properties:
FunctionName: DCWebsiteManagementFunction
Timeout: 60
Role: !Sub "arn:aws:iam::${AWS::AccountId}:role/DCWebsiteLambdaExecutionRole"
CodeUri: .
Handler: democracy_club.lambda_awsgi.management_handler
Layers:
- !Ref DependenciesLayer
Runtime: python3.12
MemorySize: 512
Environment:
Variables:
SECRET_KEY: !Ref AppSecretKey
SENTRY_DSN: !Ref AppSentryDSN
DJANGO_SETTINGS_MODULE: !Ref AppDjangoSettingsModule
APP_IS_BEHIND_CLOUDFRONT: !Ref AppIsBehindCloudFront
GIT_HASH: !Ref GitHash
DATABASE_HOST: !Ref AppPostgresHost
POSTGRES_DATABASE_NAME: !Ref AppPostgresDatabaseName
DATABASE_PASS: !Ref AppPostgresPassword
FQDN: !Ref FQDN
STORAGE_BUCKET_NAME: !Ref AppStorageBucketName
DC_ENVIRONMENT: !Ref DCEnvironment


DCWebsiteFunctionLogGroup:
Expand Down

0 comments on commit 27285c6

Please sign in to comment.