Skip to content

Commit

Permalink
Move all the lambda fuctions to resources
Browse files Browse the repository at this point in the history
  • Loading branch information
raykrueger committed Mar 23, 2023
1 parent 132e783 commit 6a1dcee
Show file tree
Hide file tree
Showing 12 changed files with 42 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/auto_shutdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class AutoShutdown extends Construct {

this.topic = new Topic(this, 'AutoShutdownTopic');

const code = Code.fromAsset(path.join(__dirname, 'functions/autoshutdown'));
const code = Code.fromAsset(path.join(__dirname, '../resources/functions/autoshutdown'));

this.function = this.buildShutdownFunction(code);
this.topic.addSubscription(new LambdaSubscription(this.function));
Expand Down
2 changes: 1 addition & 1 deletion src/discord-state-machine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class DiscordStateMachine extends Construct {
super(scope, id);

const f = new Function(this, 'DiscordResponse', {
code: Code.fromAsset(path.join(__dirname, 'functions/discord'), {
code: Code.fromAsset(path.join(__dirname, '../resources/functions/discord'), {
bundling: {
image: Runtime.PYTHON_3_9.bundlingImage,
command: [
Expand Down
2 changes: 1 addition & 1 deletion src/discord.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class DiscordBotConstruct extends Construct {

const f = new Function(this, 'DiscordBotFunction', {
runtime: Runtime.PYTHON_3_9,
code: Code.fromAsset(path.join(__dirname, 'functions/discord'), {
code: Code.fromAsset(path.join(__dirname, '../resources/functions/discord'), {
bundling: {
image: Runtime.PYTHON_3_9.bundlingImage,
command: [
Expand Down
4 changes: 2 additions & 2 deletions src/discord_bot_custom_resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ export class DiscordBotCustomResource extends Construct {

//This 'version' concept is to force an update to the custom resource if we change the event handler function
const hash = crypto.createHash('sha256');
const body = fs.readFileSync(path.join(__dirname, 'functions/discord_provider/discord_provider.py'), 'utf8');
const body = fs.readFileSync(path.join(__dirname, '../resources/functions/discord_provider/discord_provider.py'), 'utf8');
const version = hash.update(body).digest('hex');

const commandName = props.commandName;

const secret = props.secret;

const code = Code.fromAsset(path.join(__dirname, 'functions/discord_provider'), {
const code = Code.fromAsset(path.join(__dirname, '../resources/functions/discord_provider'), {
bundling: {
image: Runtime.PYTHON_3_9.bundlingImage,
command: [
Expand Down
38 changes: 36 additions & 2 deletions yarn.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6a1dcee

Please sign in to comment.