From 83e0fc81d412b9999f30461d25f1b3cbb3494dbf Mon Sep 17 00:00:00 2001 From: rstrahan Date: Fri, 1 Dec 2023 12:57:45 +0000 Subject: [PATCH 01/19] minor README clarification --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 30c62e3..da37dc1 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,8 @@ You need to have the following packages installed on your computer to build and 6. aws (AWS CLI): https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html 7. cdk (AWS CDK): https://docs.aws.amazon.com/cdk/v2/guide/cli.html +You also need to have an existing, working Amazon Q application. If you haven't set one up yet, see [Creating an Amazon Q application](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/create-app.html) + ### 2. Initialize and deploy the stack Copy the GitHub repo to your computer. Either: @@ -54,10 +56,9 @@ Copy the GitHub repo to your computer. Either: Navigate into the project root directory and, in a bash shell, run: -1. `./init.sh` - checks your system dependendencies for required packages (see Dependencies above), sets up your environment file, and bootstraps your cdk environment. +1. `./init.sh` - checks your system dependendencies for required packages (see Dependencies above), sets up your environment file, and bootstraps your cdk environment. 2. `./deploy.sh` - runs the cdk build and deploys or updates a stack in your AWS account, creates a slack app manifest file, and outputs a link to the AWS Secrets Manager secret that you will need below. - ### 3. Configure your Slack application #### 3.2 Create your app From c70d0a1a90e6fb70fe084d140301e4401efc33a4 Mon Sep 17 00:00:00 2001 From: rstrahan Date: Sun, 3 Dec 2023 20:14:24 +0000 Subject: [PATCH 02/19] Refactor cdk app resource naming (breaking change). Add new publish.sh to create and publish template in S3 (doesn't need commandline to deploy --- bin/convert-cfn-template.js | 226 ++ lib/my-amazon-q-slack-bot-stack.ts | 18 +- package-lock.json | 3693 +++++++++++++++++++++------- package.json | 8 +- 4 files changed, 3047 insertions(+), 898 deletions(-) create mode 100644 bin/convert-cfn-template.js diff --git a/bin/convert-cfn-template.js b/bin/convert-cfn-template.js new file mode 100644 index 0000000..d7d0d7f --- /dev/null +++ b/bin/convert-cfn-template.js @@ -0,0 +1,226 @@ +const { S3Client, PutObjectCommand } = require("@aws-sdk/client-s3"); +const fs = require('fs'); +const path = require('path'); +const JSZip = require('jszip'); + +// Read command line arguments +const templateName = process.argv[2]; +const destinationBucket = process.argv[3]; +const destinationPrefix = process.argv[4]; +const awsRegion = process.argv[5]; +if (!templateName || !destinationBucket || !destinationPrefix || !awsRegion) { + console.error("Error: All arguments must be provided."); + console.error("Usage: