diff --git a/.github/depoyment-docs/CREATION_DEMO.md b/.github/depoyment-docs/CREATION_DEMO.md deleted file mode 100644 index 5bccd17..0000000 --- a/.github/depoyment-docs/CREATION_DEMO.md +++ /dev/null @@ -1,19 +0,0 @@ -## Demo - -1. Create a bucket if needed: `.my-template-cfn` - -- ![](./screenshots/create-bucket.png) -- ![](./screenshots/add-s3-permission.png) -- ![](./screenshots/publish-new-bucket.png) - -2. Update the `config.sh` settings before running scripts - -- ![](./screenshots/update-config.png) - -3. Sync the s3 buckets to verify existence - -- ![](./screenshots/run-scriptSync.png) - -4. Upload files one by one, with deploy script - -- ![](./screenshots/run-scriptDeploy.png) \ No newline at end of file diff --git a/.github/depoyment-docs/DEPLOYMENT_CONTEXT.md b/.github/depoyment-docs/DEPLOYMENT_CONTEXT.md deleted file mode 100644 index 87a46cf..0000000 --- a/.github/depoyment-docs/DEPLOYMENT_CONTEXT.md +++ /dev/null @@ -1,110 +0,0 @@ -## Deployment Context - -For [ui-examples](https://github.com/amazon-connect/amazon-connect-chat-ui-examples), we display "Launch stack" buttons for every cloudFormation example. - -There are eight s3 buckets, one in each supported region, for each example. - -Each have the following file structure: - -``` -- - |_ cloudformation.yml - |_ deployment/ - |_ lambda code - |_ SDK code -``` - -Each file must be replaced, and permissions set to public. - -This script will speed up the process to upload files quickly. - -## Current Buckets - -### [`startChatContactAPI`](https://github.com/amazon-connect/amazon-connect-chat-ui-examples/tree/master/cloudformationTemplates/startChatContactAPI) - -``` -- startChatContactAPI - |_ cloudformation.yml - |_ deployment/ - |_ ChatSDK.zip - |_ start-chat-contact.zip -``` - -Deployed to the following s3 buckets: - -- `ap-northeast-1.start-chat-contact-api-cfn` Asia Pacific (Tokyo) ap-northeast-1 -- `ap-southeast-1.start-chat-contact-api-cfn` Asia Pacific (Singapore) ap-southeast-1 -- `ap-southeast-2.start-chat-contact-api-cfn` Asia Pacific (Sydney) ap-southeast-2 -- `ca-central-1.start-chat-contact-api-cfn` Canada (Central) ca-central-1 -- `eu-central-1.start-chat-contact-api-cfn` EU (Frankfurt) eu-central-1 -- `eu-west-2.start-chat-contact-api-cfn` EU (London) eu-west-2 -- `us-east-1.start-chat-contact-api-cfn` US East (N. Virginia) us-east-1 -- `us-west-2.start-chat-contact-api-cfn` US West (Oregon) us-west-2 - -### [`urlPreviewForAsyncChat`](https://github.com/amazon-connect/amazon-connect-chat-ui-examples/tree/master/cloudformationTemplates/urlPreviewForAsyncChat) - -``` -- urlPreviewForAsyncChat - |_ cloudformation.yaml - |_ deployment/ - |_ contact-flows/ - |_ Basic Chat Disconnect Flow - |_ contact-flows - |_ Basic-Chat - |_ css/ - |_ styles.css - |_ js/ - |_ amazon-connect-chat-interface.js - |_ ChatSDK.zip - |_ create-website.zip - |_ custom-resource-helper.zip - |_ favicon.ico - |_ s3-notification-lambda.zip - |_ start-chat-contact.zip - |_ update-chat-dbb - |_ urlPreviewFunction.zip - |_ urlPreviewLayer.zip -``` - -Deployed to the following s3 buckets: - -- `ap-northeast-1.amazon-connect-url-preview-for-async-chat-cfn` Asia Pacific (Tokyo) ap-northeast-1 -- `ap-southeast-1.amazon-connect-url-preview-for-async-chat-cfn` Asia Pacific (Singapore) ap-southeast-1 -- `ap-southeast-2.amazon-connect-url-preview-for-async-chat-cfn` Asia Pacific (Sydney) ap-southeast-2 -- `ca-central-1.amazon-connect-url-preview-for-async-chat-cfn` Canada (Central) ca-central-1 -- `eu-central-1.amazon-connect-url-preview-for-async-chat-cfn` EU (Frankfurt) eu-central-1 -- `eu-west-2.amazon-connect-url-preview-for-async-chat-cfn` EU (London) eu-west-2 -- `us-east-1.amazon-connect-url-preview-for-async-chat-cfn` US East (N. Virginia) us-east-1 -- `us-west-2.amazon-connect-url-preview-for-async-chat-cfn` US West (Oregon) us-west-2 - - \ No newline at end of file diff --git a/.github/depoyment-docs/README.md b/.github/depoyment-docs/README.md deleted file mode 100644 index c2d717c..0000000 --- a/.github/depoyment-docs/README.md +++ /dev/null @@ -1,10 +0,0 @@ -# UI Examples CFN S3 Documentation - -- Need to update the S3 buckets?, follow steps listed in [`USAGE.md`](./USAGE.md) -- Need to create new S3 bucket? Find steps in [`CREATION_DEMO.md`](./CREATION_DEMO.md) -- Why do we update s3 buckets? Read [`DEPLOYMENT_CONTEXT.md`](./DEPLOYMENT_CONTEXT.md) - -## Reference - -- Quip: https://quip-amazon.com/4zxjAXyttjeI -- Repo: https://github.com/amazon-connect/amazon-connect-chat-ui-examples \ No newline at end of file diff --git a/.github/depoyment-docs/USAGE.md b/.github/depoyment-docs/USAGE.md deleted file mode 100644 index fb7050e..0000000 --- a/.github/depoyment-docs/USAGE.md +++ /dev/null @@ -1,97 +0,0 @@ -# Script Usage - -Script to interactivly upload/mirror ui-example files to all s3 buckets. This avoids tedious drag n drop in AWS console, including manual public access permission change. - -Deploy to all eight regions at once, one example at a time. - -## Reference - -- Setup: `aws-cli/2.8.9 Python/3.9.11 Darwin/21.6.0 exe/x86_64 prompt/off` -- Quip: https://quip-amazon.com/4zxjAXyttjeI/Steps-for-github-ui-example-package-S3-bucket-files-update -- Repo: https://github.com/amazon-connect/amazon-connect-chat-ui-examples - -## Usage - -0. Mirror the s3 bucket in a local folder, for example: - -``` -- startChatContactAPI/ - |_ cloudformation.yml - |_ deployment/ - |_ ChatSDK.zip - |_ start-chat-contact.zip -- syncScript.sh -- deployScript.sh -``` - -1. Update `config.sh` file - -First, we point the account that owns the ui-examples s3 bucket. - -```diff -+ export ACCOUNT_ID="" -+ export CONSOLE_ROLE_NAME="" -``` - -2. Update `config.sh` file, pointing to the newer local file(s) - -Then, we choose one ui-example to update, and specify the files to upload: - -```bash -# ... -# Update all regions back to back? -export REGIONS_TO_UPDATE=( - "us-west-2" - "us-east-1" - "ap-southeast-2" - "ap-northeast-1" - "eu-central-1" - "eu-west-2" - "ap-southeast-1" - "ca-central-1" -) - -# startChatContactAPI -export LOCAL_BUCKET_FOLDER="startChatContactAPI" -export BUCKET_TO_UPDATE="start-chat-contact-api-cfn" -export FILES_TO_UPLOAD=( - # "cloudformation.yaml" - # "deployment/ChatSDK.zip" - # "deployment/custom-resource-helper.zip" - "deployment/start-chat-contact.zip" # UPDATE JUST ME -) -``` - -3. Run `syncScript.sh` to test S3 bucket access (READ-ONLY) - -This script will authenticate with the account, and verify all expected buckets are present. - -```sh -sudo chmod +x ./syncScript.sh -./syncScript.sh -``` - -4. Run `deployScript.sh` for interactive deployment to S3 (MODIFYING) - -This script will prompt `upload/ignore` for each file, and replaces existing in the s3 upon upload - -```sh -sudo chmod +x ./deployScript.sh -./deployScript.sh -``` - -5. Repeat steps 2 through 4, for each ui-example - -Map to a different local/remote folder for the next example - -```bash -export LOCAL_BUCKET_FOLDER="otherExampleFolderName" -export BUCKET_TO_UPDATE="other-cfn-example-s3-key" -export FILES_TO_UPLOAD=( - # "cloudformation.yaml" - "deployment/ChatSDK.zip" - # "deployment/custom-resource-helper.zip" - # "deployment/start-chat-contact.zip" -) -``` - diff --git a/.github/depoyment-docs/screenshots/add-s3-permission.png b/.github/depoyment-docs/screenshots/add-s3-permission.png deleted file mode 100644 index cbbb756..0000000 Binary files a/.github/depoyment-docs/screenshots/add-s3-permission.png and /dev/null differ diff --git a/.github/depoyment-docs/screenshots/create-bucket.png b/.github/depoyment-docs/screenshots/create-bucket.png deleted file mode 100644 index f3948b6..0000000 Binary files a/.github/depoyment-docs/screenshots/create-bucket.png and /dev/null differ diff --git a/.github/depoyment-docs/screenshots/publish-new-bucket.png b/.github/depoyment-docs/screenshots/publish-new-bucket.png deleted file mode 100644 index a72d1dd..0000000 Binary files a/.github/depoyment-docs/screenshots/publish-new-bucket.png and /dev/null differ diff --git a/.github/depoyment-docs/screenshots/run-scriptDeploy.png b/.github/depoyment-docs/screenshots/run-scriptDeploy.png deleted file mode 100644 index 25bafec..0000000 Binary files a/.github/depoyment-docs/screenshots/run-scriptDeploy.png and /dev/null differ diff --git a/.github/depoyment-docs/screenshots/run-scriptSync.png b/.github/depoyment-docs/screenshots/run-scriptSync.png deleted file mode 100644 index 05325d9..0000000 Binary files a/.github/depoyment-docs/screenshots/run-scriptSync.png and /dev/null differ diff --git a/.github/depoyment-docs/screenshots/update-config.png b/.github/depoyment-docs/screenshots/update-config.png deleted file mode 100644 index 47c709a..0000000 Binary files a/.github/depoyment-docs/screenshots/update-config.png and /dev/null differ diff --git a/.github/docs/cfn-template-deployment/README.md b/.github/docs/cfn-template-deployment/README.md new file mode 100644 index 0000000..e4a7dfb --- /dev/null +++ b/.github/docs/cfn-template-deployment/README.md @@ -0,0 +1,92 @@ +# Updating the CloudFormation Template Assets + +## Prerequisites + +- Gain access to the AWS Account (`533267401313`), follow the steps listed in [this Quip](https://quip-amazon.com/4zxjAXyttjeI) +- Install [AWS CLI (v2)](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html) + +## Deployment + +Follow these instructions to update the S3 assets. A local folder will be mirrored to the S3 bucket, and set to public + +1. Create a local folder named in `startChatContactAPI` or `urlPreviewForAsync` (in the same directory as `deploymentScript.sh`) + +2. Update `config.sh` file, pointing to the desired account and S3 bucket + +```diff ++ export ACCOUNT_ID="" ++ export CONSOLE_ROLE_NAME="" + +- export LOCAL_BUCKET_FOLDER="" ++ export LOCAL_BUCKET_FOLDER="startChatContactAPI" + export BUCKET_TO_UPDATE="start-chat-contact-api-cfn" ++ export FILES_TO_UPLOAD=( + # "cloudformation.yaml" + # "deployment/ChatSDK.zip" + # "deployment/custom-resource-helper.zip" ++ "deployment/start-chat-contact.zip" # UPDATE one at a time + ) + + export REGIONS_TO_UPDATE=( + "us-west-2" + "us-east-1" + "ap-southeast-2" + "ap-northeast-1" + "eu-central-1" + "eu-west-2" + "ap-southeast-1" + "ca-central-1" + "ap-northeast-2" + # "af-south-1" # TODO + ) +``` + +3. Run `syncScript.sh` to make sure you have WRITE access to the buckets + +```sh +sudo chmod +x ./syncScript.sh +./syncScript.sh +``` + +4. Run `deployScript.sh` to upload the desired files! + +```sh +sudo chmod +x ./deployScript.sh +./deployScript.sh +``` + +## `startChatContactAPI` S3 Assets + +- Bucket name: `..start-chat-contact-proxy-cfn` +- Source: [startChatContactAPI](https://github.com/amazon-connect/amazon-connect-chat-ui-examples/tree/master/cloudformationTemplates/startChatContactAPI) + +``` +cloudformation.yaml +deployment/ + - ChatSDK.zip + - custom-resource-helper.zip + - start-chat-contact.zip +``` + +## `urlPreviewForAsync` S3 Assets + +- Bucket name: `.amazon-connect-url-preview-cfn` +- Source: [urlPreviewForAsyncChat](https://github.com/amazon-connect/amazon-connect-chat-ui-examples/tree/master/cloudformationTemplates/urlPreviewForAsyncChat) + +``` +cloudformation.yaml +deployment/ + - contact-flows/Basic Chat Disconnect Flow + - contact-flows/Basic-Chat + - css/styles.css + - js/amazon-connect-chat-interface.js + - ChatSDK.zip + - create-website.zip + - custom-resource-helper.zip + - favicon.ico + - s3-notification-lambda.zip + - start-chat-contact.zip + - update-chat-ddb + - urlPreviewFunction.zip + - urlPreviewLayer.zip +``` \ No newline at end of file diff --git a/.github/depoyment-docs/colors.sh b/.github/docs/cfn-template-deployment/colors.sh similarity index 100% rename from .github/depoyment-docs/colors.sh rename to .github/docs/cfn-template-deployment/colors.sh diff --git a/.github/depoyment-docs/config.sh b/.github/docs/cfn-template-deployment/config.sh similarity index 80% rename from .github/depoyment-docs/config.sh rename to .github/docs/cfn-template-deployment/config.sh index 3d7e5cb..1f35fbb 100644 --- a/.github/depoyment-docs/config.sh +++ b/.github/docs/cfn-template-deployment/config.sh @@ -1,7 +1,7 @@ export SKIP_AUTHENTICATE="false" # default: false export ACCOUNT_ID="" -export CONSOLE_ROLE_NAME="" +export CONSOLE_ROLE_NAME="" # Admin export REGIONS_TO_UPDATE=( "us-west-2" @@ -12,11 +12,13 @@ export REGIONS_TO_UPDATE=( "eu-west-2" "ap-southeast-1" "ca-central-1" + "ap-northeast-2" + # "af-south-1" # TODO ) # startChatContactAPI export LOCAL_BUCKET_FOLDER="startChatContactAPI" -export BUCKET_TO_UPDATE="start-chat-contact-api-cfn" +export BUCKET_TO_UPDATE="start-chat-contact-proxy-cfn" export FILES_TO_UPLOAD=( # "cloudformation.yaml" # "deployment/ChatSDK.zip" @@ -26,12 +28,12 @@ export FILES_TO_UPLOAD=( # urlPreviewForAsyncChat # export LOCAL_BUCKET_FOLDER="urlPreviewForAsyncChat" -# export BUCKET_TO_UPDATE="amazon-connect-advanced-customer-chat-cfn" +# export BUCKET_TO_UPDATE="amazon-connect-url-preview-cfn" # export FILES_TO_UPLOAD=( # "cloudformation.yaml" # "deployment/contact-flows/Basic Chat Disconnect Flow" # "deployment/contact-flows/Basic-Chat" -# "deployment/css/styles.css" +# "deployment/css/style.css" # "deployment/js/amazon-connect-chat-interface.js" # "deployment/ChatSDK.zip" # "deployment/create-website.zip" @@ -39,7 +41,7 @@ export FILES_TO_UPLOAD=( # "deployment/favicon.ico" # "deployment/s3-notification-lambda.zip" # "deployment/start-chat-contact.zip" -# "deployment/update-chat-dbb" +# "deployment/update-chat-ddb" # "deployment/urlPreviewFunction.zip" # "deployment/urlPreviewLayer.zip" # ) \ No newline at end of file diff --git a/.github/depoyment-docs/deployScript.sh b/.github/docs/cfn-template-deployment/deployScript.sh similarity index 100% rename from .github/depoyment-docs/deployScript.sh rename to .github/docs/cfn-template-deployment/deployScript.sh diff --git a/.github/depoyment-docs/syncScript.sh b/.github/docs/cfn-template-deployment/syncScript.sh similarity index 100% rename from .github/depoyment-docs/syncScript.sh rename to .github/docs/cfn-template-deployment/syncScript.sh