├── .eslintrc.json ├── .gitattributes ├── .github ├── PULL_REQUEST_TEMPLATE.md ├── dependabot.yml ├── pull_request_template.md └── workflows │ ├── auto-approve.yml │ ├── build.yml │ ├── pull-request-lint.yml │ ├── upgrade-site.yml │ └── upgrade.yml ├── .gitignore ├── .mergify.yml ├── .npmignore ├── .projen ├── deps.json ├── files.json └── tasks.json ├── .projenrc.ts ├── LICENSE ├── README.md ├── cdk.json ├── images ├── AmazonChimeSDKLiveConnector.png ├── JoinMeeting.png ├── StartStream.png └── ViewStream.png ├── package.json ├── site ├── .babelrc ├── .eslintrc.js ├── .gitignore ├── .prettierrc.js ├── README.md ├── package.json ├── public │ ├── config.json │ ├── index.html │ └── robots.txt ├── src │ ├── App.css │ ├── App.js │ ├── Config.js │ ├── index.css │ └── index.js ├── webpack.config.js └── yarn.lock ├── src ├── amazon-chime-sdk-meeting-with-live-connector.ts ├── index.ts ├── infrastructure.ts ├── resources │ └── meetingInfo │ │ └── meetingInfo.ts └── site.ts ├── test ├── __snapshots__ │ └── main.test.ts.snap └── main.test.ts ├── tsconfig.dev.json ├── tsconfig.json └── yarn.lock /.eslintrc.json: -------------------------------------------------------------------------------- 1 | // ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". 2 | { 3 | "env": { 4 | "jest": true, 5 | "node": true 6 | }, 7 | "root": true, 8 | "plugins": [ 9 | "@typescript-eslint", 10 | "import" 11 | ], 12 | "parser": "@typescript-eslint/parser", 13 | "parserOptions": { 14 | "ecmaVersion": 2018, 15 | "sourceType": "module", 16 | "project": "./tsconfig.dev.json" 17 | }, 18 | "extends": [ 19 | "plugin:import/typescript" 20 | ], 21 | "settings": { 22 | "import/parsers": { 23 | "@typescript-eslint/parser": [ 24 | ".ts", 25 | ".tsx" 26 | ] 27 | }, 28 | "import/resolver": { 29 | "node": {}, 30 | "typescript": { 31 | "project": "./tsconfig.dev.json", 32 | "alwaysTryTypes": true 33 | } 34 | } 35 | }, 36 | "ignorePatterns": [ 37 | "*.js", 38 | "*.d.ts", 39 | "node_modules/", 40 | "*.generated.ts", 41 | "coverage", 42 | "!.projenrc.ts", 43 | "!projenrc/**/*.ts" 44 | ], 45 | "rules": { 46 | "indent": [ 47 | "off" 48 | ], 49 | "@typescript-eslint/indent": [ 50 | "error", 51 | 2 52 | ], 53 | "quotes": [ 54 | "error", 55 | "single", 56 | { 57 | "avoidEscape": true 58 | } 59 | ], 60 | "comma-dangle": [ 61 | "error", 62 | "always-multiline" 63 | ], 64 | "comma-spacing": [ 65 | "error", 66 | { 67 | "before": false, 68 | "after": true 69 | } 70 | ], 71 | "no-multi-spaces": [ 72 | "error", 73 | { 74 | "ignoreEOLComments": false 75 | } 76 | ], 77 | "array-bracket-spacing": [ 78 | "error", 79 | "never" 80 | ], 81 | "array-bracket-newline": [ 82 | "error", 83 | "consistent" 84 | ], 85 | "object-curly-spacing": [ 86 | "error", 87 | "always" 88 | ], 89 | "object-curly-newline": [ 90 | "error", 91 | { 92 | "multiline": true, 93 | "consistent": true 94 | } 95 | ], 96 | "object-property-newline": [ 97 | "error", 98 | { 99 | "allowAllPropertiesOnSameLine": true 100 | } 101 | ], 102 | "keyword-spacing": [ 103 | "error" 104 | ], 105 | "brace-style": [ 106 | "error", 107 | "1tbs", 108 | { 109 | "allowSingleLine": true 110 | } 111 | ], 112 | "space-before-blocks": [ 113 | "error" 114 | ], 115 | "curly": [ 116 | "error", 117 | "multi-line", 118 | "consistent" 119 | ], 120 | "@typescript-eslint/member-delimiter-style": [ 121 | "error" 122 | ], 123 | "semi": [ 124 | "error", 125 | "always" 126 | ], 127 | "max-len": [ 128 | "error", 129 | { 130 | "code": 150, 131 | "ignoreUrls": true, 132 | "ignoreStrings": true, 133 | "ignoreTemplateLiterals": true, 134 | "ignoreComments": true, 135 | "ignoreRegExpLiterals": true 136 | } 137 | ], 138 | "quote-props": [ 139 | "error", 140 | "consistent-as-needed" 141 | ], 142 | "@typescript-eslint/no-require-imports": [ 143 | "error" 144 | ], 145 | "import/no-extraneous-dependencies": [ 146 | "error", 147 | { 148 | "devDependencies": [ 149 | "**/test/**", 150 | "**/build-tools/**", 151 | ".projenrc.ts", 152 | "projenrc/**/*.ts" 153 | ], 154 | "optionalDependencies": false, 155 | "peerDependencies": true 156 | } 157 | ], 158 | "import/no-unresolved": [ 159 | "error" 160 | ], 161 | "import/order": [ 162 | "warn", 163 | { 164 | "groups": [ 165 | "builtin", 166 | "external" 167 | ], 168 | "alphabetize": { 169 | "order": "asc", 170 | "caseInsensitive": true 171 | } 172 | } 173 | ], 174 | "no-duplicate-imports": [ 175 | "error" 176 | ], 177 | "no-shadow": [ 178 | "off" 179 | ], 180 | "@typescript-eslint/no-shadow": [ 181 | "error" 182 | ], 183 | "key-spacing": [ 184 | "error" 185 | ], 186 | "no-multiple-empty-lines": [ 187 | "error" 188 | ], 189 | "@typescript-eslint/no-floating-promises": [ 190 | "error" 191 | ], 192 | "no-return-await": [ 193 | "off" 194 | ], 195 | "@typescript-eslint/return-await": [ 196 | "error" 197 | ], 198 | "no-trailing-spaces": [ 199 | "error" 200 | ], 201 | "dot-notation": [ 202 | "error" 203 | ], 204 | "no-bitwise": [ 205 | "error" 206 | ], 207 | "@typescript-eslint/member-ordering": [ 208 | "error", 209 | { 210 | "default": [ 211 | "public-static-field", 212 | "public-static-method", 213 | "protected-static-field", 214 | "protected-static-method", 215 | "private-static-field", 216 | "private-static-method", 217 | "field", 218 | "constructor", 219 | "method" 220 | ] 221 | } 222 | ] 223 | }, 224 | "overrides": [ 225 | { 226 | "files": [ 227 | ".projenrc.ts" 228 | ], 229 | "rules": { 230 | "@typescript-eslint/no-require-imports": "off", 231 | "import/no-extraneous-dependencies": "off" 232 | } 233 | } 234 | ] 235 | } 236 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". 2 | 3 | *.snap linguist-generated 4 | /.eslintrc.json linguist-generated 5 | /.gitattributes linguist-generated 6 | /.github/pull_request_template.md linguist-generated 7 | /.github/workflows/auto-approve.yml linguist-generated 8 | /.github/workflows/build.yml linguist-generated 9 | /.github/workflows/pull-request-lint.yml linguist-generated 10 | /.github/workflows/upgrade-site.yml linguist-generated 11 | /.github/workflows/upgrade.yml linguist-generated 12 | /.gitignore linguist-generated 13 | /.mergify.yml linguist-generated 14 | /.npmignore linguist-generated 15 | /.projen/** linguist-generated 16 | /.projen/deps.json linguist-generated 17 | /.projen/files.json linguist-generated 18 | /.projen/tasks.json linguist-generated 19 | /cdk.json linguist-generated 20 | /LICENSE linguist-generated 21 | /package.json linguist-generated 22 | /tsconfig.dev.json linguist-generated 23 | /tsconfig.json linguist-generated 24 | /yarn.lock linguist-generated -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | Fixes # -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 5 | 6 | version: 2 7 | updates: 8 | - package-ecosystem: yarn 9 | directory: "/" # Location of package manifests 10 | schedule: 11 | interval: "weekly" 12 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | Fixes # -------------------------------------------------------------------------------- /.github/workflows/auto-approve.yml: -------------------------------------------------------------------------------- 1 | # ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". 2 | 3 | name: auto-approve 4 | on: 5 | pull_request_target: 6 | types: 7 | - labeled 8 | - opened 9 | - synchronize 10 | - reopened 11 | - ready_for_review 12 | jobs: 13 | approve: 14 | runs-on: ubuntu-latest 15 | permissions: 16 | pull-requests: write 17 | if: contains(github.event.pull_request.labels.*.name, 'auto-approve') && (github.event.pull_request.user.login == 'schuettc') 18 | steps: 19 | - uses: hmarr/auto-approve-action@v2.2.1 20 | with: 21 | github-token: ${{ secrets.GITHUB_TOKEN }} 22 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | # ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". 2 | 3 | name: build 4 | on: 5 | pull_request: {} 6 | workflow_dispatch: {} 7 | jobs: 8 | build: 9 | runs-on: ubuntu-latest 10 | permissions: 11 | contents: write 12 | outputs: 13 | self_mutation_happened: ${{ steps.self_mutation.outputs.self_mutation_happened }} 14 | env: 15 | CI: "true" 16 | steps: 17 | - name: Checkout 18 | uses: actions/checkout@v4 19 | with: 20 | ref: ${{ github.event.pull_request.head.ref }} 21 | repository: ${{ github.event.pull_request.head.repo.full_name }} 22 | - name: Setup Node.js 23 | uses: actions/setup-node@v4 24 | with: 25 | node-version: 16.x 26 | - name: Install dependencies 27 | run: yarn install --check-files 28 | - name: build 29 | run: npx projen build 30 | - name: Find mutations 31 | id: self_mutation 32 | run: |- 33 | git add . 34 | git diff --staged --patch --exit-code > .repo.patch || echo "self_mutation_happened=true" >> $GITHUB_OUTPUT 35 | working-directory: ./ 36 | - name: Upload patch 37 | if: steps.self_mutation.outputs.self_mutation_happened 38 | uses: actions/upload-artifact@v4 39 | with: 40 | name: .repo.patch 41 | path: .repo.patch 42 | overwrite: true 43 | - name: Fail build on mutation 44 | if: steps.self_mutation.outputs.self_mutation_happened 45 | run: |- 46 | echo "::error::Files were changed during build (see build log). If this was triggered from a fork, you will need to update your branch." 47 | cat .repo.patch 48 | exit 1 49 | self-mutation: 50 | needs: build 51 | runs-on: ubuntu-latest 52 | permissions: 53 | contents: write 54 | if: always() && needs.build.outputs.self_mutation_happened && !(github.event.pull_request.head.repo.full_name != github.repository) 55 | steps: 56 | - name: Checkout 57 | uses: actions/checkout@v4 58 | with: 59 | token: ${{ secrets.PROJEN_GITHUB_TOKEN }} 60 | ref: ${{ github.event.pull_request.head.ref }} 61 | repository: ${{ github.event.pull_request.head.repo.full_name }} 62 | - name: Download patch 63 | uses: actions/download-artifact@v4 64 | with: 65 | name: .repo.patch 66 | path: ${{ runner.temp }} 67 | - name: Apply patch 68 | run: '[ -s ${{ runner.temp }}/.repo.patch ] && git apply ${{ runner.temp }}/.repo.patch || echo "Empty patch. Skipping."' 69 | - name: Set git identity 70 | run: |- 71 | git config user.name "github-actions" 72 | git config user.email "github-actions@github.com" 73 | - name: Push changes 74 | env: 75 | PULL_REQUEST_REF: ${{ github.event.pull_request.head.ref }} 76 | run: |- 77 | git add . 78 | git commit -s -m "chore: self mutation" 79 | git push origin HEAD:$PULL_REQUEST_REF 80 | -------------------------------------------------------------------------------- /.github/workflows/pull-request-lint.yml: -------------------------------------------------------------------------------- 1 | # ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". 2 | 3 | name: pull-request-lint 4 | on: 5 | pull_request_target: 6 | types: 7 | - labeled 8 | - opened 9 | - synchronize 10 | - reopened 11 | - ready_for_review 12 | - edited 13 | jobs: 14 | validate: 15 | name: Validate PR title 16 | runs-on: ubuntu-latest 17 | permissions: 18 | pull-requests: write 19 | steps: 20 | - uses: amannn/action-semantic-pull-request@v5.4.0 21 | env: 22 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 23 | with: 24 | types: |- 25 | feat 26 | fix 27 | chore 28 | requireScope: false 29 | -------------------------------------------------------------------------------- /.github/workflows/upgrade-site.yml: -------------------------------------------------------------------------------- 1 | # ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". 2 | 3 | name: upgrade-site 4 | on: 5 | schedule: 6 | - cron: 0 5 * * 1 7 | workflow_dispatch: {} 8 | jobs: 9 | upgradeSite: 10 | name: upgrade-site 11 | runs-on: ubuntu-latest 12 | permissions: 13 | actions: write 14 | contents: read 15 | id-token: write 16 | steps: 17 | - uses: actions/checkout@v3 18 | - name: Setup Node.js 19 | uses: actions/setup-node@v3 20 | with: 21 | node-version: "18" 22 | - run: yarn install --check-files --frozen-lockfile 23 | working-directory: site 24 | - run: yarn upgrade 25 | working-directory: site 26 | - name: Create Pull Request 27 | uses: peter-evans/create-pull-request@v4 28 | with: 29 | token: ${{ secrets.PROJEN_GITHUB_TOKEN }} 30 | commit-message: "chore: upgrade site" 31 | branch: auto/projen-upgrade 32 | title: "chore: upgrade site" 33 | body: This PR upgrades site 34 | labels: auto-merge, auto-approve 35 | author: github-actions 36 | committer: github-actions 37 | signoff: true 38 | -------------------------------------------------------------------------------- /.github/workflows/upgrade.yml: -------------------------------------------------------------------------------- 1 | # ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". 2 | 3 | name: upgrade 4 | on: 5 | workflow_dispatch: {} 6 | schedule: 7 | - cron: 0 0 * * 1 8 | jobs: 9 | upgrade: 10 | name: Upgrade 11 | runs-on: ubuntu-latest 12 | permissions: 13 | contents: read 14 | outputs: 15 | patch_created: ${{ steps.create_patch.outputs.patch_created }} 16 | steps: 17 | - name: Checkout 18 | uses: actions/checkout@v4 19 | - name: Setup Node.js 20 | uses: actions/setup-node@v4 21 | with: 22 | node-version: 16.x 23 | - name: Install dependencies 24 | run: yarn install --check-files --frozen-lockfile 25 | - name: Upgrade dependencies 26 | run: npx projen upgrade 27 | - name: Find mutations 28 | id: create_patch 29 | run: |- 30 | git add . 31 | git diff --staged --patch --exit-code > .repo.patch || echo "patch_created=true" >> $GITHUB_OUTPUT 32 | working-directory: ./ 33 | - name: Upload patch 34 | if: steps.create_patch.outputs.patch_created 35 | uses: actions/upload-artifact@v4 36 | with: 37 | name: .repo.patch 38 | path: .repo.patch 39 | overwrite: true 40 | pr: 41 | name: Create Pull Request 42 | needs: upgrade 43 | runs-on: ubuntu-latest 44 | permissions: 45 | contents: read 46 | if: ${{ needs.upgrade.outputs.patch_created }} 47 | steps: 48 | - name: Checkout 49 | uses: actions/checkout@v4 50 | - name: Download patch 51 | uses: actions/download-artifact@v4 52 | with: 53 | name: .repo.patch 54 | path: ${{ runner.temp }} 55 | - name: Apply patch 56 | run: '[ -s ${{ runner.temp }}/.repo.patch ] && git apply ${{ runner.temp }}/.repo.patch || echo "Empty patch. Skipping."' 57 | - name: Set git identity 58 | run: |- 59 | git config user.name "github-actions" 60 | git config user.email "github-actions@github.com" 61 | - name: Create Pull Request 62 | id: create-pr 63 | uses: peter-evans/create-pull-request@v6 64 | with: 65 | token: ${{ secrets.PROJEN_GITHUB_TOKEN }} 66 | commit-message: |- 67 | chore(deps): upgrade dependencies 68 | 69 | Upgrades project dependencies. See details in [workflow run]. 70 | 71 | [Workflow Run]: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} 72 | 73 | ------ 74 | 75 | *Automatically created by projen via the "upgrade" workflow* 76 | branch: github-actions/upgrade 77 | title: "chore(deps): upgrade dependencies" 78 | labels: auto-approve,auto-merge 79 | body: |- 80 | Upgrades project dependencies. See details in [workflow run]. 81 | 82 | [Workflow Run]: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} 83 | 84 | ------ 85 | 86 | *Automatically created by projen via the "upgrade" workflow* 87 | author: github-actions 88 | committer: github-actions 89 | signoff: true 90 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". 2 | !/.gitattributes 3 | !/.projen/tasks.json 4 | !/.projen/deps.json 5 | !/.projen/files.json 6 | !/.github/workflows/pull-request-lint.yml 7 | !/.github/workflows/auto-approve.yml 8 | !/package.json 9 | !/LICENSE 10 | !/.npmignore 11 | logs 12 | *.log 13 | npm-debug.log* 14 | yarn-debug.log* 15 | yarn-error.log* 16 | lerna-debug.log* 17 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 18 | pids 19 | *.pid 20 | *.seed 21 | *.pid.lock 22 | lib-cov 23 | coverage 24 | *.lcov 25 | .nyc_output 26 | build/Release 27 | node_modules/ 28 | jspm_packages/ 29 | *.tsbuildinfo 30 | .eslintcache 31 | *.tgz 32 | .yarn-integrity 33 | .cache 34 | /test-reports/ 35 | junit.xml 36 | /coverage/ 37 | !/.github/workflows/build.yml 38 | !/.mergify.yml 39 | !/.github/workflows/upgrade.yml 40 | !/.github/pull_request_template.md 41 | !/test/ 42 | !/tsconfig.json 43 | !/tsconfig.dev.json 44 | !/src/ 45 | /lib 46 | /dist/ 47 | !/.eslintrc.json 48 | /assets/ 49 | !/cdk.json 50 | /cdk.out/ 51 | .cdk.staging/ 52 | .parcel-cache/ 53 | !/.github/workflows/upgrade-site.yml 54 | cdk.out 55 | cdk.context.json 56 | yarn-error.log 57 | dependabot.yml 58 | *.drawio 59 | .DS_Store 60 | !/.projenrc.ts 61 | -------------------------------------------------------------------------------- /.mergify.yml: -------------------------------------------------------------------------------- 1 | # ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". 2 | 3 | queue_rules: 4 | - name: default 5 | update_method: merge 6 | conditions: 7 | - "#approved-reviews-by>=1" 8 | - -label~=(do-not-merge) 9 | - status-success=build 10 | pull_request_rules: 11 | - name: Automatic merge on approval and successful build 12 | actions: 13 | delete_head_branch: {} 14 | queue: 15 | method: squash 16 | name: default 17 | commit_message_template: |- 18 | {{ title }} (#{{ number }}) 19 | 20 | {{ body }} 21 | conditions: 22 | - "#approved-reviews-by>=1" 23 | - -label~=(do-not-merge) 24 | - status-success=build 25 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | # ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". 2 | /.projen/ 3 | /test-reports/ 4 | junit.xml 5 | /coverage/ 6 | permissions-backup.acl 7 | /.mergify.yml 8 | /test/ 9 | /tsconfig.dev.json 10 | /src/ 11 | !/lib/ 12 | !/lib/**/*.js 13 | !/lib/**/*.d.ts 14 | dist 15 | /tsconfig.json 16 | /.github/ 17 | /.vscode/ 18 | /.idea/ 19 | /.projenrc.js 20 | tsconfig.tsbuildinfo 21 | /.eslintrc.json 22 | !/assets/ 23 | cdk.out/ 24 | .cdk.staging/ 25 | /.gitattributes 26 | /.projenrc.ts 27 | /projenrc 28 | -------------------------------------------------------------------------------- /.projen/deps.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": [ 3 | { 4 | "name": "@types/jest", 5 | "type": "build" 6 | }, 7 | { 8 | "name": "@types/node", 9 | "version": "^18", 10 | "type": "build" 11 | }, 12 | { 13 | "name": "@typescript-eslint/eslint-plugin", 14 | "version": "^6", 15 | "type": "build" 16 | }, 17 | { 18 | "name": "@typescript-eslint/parser", 19 | "version": "^6", 20 | "type": "build" 21 | }, 22 | { 23 | "name": "aws-cdk", 24 | "version": "^2.68.0", 25 | "type": "build" 26 | }, 27 | { 28 | "name": "esbuild", 29 | "type": "build" 30 | }, 31 | { 32 | "name": "eslint-import-resolver-typescript", 33 | "type": "build" 34 | }, 35 | { 36 | "name": "eslint-plugin-import", 37 | "type": "build" 38 | }, 39 | { 40 | "name": "eslint", 41 | "version": "^8", 42 | "type": "build" 43 | }, 44 | { 45 | "name": "jest", 46 | "type": "build" 47 | }, 48 | { 49 | "name": "jest-junit", 50 | "version": "^15", 51 | "type": "build" 52 | }, 53 | { 54 | "name": "projen", 55 | "type": "build" 56 | }, 57 | { 58 | "name": "ts-jest", 59 | "type": "build" 60 | }, 61 | { 62 | "name": "ts-node", 63 | "type": "build" 64 | }, 65 | { 66 | "name": "typescript", 67 | "type": "build" 68 | }, 69 | { 70 | "name": "@aws-sdk/client-chime-sdk-media-pipelines", 71 | "type": "runtime" 72 | }, 73 | { 74 | "name": "@aws-sdk/client-chime-sdk-meetings", 75 | "type": "runtime" 76 | }, 77 | { 78 | "name": "@aws-sdk/client-dynamodb", 79 | "type": "runtime" 80 | }, 81 | { 82 | "name": "@aws-sdk/client-ivs", 83 | "type": "runtime" 84 | }, 85 | { 86 | "name": "@aws-sdk/lib-dynamodb", 87 | "type": "runtime" 88 | }, 89 | { 90 | "name": "@types/aws-lambda", 91 | "type": "runtime" 92 | }, 93 | { 94 | "name": "@types/fs-extra", 95 | "type": "runtime" 96 | }, 97 | { 98 | "name": "aws-cdk-lib", 99 | "version": "^2.68.0", 100 | "type": "runtime" 101 | }, 102 | { 103 | "name": "aws-lambda", 104 | "type": "runtime" 105 | }, 106 | { 107 | "name": "constructs", 108 | "version": "^10.0.5", 109 | "type": "runtime" 110 | }, 111 | { 112 | "name": "fs-extra", 113 | "type": "runtime" 114 | } 115 | ], 116 | "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run \"npx projen\"." 117 | } 118 | -------------------------------------------------------------------------------- /.projen/files.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | ".eslintrc.json", 4 | ".gitattributes", 5 | ".github/pull_request_template.md", 6 | ".github/workflows/auto-approve.yml", 7 | ".github/workflows/build.yml", 8 | ".github/workflows/pull-request-lint.yml", 9 | ".github/workflows/upgrade-site.yml", 10 | ".github/workflows/upgrade.yml", 11 | ".gitignore", 12 | ".mergify.yml", 13 | ".npmignore", 14 | ".projen/deps.json", 15 | ".projen/files.json", 16 | ".projen/tasks.json", 17 | "cdk.json", 18 | "LICENSE", 19 | "tsconfig.dev.json", 20 | "tsconfig.json" 21 | ], 22 | "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run \"npx projen\"." 23 | } 24 | -------------------------------------------------------------------------------- /.projen/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "tasks": { 3 | "build": { 4 | "name": "build", 5 | "description": "Full release build", 6 | "steps": [ 7 | { 8 | "spawn": "default" 9 | }, 10 | { 11 | "spawn": "pre-compile" 12 | }, 13 | { 14 | "spawn": "compile" 15 | }, 16 | { 17 | "spawn": "post-compile" 18 | }, 19 | { 20 | "spawn": "test" 21 | }, 22 | { 23 | "spawn": "package" 24 | } 25 | ] 26 | }, 27 | "bundle": { 28 | "name": "bundle", 29 | "description": "Prepare assets" 30 | }, 31 | "clobber": { 32 | "name": "clobber", 33 | "description": "hard resets to HEAD of origin and cleans the local repo", 34 | "env": { 35 | "BRANCH": "$(git branch --show-current)" 36 | }, 37 | "steps": [ 38 | { 39 | "exec": "git checkout -b scratch", 40 | "name": "save current HEAD in \"scratch\" branch" 41 | }, 42 | { 43 | "exec": "git checkout $BRANCH" 44 | }, 45 | { 46 | "exec": "git fetch origin", 47 | "name": "fetch latest changes from origin" 48 | }, 49 | { 50 | "exec": "git reset --hard origin/$BRANCH", 51 | "name": "hard reset to origin commit" 52 | }, 53 | { 54 | "exec": "git clean -fdx", 55 | "name": "clean all untracked files" 56 | }, 57 | { 58 | "say": "ready to rock! (unpushed commits are under the \"scratch\" branch)" 59 | } 60 | ], 61 | "condition": "git diff --exit-code > /dev/null" 62 | }, 63 | "compile": { 64 | "name": "compile", 65 | "description": "Only compile" 66 | }, 67 | "configLocal": { 68 | "name": "configLocal", 69 | "steps": [ 70 | { 71 | "exec": "aws s3 cp s3://$(yarn run --silent getBucket)/config.json site/public/" 72 | } 73 | ] 74 | }, 75 | "default": { 76 | "name": "default", 77 | "description": "Synthesize project files", 78 | "steps": [ 79 | { 80 | "exec": "ts-node --project tsconfig.dev.json .projenrc.ts" 81 | } 82 | ] 83 | }, 84 | "deploy": { 85 | "name": "deploy", 86 | "description": "Deploys your CDK app to the AWS cloud", 87 | "steps": [ 88 | { 89 | "exec": "cdk deploy", 90 | "receiveArgs": true 91 | } 92 | ] 93 | }, 94 | "destroy": { 95 | "name": "destroy", 96 | "description": "Destroys your cdk app in the AWS cloud", 97 | "steps": [ 98 | { 99 | "exec": "cdk destroy", 100 | "receiveArgs": true 101 | } 102 | ] 103 | }, 104 | "diff": { 105 | "name": "diff", 106 | "description": "Diffs the currently deployed app against your code", 107 | "steps": [ 108 | { 109 | "exec": "cdk diff" 110 | } 111 | ] 112 | }, 113 | "eject": { 114 | "name": "eject", 115 | "description": "Remove projen from the project", 116 | "env": { 117 | "PROJEN_EJECTING": "true" 118 | }, 119 | "steps": [ 120 | { 121 | "spawn": "default" 122 | } 123 | ] 124 | }, 125 | "eslint": { 126 | "name": "eslint", 127 | "description": "Runs eslint against the codebase", 128 | "steps": [ 129 | { 130 | "exec": "eslint --ext .ts,.tsx --fix --no-error-on-unmatched-pattern $@ src test build-tools projenrc .projenrc.ts", 131 | "receiveArgs": true 132 | } 133 | ] 134 | }, 135 | "getBucket": { 136 | "name": "getBucket", 137 | "steps": [ 138 | { 139 | "exec": "aws cloudformation describe-stacks --stack-name AmazonChimeSDKWithLiveConnector --query 'Stacks[0].Outputs[?OutputKey==`siteBucket`].OutputValue' --output text" 140 | } 141 | ] 142 | }, 143 | "install": { 144 | "name": "install", 145 | "description": "Install project dependencies and update lockfile (non-frozen)", 146 | "steps": [ 147 | { 148 | "exec": "yarn install --check-files" 149 | } 150 | ] 151 | }, 152 | "install:ci": { 153 | "name": "install:ci", 154 | "description": "Install project dependencies using frozen lockfile", 155 | "steps": [ 156 | { 157 | "exec": "yarn install --check-files --frozen-lockfile" 158 | } 159 | ] 160 | }, 161 | "launch": { 162 | "name": "launch", 163 | "steps": [ 164 | { 165 | "exec": "yarn && yarn projen && yarn build && yarn cdk bootstrap && yarn cdk deploy && yarn configLocal" 166 | } 167 | ] 168 | }, 169 | "package": { 170 | "name": "package", 171 | "description": "Creates the distribution package" 172 | }, 173 | "post-compile": { 174 | "name": "post-compile", 175 | "description": "Runs after successful compilation", 176 | "steps": [ 177 | { 178 | "spawn": "synth:silent" 179 | } 180 | ] 181 | }, 182 | "post-upgrade": { 183 | "name": "post-upgrade", 184 | "description": "Runs after upgrading dependencies" 185 | }, 186 | "pre-compile": { 187 | "name": "pre-compile", 188 | "description": "Prepare the project for compilation" 189 | }, 190 | "synth": { 191 | "name": "synth", 192 | "description": "Synthesizes your cdk app into cdk.out", 193 | "steps": [ 194 | { 195 | "exec": "cdk synth" 196 | } 197 | ] 198 | }, 199 | "synth:silent": { 200 | "name": "synth:silent", 201 | "description": "Synthesizes your cdk app into cdk.out and suppresses the template in stdout (part of \"yarn build\")", 202 | "steps": [ 203 | { 204 | "exec": "cdk synth -q" 205 | } 206 | ] 207 | }, 208 | "test": { 209 | "name": "test", 210 | "description": "Run tests", 211 | "steps": [ 212 | { 213 | "exec": "jest --passWithNoTests --updateSnapshot", 214 | "receiveArgs": true 215 | }, 216 | { 217 | "spawn": "eslint" 218 | } 219 | ] 220 | }, 221 | "test:watch": { 222 | "name": "test:watch", 223 | "description": "Run jest in watch mode", 224 | "steps": [ 225 | { 226 | "exec": "jest --watch" 227 | } 228 | ] 229 | }, 230 | "upgrade": { 231 | "name": "upgrade", 232 | "description": "upgrade dependencies", 233 | "env": { 234 | "CI": "0" 235 | }, 236 | "steps": [ 237 | { 238 | "exec": "npx npm-check-updates@16 --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/jest,esbuild,eslint-import-resolver-typescript,eslint-plugin-import,jest,projen,ts-jest,ts-node,typescript,@aws-sdk/client-chime-sdk-media-pipelines,@aws-sdk/client-chime-sdk-meetings,@aws-sdk/client-dynamodb,@aws-sdk/client-ivs,@aws-sdk/lib-dynamodb,@types/aws-lambda,@types/fs-extra,aws-lambda,fs-extra" 239 | }, 240 | { 241 | "exec": "yarn install --check-files" 242 | }, 243 | { 244 | "exec": "yarn upgrade @types/jest @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser aws-cdk esbuild eslint-import-resolver-typescript eslint-plugin-import eslint jest jest-junit projen ts-jest ts-node typescript @aws-sdk/client-chime-sdk-media-pipelines @aws-sdk/client-chime-sdk-meetings @aws-sdk/client-dynamodb @aws-sdk/client-ivs @aws-sdk/lib-dynamodb @types/aws-lambda @types/fs-extra aws-cdk-lib aws-lambda constructs fs-extra" 245 | }, 246 | { 247 | "exec": "npx projen" 248 | }, 249 | { 250 | "spawn": "post-upgrade" 251 | } 252 | ] 253 | }, 254 | "watch": { 255 | "name": "watch", 256 | "description": "Watches changes in your source code and rebuilds and deploys to the current account", 257 | "steps": [ 258 | { 259 | "exec": "cdk deploy --hotswap" 260 | }, 261 | { 262 | "exec": "cdk watch" 263 | } 264 | ] 265 | } 266 | }, 267 | "env": { 268 | "PATH": "$(npx -c \"node --print process.env.PATH\")" 269 | }, 270 | "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run \"npx projen\"." 271 | } 272 | -------------------------------------------------------------------------------- /.projenrc.ts: -------------------------------------------------------------------------------- 1 | const { awscdk } = require('projen'); 2 | const { JobPermission } = require('projen/lib/github/workflows-model'); 3 | const { UpgradeDependenciesSchedule } = require('projen/lib/javascript'); 4 | 5 | const AUTOMATION_TOKEN = 'PROJEN_GITHUB_TOKEN'; 6 | const project = new awscdk.AwsCdkTypeScriptApp({ 7 | cdkVersion: '2.68.0', 8 | defaultReleaseBranch: 'main', 9 | name: 'amazon-chime-sdk-meeting-with-live-connector', 10 | appEntrypoint: 'amazon-chime-sdk-meeting-with-live-connector.ts', 11 | workflowNodeVersion: '16.x', 12 | devDeps: ['esbuild'], 13 | deps: [ 14 | 'fs-extra', 15 | '@types/fs-extra', 16 | '@aws-sdk/client-chime-sdk-media-pipelines', 17 | '@aws-sdk/client-chime-sdk-meetings', 18 | '@aws-sdk/client-dynamodb', 19 | '@aws-sdk/client-ivs', 20 | '@aws-sdk/lib-dynamodb', 21 | 'aws-lambda', 22 | '@types/aws-lambda', 23 | ], 24 | projenrcTs: true, 25 | autoApproveOptions: { 26 | secret: 'GITHUB_TOKEN', 27 | allowedUsernames: ['schuettc'], 28 | }, 29 | depsUpgradeOptions: { 30 | ignoreProjen: false, 31 | workflowOptions: { 32 | labels: ['auto-approve', 'auto-merge'], 33 | schedule: UpgradeDependenciesSchedule.WEEKLY, 34 | }, 35 | }, 36 | scripts: { 37 | launch: 38 | 'yarn && yarn projen && yarn build && yarn cdk bootstrap && yarn cdk deploy && yarn configLocal', 39 | }, 40 | }); 41 | 42 | const upgradeSite = project.github.addWorkflow('upgrade-site'); 43 | upgradeSite.on({ schedule: [{ cron: '0 5 * * 1' }], workflowDispatch: {} }); 44 | upgradeSite.addJobs({ 45 | upgradeSite: { 46 | runsOn: ['ubuntu-latest'], 47 | name: 'upgrade-site', 48 | permissions: { 49 | actions: JobPermission.WRITE, 50 | contents: JobPermission.READ, 51 | idToken: JobPermission.WRITE, 52 | }, 53 | steps: [ 54 | { uses: 'actions/checkout@v3' }, 55 | { 56 | name: 'Setup Node.js', 57 | uses: 'actions/setup-node@v3', 58 | with: { 59 | 'node-version': '18', 60 | }, 61 | }, 62 | { 63 | run: 'yarn install --check-files --frozen-lockfile', 64 | workingDirectory: 'site', 65 | }, 66 | { 67 | run: 'yarn upgrade', 68 | workingDirectory: 'site', 69 | }, 70 | { 71 | name: 'Create Pull Request', 72 | uses: 'peter-evans/create-pull-request@v4', 73 | with: { 74 | 'token': '${{ secrets.' + AUTOMATION_TOKEN + ' }}', 75 | 'commit-message': 'chore: upgrade site', 76 | 'branch': 'auto/projen-upgrade', 77 | 'title': 'chore: upgrade site', 78 | 'body': 'This PR upgrades site', 79 | 'labels': 'auto-merge, auto-approve', 80 | 'author': 'github-actions ', 81 | 'committer': 'github-actions ', 82 | 'signoff': true, 83 | }, 84 | }, 85 | ], 86 | }, 87 | }); 88 | 89 | const common_exclude = [ 90 | 'cdk.out', 91 | 'cdk.context.json', 92 | 'yarn-error.log', 93 | 'dependabot.yml', 94 | '*.drawio', 95 | '.DS_Store', 96 | ]; 97 | 98 | project.addTask('getBucket', { 99 | exec: "aws cloudformation describe-stacks --stack-name AmazonChimeSDKWithLiveConnector --query 'Stacks[0].Outputs[?OutputKey==`siteBucket`].OutputValue' --output text", 100 | }); 101 | 102 | project.addTask('configLocal', { 103 | exec: 'aws s3 cp s3://$(yarn run --silent getBucket)/config.json site/public/', 104 | }); 105 | 106 | project.gitignore.exclude(...common_exclude); 107 | project.synth(); 108 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "[]" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright [yyyy] [name of copyright owner] 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. 203 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Amazon Chime SDK Meeting with Live Connector 2 | 3 | This demo will deploy several components to be used to create an Amazon Chime SDK Meeting and use the [Amazon Chime SDK media live connector](https://docs.aws.amazon.com/chime-sdk/latest/dg/media-pipelines.html) to stream to a Real-Time Messaging Protocol (RTMP) endpoint. In this demo, we will use [Amazon Interactive Video Service](https://docs.aws.amazon.com/ivs/latest/userguide/what-is.html) as the RTMP endpoint. 4 | 5 | ## Overview 6 | 7 | ![AmazonChimeSDKMeetingWithLiveConnector](images/AmazonChimeSDKLiveConnector.png) 8 | 9 | This demo will use serverless components to host a React based site the user is able to interact with through an AWS API Gateway to an AWS Lambda function. This AWS Lambda function will control the meeting through calls to the [AWS SDK](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). 10 | 11 | ### Creating and Joining an Amazon Chime SDK Meeting 12 | 13 | Once deployed, you can click the `Join` button to join the meeting. 14 | 15 | ![JoinMeeting](images/JoinMeeting.png) 16 | 17 | This will invoke the included AWS Lambda function to create and join the meeting. 18 | 19 | ```typescript 20 | async function meetingRequest() { 21 | const currentMeetings = await checkForMeetings(); 22 | if (currentMeetings) { 23 | for (let meeting of currentMeetings) { 24 | if (meeting.joinInfo.Attendee.length < 2) { 25 | console.log(`Adding an attendee to an existing meeting: ${meeting.meetingId}`); 26 | const attendeeInfo = await createAttendee(meeting.meetingId); 27 | console.log(`attendeeInfo: ${JSON.stringify(attendeeInfo)}`); 28 | meeting.joinInfo.Attendee.push(attendeeInfo.Attendee); 29 | await putMeetingInfo(meeting.joinInfo); 30 | 31 | const responseInfo = { 32 | Meeting: meeting.joinInfo.Meeting, 33 | Attendee: attendeeInfo.Attendee, 34 | }; 35 | 36 | response.statusCode = 200; 37 | response.body = JSON.stringify(responseInfo); 38 | console.info('joinInfo: ' + JSON.stringify(response)); 39 | return response; 40 | } 41 | } 42 | } 43 | ``` 44 | 45 | This function will first check to see if there are any existing meetings. If there is, it will look for a meeting with fewer than two people. If there is one, an attendee will be created in the meeting and the information passed back to the user. 46 | 47 | ```typescript 48 | const meetingInfo = await createMeeting(); 49 | if (meetingInfo && meetingInfo.Meeting && meetingInfo.Meeting.MeetingId) { 50 | const attendeeInfo = await createAttendee(meetingInfo.Meeting.MeetingId); 51 | if (attendeeInfo && attendeeInfo.Attendee) { 52 | const joinInfo: JoinInfo = { 53 | Meeting: meetingInfo.Meeting, 54 | Attendee: [attendeeInfo.Attendee], 55 | }; 56 | await putMeetingInfo(joinInfo); 57 | 58 | const responseInfo = { 59 | Meeting: meetingInfo.Meeting, 60 | Attendee: attendeeInfo.Attendee, 61 | }; 62 | 63 | response.statusCode = 200; 64 | response.body = JSON.stringify(responseInfo); 65 | console.info('joinInfo: ' + JSON.stringify(response)); 66 | return response; 67 | } 68 | } 69 | response.statusCode = 503; 70 | return response; 71 | } 72 | ``` 73 | 74 | If there is not a meeting available, a new meeting and attendee will be created. This information is captured and returned to the user that will be used to join the meeting. 75 | 76 | ### Creating an IVS Channel and Amazon Chime SDK media live connector pipeline 77 | 78 | Once the meeting has started, the [Amazon Chime media live connector stream](https://docs.aws.amazon.com/chime-sdk/latest/dg/connector-pipe-config.html) can be created. 79 | 80 | ![StartStream](images/StartStream.png) 81 | 82 | ```typescript 83 | async function createStream(meetingId: string) { 84 | const createChannelResponse: CreateChannelCommandOutput = 85 | await ivsClient.send(new CreateChannelCommand({ latencyMode: 'NORMAL' })); 86 | console.log( 87 | `createChannelResponse: ${JSON.stringify(createChannelResponse)}`, 88 | ); 89 | if ( 90 | createChannelResponse && 91 | createChannelResponse.channel && 92 | createChannelResponse.streamKey 93 | ) { 94 | createMediaLiveConnectorPipelineCommandInput!.Sources![0]!.ChimeSdkMeetingLiveConnectorConfiguration!.Arn = `arn:aws:chime::${awsAccountId}:meeting:${meetingId}`; 95 | createMediaLiveConnectorPipelineCommandInput!.Sinks![0]!.RTMPConfiguration!.Url = `rtmps://${createChannelResponse.channel.ingestEndpoint}:443/app/${createChannelResponse.streamKey.value}`; 96 | 97 | console.log( 98 | `CreateMediaLiveConnectorPipelineCommandInput: ${JSON.stringify( 99 | createMediaLiveConnectorPipelineCommandInput, 100 | )}`, 101 | ); 102 | ``` 103 | 104 | The first step is to [create an IVS Channel](https://docs.aws.amazon.com/ivs/latest/userguide/getting-started-create-channel.html). We will use the information from the response when creating the media live connector pipeline in the next step. 105 | 106 | ```typescript 107 | const createPipelineResponse: CreateMediaLiveConnectorPipelineCommandOutput = 108 | await chimeSdkMediaPipelineclient.send( 109 | new CreateMediaLiveConnectorPipelineCommand( 110 | createMediaLiveConnectorPipelineCommandInput, 111 | ), 112 | ); 113 | console.log( 114 | `CreatePipelineResponse: ${JSON.stringify(createPipelineResponse)}`, 115 | ); 116 | ``` 117 | 118 | Using the information from the IVS Channel creation, we will use [`CreateMediaLiveConnectorPipelineCommand](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-chime-sdk-media-pipelines/classes/createmedialiveconnectorpipelinecommand.html) to create the Amazon Chime SDK media live connector. The source for this media live connector will be the previously created meeting. The sink for this media live connector will be the RTMPS endpoint of the IVS channel. 119 | 120 | ```typescript 121 | if ( 122 | createPipelineResponse && 123 | createPipelineResponse.MediaLiveConnectorPipeline 124 | ) { 125 | const getStreamResponse: GetStreamCommandOutput | null = 126 | await checkForStream(createChannelResponse); 127 | console.log(`getStreamResponse: ${JSON.stringify(getStreamResponse)}`); 128 | if (getStreamResponse && getStreamResponse.stream) { 129 | response.body = JSON.stringify({ 130 | mediaPipelineId: 131 | createPipelineResponse.MediaLiveConnectorPipeline.MediaPipelineId, 132 | playbackUrl: getStreamResponse.stream.playbackUrl, 133 | }); 134 | 135 | response.statusCode = 200; 136 | console.info('streamInfo: ' + JSON.stringify(response)); 137 | return response; 138 | } 139 | } 140 | } 141 | response.statusCode = 503; 142 | return response; 143 | } 144 | ``` 145 | 146 | Once the media live connector has been configured to use the IVS channel, we can use [`GetStreamCommand`](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-ivs/classes/getstreamcommand.html) to get the `playbackUrl` that will be used to view the IVS stream. This information is passed back to the user so that they can view the broadcast. 147 | 148 | ![ViewStream](images/ViewStream.png) 149 | 150 | ### Service-Linked Role 151 | 152 | A [service linked role](https://docs.aws.amazon.com/chime-sdk/latest/ag/using-service-linked-roles-media-pipeline.html#create-slr) is required for this deployment. 153 | 154 | If this does not already exist in your account, you can run: 155 | 156 | ```bash 157 | aws iam create-service-linked-role --aws-service-name mediapipelines.chime.amazonaws.com 158 | ``` 159 | 160 | ## Components Deployed 161 | 162 | - AWS Lambda Function 163 | - Amazon DynamoDB Table 164 | - Amazon Cloudfront Distribution 165 | - Amazon Simple Storage Service (S3) Bucket 166 | - Amazon API Gateway 167 | 168 | ## Deployment 169 | 170 | To deploy this demo: 171 | 172 | ```bash 173 | yarn launch 174 | ``` 175 | 176 | The output of this deployment will include an Amazon Cloudfront Distribution that can be used. This demo also includes the ability to run locally: 177 | 178 | ```bash 179 | cd site 180 | yarn && yarn run start 181 | ``` 182 | 183 | ## Clean Up 184 | 185 | To remove the components created: 186 | 187 | ```bash 188 | yarn cdk destroy 189 | ``` 190 | 191 | ## Note on Repo Update 192 | 193 | Previously, this repo contained a much different deployment based on an older technique. That repo is still available in the `master` branch. Going forward, updates will be applied to the `main` branch using the new features. 194 | -------------------------------------------------------------------------------- /cdk.json: -------------------------------------------------------------------------------- 1 | { 2 | "app": "npx ts-node -P tsconfig.json --prefer-ts-exts src/amazon-chime-sdk-meeting-with-live-connector.ts", 3 | "output": "cdk.out", 4 | "build": "npx projen bundle", 5 | "watch": { 6 | "include": [ 7 | "src/**/*.ts", 8 | "test/**/*.ts" 9 | ], 10 | "exclude": [ 11 | "README.md", 12 | "cdk*.json", 13 | "**/*.d.ts", 14 | "**/*.js", 15 | "tsconfig.json", 16 | "package*.json", 17 | "yarn.lock", 18 | "node_modules" 19 | ] 20 | }, 21 | "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run \"npx projen\"." 22 | } 23 | -------------------------------------------------------------------------------- /images/AmazonChimeSDKLiveConnector.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/amazon-chime-live-events/3b049ca90f8b3ecf3c750502029168fb1b5fd024/images/AmazonChimeSDKLiveConnector.png -------------------------------------------------------------------------------- /images/JoinMeeting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/amazon-chime-live-events/3b049ca90f8b3ecf3c750502029168fb1b5fd024/images/JoinMeeting.png -------------------------------------------------------------------------------- /images/StartStream.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/amazon-chime-live-events/3b049ca90f8b3ecf3c750502029168fb1b5fd024/images/StartStream.png -------------------------------------------------------------------------------- /images/ViewStream.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/amazon-chime-live-events/3b049ca90f8b3ecf3c750502029168fb1b5fd024/images/ViewStream.png -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "amazon-chime-sdk-meeting-with-live-connector", 3 | "scripts": { 4 | "build": "npx projen build", 5 | "bundle": "npx projen bundle", 6 | "clobber": "npx projen clobber", 7 | "compile": "npx projen compile", 8 | "configLocal": "npx projen configLocal", 9 | "default": "npx projen default", 10 | "deploy": "npx projen deploy", 11 | "destroy": "npx projen destroy", 12 | "diff": "npx projen diff", 13 | "eject": "npx projen eject", 14 | "eslint": "npx projen eslint", 15 | "getBucket": "npx projen getBucket", 16 | "launch": "npx projen launch", 17 | "package": "npx projen package", 18 | "post-compile": "npx projen post-compile", 19 | "post-upgrade": "npx projen post-upgrade", 20 | "pre-compile": "npx projen pre-compile", 21 | "synth": "npx projen synth", 22 | "synth:silent": "npx projen synth:silent", 23 | "test": "npx projen test", 24 | "test:watch": "npx projen test:watch", 25 | "upgrade": "npx projen upgrade", 26 | "watch": "npx projen watch", 27 | "projen": "npx projen" 28 | }, 29 | "devDependencies": { 30 | "@types/jest": "^28.1.8", 31 | "@types/node": "^18", 32 | "@typescript-eslint/eslint-plugin": "^6", 33 | "@typescript-eslint/parser": "^6", 34 | "aws-cdk": "^2.68.0", 35 | "esbuild": "^0.21.4", 36 | "eslint": "^8", 37 | "eslint-import-resolver-typescript": "^3.6.1", 38 | "eslint-plugin-import": "^2.29.1", 39 | "jest": "^28.1.3", 40 | "jest-junit": "^15", 41 | "projen": "^0.82.4", 42 | "ts-jest": "^28.0.8", 43 | "ts-node": "^10.9.2", 44 | "typescript": "^4.9.5" 45 | }, 46 | "dependencies": { 47 | "@aws-sdk/client-chime-sdk-media-pipelines": "^3.588.0", 48 | "@aws-sdk/client-chime-sdk-meetings": "^3.588.0", 49 | "@aws-sdk/client-dynamodb": "^3.588.0", 50 | "@aws-sdk/client-ivs": "^3.588.0", 51 | "@aws-sdk/lib-dynamodb": "^3.588.0", 52 | "@types/aws-lambda": "^8.10.138", 53 | "@types/fs-extra": "^9.0.13", 54 | "aws-cdk-lib": "^2.68.0", 55 | "aws-lambda": "^1.0.7", 56 | "constructs": "^10.0.5", 57 | "fs-extra": "^10.1.0" 58 | }, 59 | "license": "Apache-2.0", 60 | "publishConfig": { 61 | "access": "public" 62 | }, 63 | "version": "0.0.0", 64 | "jest": { 65 | "coverageProvider": "v8", 66 | "testMatch": [ 67 | "/src/**/__tests__/**/*.ts?(x)", 68 | "/@(test|src)/**/*(*.)@(spec|test).ts?(x)" 69 | ], 70 | "clearMocks": true, 71 | "collectCoverage": true, 72 | "coverageReporters": [ 73 | "json", 74 | "lcov", 75 | "clover", 76 | "cobertura", 77 | "text" 78 | ], 79 | "coverageDirectory": "coverage", 80 | "coveragePathIgnorePatterns": [ 81 | "/node_modules/" 82 | ], 83 | "testPathIgnorePatterns": [ 84 | "/node_modules/" 85 | ], 86 | "watchPathIgnorePatterns": [ 87 | "/node_modules/" 88 | ], 89 | "reporters": [ 90 | "default", 91 | [ 92 | "jest-junit", 93 | { 94 | "outputDirectory": "test-reports" 95 | } 96 | ] 97 | ], 98 | "preset": "ts-jest", 99 | "globals": { 100 | "ts-jest": { 101 | "tsconfig": "tsconfig.dev.json" 102 | } 103 | } 104 | }, 105 | "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run \"npx projen\"." 106 | } 107 | -------------------------------------------------------------------------------- /site/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["@babel/preset-react", "@babel/preset-env"] 3 | } 4 | -------------------------------------------------------------------------------- /site/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | parser: '@typescript-eslint/parser', // Specifies the ESLint parser 3 | extends: [ 4 | 'plugin:react/recommended', // Uses the recommended rules from @eslint-plugin-react 5 | 'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin 6 | ], 7 | parserOptions: { 8 | ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features 9 | sourceType: 'module', // Allows for the use of imports 10 | ecmaFeatures: { 11 | jsx: true, // Allows for the parsing of JSX 12 | }, 13 | }, 14 | rules: { 15 | '@typescript-eslint/ban-ts-ignore': 0, 16 | // Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs 17 | // e.g. "@typescript-eslint/explicit-function-return-type": "off", 18 | '@typescript-eslint/no-empty-function': 0, 19 | // '@typescript-eslint/no-empty-function': [ 20 | // 'error', 21 | // { 22 | // allow: [ 23 | // 'methods', 24 | // 'functions', 25 | // 'arrowFunctions', 26 | // 'generatorFunctions', 27 | // 'asyncMethods', 28 | // 'generatorMethods', 29 | // 'asyncFunctions', 30 | // 'getters', 31 | // 'setters', 32 | // ], 33 | // }, 34 | // ], 35 | }, 36 | settings: { 37 | react: { 38 | version: 'detect', // Tells eslint-plugin-react to automatically detect the version of React to use 39 | }, 40 | }, 41 | }; 42 | -------------------------------------------------------------------------------- /site/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /dist 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | 25 | !*.js 26 | cdk-outputs.json 27 | 28 | # config.json -------------------------------------------------------------------------------- /site/.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | semi: true, 3 | trailingComma: 'all', 4 | singleQuote: true, 5 | printWidth: 120, 6 | tabWidth: 4, 7 | }; 8 | -------------------------------------------------------------------------------- /site/README.md: -------------------------------------------------------------------------------- 1 | ## Amazon Chime SDK Live Event Client 2 | 3 | ## To Use 4 | 5 | ``` 6 | yarn 7 | yarn run start 8 | ``` 9 | -------------------------------------------------------------------------------- /site/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "site", 3 | "version": "1.0.0", 4 | "main": "index.js", 5 | "license": "MIT", 6 | "scripts": { 7 | "start": "webpack serve --config ./webpack.config.js --mode development", 8 | "build": "webpack --config webpack.config.js --mode production" 9 | }, 10 | "dependencies": { 11 | "@aws-amplify/ui-react": "^5.3.0", 12 | "amazon-chime-sdk-component-library-react": "^3.2.0", 13 | "amazon-chime-sdk-js": "^3.6.0", 14 | "aws-amplify": "^5.3.10", 15 | "aws-northstar": "^1.3.15", 16 | "babel-loader": "^8.2.4", 17 | "react": "^17.0.2", 18 | "react-dom": "^17.0.2", 19 | "styled-components": "^5.3.5", 20 | "styled-system": "^5.1.5" 21 | }, 22 | "devDependencies": { 23 | "@babel/core": "^7.17.5", 24 | "@babel/preset-env": "^7.16.11", 25 | "@babel/preset-react": "^7.16.7", 26 | "copy-webpack-plugin": "^10.2.4", 27 | "css-loader": "^6.6.0", 28 | "file-loader": "^6.2.0", 29 | "html-webpack-plugin": "^5.5.0", 30 | "style-loader": "^3.3.1", 31 | "webpack": "^5.69.1", 32 | "webpack-cli": "^4.9.2", 33 | "webpack-dev-server": "^4.7.4" 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /site/public/config.json: -------------------------------------------------------------------------------- 1 | {"apiUrl":"https://c96avgep01.execute-api.us-east-1.amazonaws.com/prod/"} -------------------------------------------------------------------------------- /site/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Amazon Chime SDK Meetings with Live Connector 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | -------------------------------------------------------------------------------- /site/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /site/src/App.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/amazon-chime-live-events/3b049ca90f8b3ecf3c750502029168fb1b5fd024/site/src/App.css -------------------------------------------------------------------------------- /site/src/App.js: -------------------------------------------------------------------------------- 1 | import React, { useState, useEffect } from 'react'; 2 | import { 3 | useMeetingManager, 4 | useLocalVideo, 5 | ControlBar, 6 | ControlBarButton, 7 | Meeting, 8 | LeaveMeeting, 9 | LocalVideo, 10 | Play, 11 | Pause, 12 | Remove, 13 | AudioInputControl, 14 | RemoteVideo, 15 | DeviceLabels, 16 | VideoGrid, 17 | VideoInputControl, 18 | AudioOutputControl, 19 | MeetingStatus, 20 | useDeviceLabelTriggerStatus, 21 | useRemoteVideoTileState, 22 | useMeetingStatus, 23 | Laptop, 24 | } from 'amazon-chime-sdk-component-library-react'; 25 | import { MeetingSessionConfiguration } from 'amazon-chime-sdk-js'; 26 | import NorthStarThemeProvider from 'aws-northstar/components/NorthStarThemeProvider'; 27 | import Header from 'aws-northstar/components/Header'; 28 | import './App.css'; 29 | import { AmplifyConfig as config } from './Config'; 30 | import { Amplify, API } from 'aws-amplify'; 31 | import '@aws-amplify/ui-react/styles.css'; 32 | Amplify.configure(config); 33 | Amplify.Logger.LOG_LEVEL = 'DEBUG'; 34 | console.log(config.API); 35 | const App = () => { 36 | const meetingManager = useMeetingManager(); 37 | const status = useDeviceLabelTriggerStatus(); 38 | const meetingStatus = useMeetingStatus(); 39 | const [meetingId, setMeetingId] = useState(''); 40 | const [attendeeId, setAttendeeId] = useState(''); 41 | const [playbackUrl, setPlaybackUrl] = useState(''); 42 | const [mediaPipelineId, setMediaPipelineId] = useState(''); 43 | const [streamStatus, setStreamStatus] = useState(false); 44 | const { toggleVideo } = useLocalVideo(); 45 | const { tiles } = useRemoteVideoTileState(); 46 | const [remoteTileId, setRemoteTileId] = useState(''); 47 | 48 | useEffect(() => { 49 | if (tiles && tiles.length) { 50 | setRemoteTileId(tiles[0]); 51 | } else { 52 | setRemoteTileId(undefined); 53 | } 54 | }, [tiles]); 55 | 56 | useEffect(() => { 57 | async function tog() { 58 | if (meetingStatus === MeetingStatus.Succeeded) { 59 | await toggleVideo(); 60 | } 61 | } 62 | tog(); 63 | }, [meetingStatus]); 64 | 65 | const JoinButtonProps = { 66 | icon: , 67 | onClick: (event) => handleJoin(event), 68 | label: 'Join', 69 | }; 70 | 71 | const LeaveButtonProps = { 72 | icon: , 73 | onClick: (event) => handleLeave(event), 74 | label: 'Leave', 75 | }; 76 | 77 | const EndButtonProps = { 78 | icon: , 79 | onClick: (event) => handleEnd(event), 80 | label: 'End', 81 | }; 82 | 83 | const IVSButtonProps = { 84 | icon: streamStatus ? : , 85 | onClick: (event) => handleIVS(event), 86 | label: 'IVS', 87 | }; 88 | 89 | const StreamButtonProps = { 90 | icon: , 91 | onClick: () => handleOpenIVSPlayer(), 92 | label: 'View', 93 | }; 94 | 95 | const handleOpenIVSPlayer = async () => { 96 | window.open(`https://debug.ivsdemos.com/?p=jwp&url=${playbackUrl}`, '_blank'); 97 | }; 98 | 99 | const handleLeave = async () => { 100 | await meetingManager.leave(); 101 | }; 102 | 103 | const handleEnd = async (event) => { 104 | event.preventDefault(); 105 | try { 106 | await API.post('meetingApi', 'end', { body: { meetingId: meetingId } }); 107 | setStreamStatus(false); 108 | setPlaybackUrl(''); 109 | } catch (err) { 110 | console.log(err); 111 | } 112 | }; 113 | 114 | const handleIVS = async (event) => { 115 | event.preventDefault(); 116 | if (streamStatus) { 117 | const streamResponse = await API.post('meetingApi', 'stream', { 118 | body: { 119 | streamAction: 'delete', 120 | mediaPipelineId: mediaPipelineId, 121 | }, 122 | }); 123 | console.log(streamResponse); 124 | setStreamStatus(false); 125 | setPlaybackUrl(''); 126 | } else { 127 | const streamResponse = await API.post('meetingApi', 'stream', { 128 | body: { 129 | meetingId: meetingId, 130 | streamTarget: 'IVS', 131 | }, 132 | }); 133 | setMediaPipelineId(streamResponse.mediaPipelineId); 134 | setPlaybackUrl(streamResponse.playbackUrl); 135 | console.log(streamResponse); 136 | setStreamStatus(true); 137 | } 138 | }; 139 | 140 | const handleJoin = async (event) => { 141 | event.preventDefault(); 142 | try { 143 | const joinResponse = await API.post('meetingApi', 'join', {}); 144 | console.log(joinResponse); 145 | const meetingSessionConfiguration = new MeetingSessionConfiguration( 146 | joinResponse.Meeting, 147 | joinResponse.Attendee, 148 | ); 149 | 150 | const options = { 151 | deviceLabels: DeviceLabels.Video, 152 | }; 153 | 154 | await meetingManager.join(meetingSessionConfiguration, options); 155 | await meetingManager.start(); 156 | meetingManager.invokeDeviceProvider(DeviceLabels.AudioAndVideo); 157 | console.log('Meeting started'); 158 | setMeetingId(joinResponse.Meeting.MeetingId); 159 | setAttendeeId(joinResponse.Attendee.AttendeeId); 160 | console.log(meetingId); 161 | console.log(attendeeId); 162 | } catch (err) { 163 | console.log(err); 164 | } 165 | }; 166 | 167 | return ( 168 | 169 |
170 | 171 |
172 |
173 | 174 | 182 | 191 | 192 |
193 |
194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | {playbackUrl && } 203 | 204 | 205 | ); 206 | }; 207 | 208 | export default App; 209 | -------------------------------------------------------------------------------- /site/src/Config.js: -------------------------------------------------------------------------------- 1 | const config = await fetch('./config.json').then((response) => response.json()); 2 | 3 | export const AmplifyConfig = { 4 | API: { 5 | endpoints: [ 6 | { 7 | name: 'meetingApi', 8 | endpoint: config.apiUrl, 9 | }, 10 | ], 11 | }, 12 | }; 13 | -------------------------------------------------------------------------------- /site/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 4 | 'Droid Sans', 'Helvetica Neue', sans-serif; 5 | -webkit-font-smoothing: antialiased; 6 | -moz-osx-font-smoothing: grayscale; 7 | } 8 | 9 | code { 10 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', monospace; 11 | } 12 | -------------------------------------------------------------------------------- /site/src/index.js: -------------------------------------------------------------------------------- 1 | import './index.css'; 2 | import React from 'react'; 3 | import ReactDOM from 'react-dom'; 4 | import App from './App'; 5 | 6 | import { ThemeProvider } from 'styled-components'; 7 | import { MeetingProvider, lightTheme } from 'amazon-chime-sdk-component-library-react'; 8 | 9 | ReactDOM.render( 10 | 11 | 12 | 13 | 14 | 15 | 16 | , 17 | document.getElementById('root'), 18 | ); 19 | -------------------------------------------------------------------------------- /site/webpack.config.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | var HtmlWebpackPlugin = require('html-webpack-plugin'); 3 | 4 | module.exports = { 5 | entry: ['regenerator-runtime/runtime.js', './src/index.js'], 6 | output: { 7 | path: path.resolve(__dirname, 'dist'), 8 | filename: 'index_bundle.js', 9 | }, 10 | performance: { 11 | hints: false, 12 | maxEntrypointSize: 512000, 13 | maxAssetSize: 512000, 14 | }, 15 | devServer: { 16 | static: { 17 | directory: path.join(__dirname, 'public'), 18 | }, 19 | compress: true, 20 | port: 3000, 21 | }, 22 | module: { 23 | rules: [ 24 | { 25 | test: /\.(js)$/, 26 | use: 'babel-loader', 27 | }, 28 | { 29 | test: /\.css$/, 30 | use: ['style-loader', 'css-loader'], 31 | }, 32 | { 33 | test: /\.(png|svg|jpg|jpeg|gif)$/i, 34 | 35 | type: 'asset/resource', 36 | }, 37 | // { 38 | // test: /\.svg$/, 39 | // use: [ 40 | // { 41 | // loader: 'svg-url-loader', 42 | // options: { 43 | // limit: 10000, 44 | // }, 45 | // }, 46 | // ], 47 | // }, 48 | { 49 | test: /\.m?js/, 50 | resolve: { 51 | fullySpecified: false, 52 | }, 53 | }, 54 | { 55 | test: /\.mp3$/, 56 | loader: 'file-loader', 57 | }, 58 | ], 59 | }, 60 | mode: 'development', 61 | experiments: { 62 | topLevelAwait: true, 63 | }, 64 | plugins: [ 65 | new HtmlWebpackPlugin({ 66 | template: 'public/index.html', 67 | // favicon: './src/favicon.ico', 68 | }), 69 | ], 70 | }; 71 | -------------------------------------------------------------------------------- /src/amazon-chime-sdk-meeting-with-live-connector.ts: -------------------------------------------------------------------------------- 1 | import { App, Stack, StackProps, CfnOutput } from 'aws-cdk-lib'; 2 | import { Construct } from 'constructs'; 3 | import { Site, Infrastructure } from './index'; 4 | 5 | export class AmazonChimeSDKWithLiveConnector extends Stack { 6 | constructor(scope: Construct, id: string, props: StackProps = {}) { 7 | super(scope, id, props); 8 | 9 | const infrastructure = new Infrastructure(this, 'infrastructure'); 10 | 11 | const site = new Site(this, 'Site', { apiUrl: infrastructure.apiUrl }); 12 | 13 | new CfnOutput(this, 'distribution', { 14 | value: site.distribution.domainName, 15 | }); 16 | 17 | new CfnOutput(this, 'siteBucket', { value: site.siteBucket.bucketName }); 18 | } 19 | } 20 | const devEnv = { 21 | account: process.env.CDK_DEFAULT_ACCOUNT, 22 | region: process.env.CDK_DEFAULT_REGION, 23 | }; 24 | 25 | const app = new App(); 26 | 27 | new AmazonChimeSDKWithLiveConnector(app, 'AmazonChimeSDKWithLiveConnector', { 28 | env: devEnv, 29 | }); 30 | 31 | app.synth(); 32 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './infrastructure'; 2 | export * from './site'; 3 | -------------------------------------------------------------------------------- /src/infrastructure.ts: -------------------------------------------------------------------------------- 1 | import { Duration, RemovalPolicy, Stack } from 'aws-cdk-lib'; 2 | import { 3 | RestApi, 4 | LambdaIntegration, 5 | EndpointType, 6 | MethodLoggingLevel, 7 | } from 'aws-cdk-lib/aws-apigateway'; 8 | import { Table, AttributeType, BillingMode } from 'aws-cdk-lib/aws-dynamodb'; 9 | import { 10 | Role, 11 | ServicePrincipal, 12 | PolicyDocument, 13 | PolicyStatement, 14 | ManagedPolicy, 15 | } from 'aws-cdk-lib/aws-iam'; 16 | import { Architecture, Runtime } from 'aws-cdk-lib/aws-lambda'; 17 | import { NodejsFunction } from 'aws-cdk-lib/aws-lambda-nodejs'; 18 | import { Construct } from 'constructs'; 19 | 20 | export class Infrastructure extends Construct { 21 | public readonly apiUrl: string; 22 | constructor(scope: Construct, id: string) { 23 | super(scope, id); 24 | 25 | const meetingsTable = new Table(this, 'meetings', { 26 | partitionKey: { 27 | name: 'meetingId', 28 | type: AttributeType.STRING, 29 | }, 30 | removalPolicy: RemovalPolicy.DESTROY, 31 | timeToLiveAttribute: 'timeToLive', 32 | billingMode: BillingMode.PAY_PER_REQUEST, 33 | }); 34 | 35 | const infrastructureRole = new Role(this, 'infrastructureRole', { 36 | assumedBy: new ServicePrincipal('lambda.amazonaws.com'), 37 | inlinePolicies: { 38 | ['chimePolicy']: new PolicyDocument({ 39 | statements: [ 40 | new PolicyStatement({ 41 | resources: ['*'], 42 | actions: ['chime:*'], 43 | }), 44 | ], 45 | }), 46 | ['ivsPolicy']: new PolicyDocument({ 47 | statements: [ 48 | new PolicyStatement({ 49 | resources: ['*'], 50 | actions: ['ivs:CreateChannel', 'ivs:GetStream'], 51 | }), 52 | ], 53 | }), 54 | }, 55 | managedPolicies: [ 56 | ManagedPolicy.fromAwsManagedPolicyName( 57 | 'service-role/AWSLambdaBasicExecutionRole', 58 | ), 59 | ], 60 | }); 61 | 62 | const meetingLambda = new NodejsFunction(this, 'meetingLambda', { 63 | entry: 'src/resources/meetingInfo/meetingInfo.ts', 64 | bundling: { 65 | nodeModules: [ 66 | '@aws-sdk/client-chime-sdk-meetings', 67 | '@aws-sdk/lib-dynamodb', 68 | '@aws-sdk/client-dynamodb', 69 | '@aws-sdk/client-ivs', 70 | '@aws-sdk/client-chime-sdk-media-pipelines', 71 | ], 72 | }, 73 | handler: 'lambdaHandler', 74 | runtime: Runtime.NODEJS_16_X, 75 | architecture: Architecture.ARM_64, 76 | role: infrastructureRole, 77 | timeout: Duration.seconds(60), 78 | environment: { 79 | MEETINGS_TABLE: meetingsTable.tableName, 80 | AWS_ACCOUNT_ID: Stack.of(this).account, 81 | }, 82 | }); 83 | 84 | meetingsTable.grantReadWriteData(meetingLambda); 85 | 86 | const api = new RestApi(this, 'ChimeSDKMeetingAPI', { 87 | defaultCorsPreflightOptions: { 88 | allowHeaders: [ 89 | 'Content-Type', 90 | 'X-Amz-Date', 91 | 'Authorization', 92 | 'X-Api-Key', 93 | ], 94 | allowMethods: ['OPTIONS', 'POST'], 95 | allowCredentials: true, 96 | allowOrigins: ['*'], 97 | }, 98 | deployOptions: { 99 | loggingLevel: MethodLoggingLevel.INFO, 100 | dataTraceEnabled: true, 101 | }, 102 | endpointConfiguration: { 103 | types: [EndpointType.REGIONAL], 104 | }, 105 | }); 106 | 107 | const join = api.root.addResource('join'); 108 | const end = api.root.addResource('end'); 109 | const stream = api.root.addResource('stream'); 110 | 111 | const meetingIntegration = new LambdaIntegration(meetingLambda); 112 | 113 | join.addMethod('POST', meetingIntegration, {}); 114 | end.addMethod('POST', meetingIntegration, {}); 115 | stream.addMethod('POST', meetingIntegration, {}); 116 | 117 | this.apiUrl = api.url; 118 | } 119 | } 120 | -------------------------------------------------------------------------------- /src/resources/meetingInfo/meetingInfo.ts: -------------------------------------------------------------------------------- 1 | import { randomUUID } from 'crypto'; 2 | import { 3 | ChimeSDKMediaPipelinesClient, 4 | CreateMediaLiveConnectorPipelineCommand, 5 | CreateMediaLiveConnectorPipelineCommandInput, 6 | CreateMediaLiveConnectorPipelineCommandOutput, 7 | DeleteMediaPipelineCommand, 8 | } from '@aws-sdk/client-chime-sdk-media-pipelines'; 9 | import { 10 | ChimeSDKMeetingsClient, 11 | CreateAttendeeCommand, 12 | CreateMeetingCommand, 13 | CreateMeetingCommandInput, 14 | DeleteMeetingCommand, 15 | DeleteMeetingCommandOutput, 16 | Meeting, 17 | Attendee, 18 | CreateAttendeeCommandInput, 19 | } from '@aws-sdk/client-chime-sdk-meetings'; 20 | import { DynamoDBClient } from '@aws-sdk/client-dynamodb'; 21 | import { 22 | IvsClient, 23 | CreateChannelCommand, 24 | GetStreamCommand, 25 | CreateChannelCommandOutput, 26 | GetStreamCommandOutput, 27 | } from '@aws-sdk/client-ivs'; 28 | import { 29 | DynamoDBDocumentClient, 30 | ScanCommand, 31 | PutCommand, 32 | DeleteCommandInput, 33 | DeleteCommandOutput, 34 | DeleteCommand, 35 | } from '@aws-sdk/lib-dynamodb'; 36 | const ddbClient = new DynamoDBClient({ region: 'us-east-1' }); 37 | const marshallOptions = { 38 | convertEmptyValues: false, 39 | removeUndefinedValues: true, 40 | convertClassInstanceToMap: false, 41 | }; 42 | const unmarshallOptions = { 43 | wrapNumbers: false, 44 | }; 45 | const translateConfig = { marshallOptions, unmarshallOptions }; 46 | const ddbDocClient = DynamoDBDocumentClient.from(ddbClient, translateConfig); 47 | import { APIGatewayProxyResult, APIGatewayEvent } from 'aws-lambda'; 48 | const ivsClient = new IvsClient({ region: 'us-east-1' }); 49 | const chimeSdkMediaPipelineclient = new ChimeSDKMediaPipelinesClient({ 50 | region: 'us-east-1', 51 | }); 52 | const chimeSdkMeetings = new ChimeSDKMeetingsClient({ 53 | region: 'us-east-1', 54 | }); 55 | 56 | var meetingInfoTable = process.env.MEETINGS_TABLE; 57 | var awsAccountId = process.env.AWS_ACCOUNT_ID; 58 | 59 | var createMeetingCommandInput: CreateMeetingCommandInput = { 60 | ClientRequestToken: '', 61 | ExternalMeetingId: '', 62 | MediaRegion: 'us-east-1', 63 | }; 64 | 65 | var createAttendeeCommandInput: CreateAttendeeCommandInput = { 66 | MeetingId: '', 67 | ExternalUserId: '', 68 | }; 69 | 70 | interface JoinInfo { 71 | Meeting: Meeting; 72 | Attendee: Array; 73 | } 74 | 75 | var createMediaLiveConnectorPipelineCommandInput: CreateMediaLiveConnectorPipelineCommandInput = 76 | { 77 | Sources: [ 78 | { 79 | SourceType: 'ChimeSdkMeeting', 80 | ChimeSdkMeetingLiveConnectorConfiguration: { 81 | Arn: '', 82 | MuxType: 'AudioWithCompositedVideo', 83 | CompositedVideo: { 84 | Layout: 'GridView', 85 | Resolution: 'FHD', 86 | GridViewConfiguration: { 87 | ContentShareLayout: 'Horizontal', 88 | }, 89 | }, 90 | }, 91 | }, 92 | ], 93 | Sinks: [ 94 | { 95 | SinkType: 'RTMP', 96 | RTMPConfiguration: { 97 | Url: '', 98 | AudioChannels: 'Stereo', 99 | AudioSampleRate: '48000', 100 | }, 101 | }, 102 | ], 103 | }; 104 | 105 | var response: APIGatewayProxyResult = { 106 | statusCode: 200, 107 | body: '', 108 | headers: { 109 | 'Access-Control-Allow-Origin': '*', 110 | 'Access-Control-Allow-Headers': '*', 111 | 'Access-Control-Allow-Methods': 'POST, OPTIONS', 112 | 'Content-Type': 'application/json', 113 | }, 114 | }; 115 | 116 | export const lambdaHandler = async ( 117 | event: APIGatewayEvent, 118 | ): Promise => { 119 | console.info(event); 120 | 121 | switch (event.path) { 122 | case '/join': 123 | console.log('Joining Meeting'); 124 | return meetingRequest(); 125 | case '/end': 126 | console.log('Ending Meeting'); 127 | return endRequest(event); 128 | case '/stream': 129 | console.log('Streaming'); 130 | return streamRequest(event); 131 | default: 132 | return response; 133 | } 134 | }; 135 | 136 | async function endRequest(event: APIGatewayEvent) { 137 | if (event.body) { 138 | const body = JSON.parse(event.body); 139 | console.log(`Deleting Meeting ${body.meetingId}`); 140 | const deleteMeetingResponse: DeleteMeetingCommandOutput = 141 | await chimeSdkMeetings.send( 142 | new DeleteMeetingCommand({ MeetingId: body.meetingId }), 143 | ); 144 | console.log( 145 | `DeleteMeetingResponse: ${JSON.stringify(deleteMeetingResponse)}`, 146 | ); 147 | const deleteCommandParams: DeleteCommandInput = { 148 | TableName: meetingInfoTable, 149 | Key: { meetingId: body.meetingId }, 150 | }; 151 | console.log(`Deleting Meeting from DynamoDB ${deleteCommandParams}`); 152 | const deleteItemResponse: DeleteCommandOutput = await ddbDocClient.send( 153 | new DeleteCommand(deleteCommandParams), 154 | ); 155 | console.log(JSON.stringify(`DeleteItemResponse: ${deleteItemResponse}`)); 156 | 157 | response.body = JSON.stringify('Meeting Deleted'); 158 | response.statusCode = 200; 159 | return response; 160 | } else { 161 | response.body = JSON.stringify('Meeting not found'); 162 | response.statusCode = 404; 163 | return response; 164 | } 165 | } 166 | 167 | async function streamRequest(event: APIGatewayEvent) { 168 | if (event.body) { 169 | let meetingId: string = JSON.parse(event.body).meetingId || ''; 170 | let streamAction: string = JSON.parse(event.body).streamAction || ''; 171 | let mediaPipelineId: string = JSON.parse(event.body).mediaPipelineId || ''; 172 | console.log(`streamAction: ${streamAction}`); 173 | console.log(`mediaPipelineId: ${mediaPipelineId}`); 174 | console.log(`meetingId: ${meetingId}`); 175 | if (streamAction == 'delete') { 176 | console.log('Deleting Stream'); 177 | return deleteStream(mediaPipelineId); 178 | } else { 179 | console.log(`Creating Stream for Meeting ${meetingId}`); 180 | return createStream(meetingId); 181 | } 182 | } 183 | response.statusCode = 503; 184 | return response; 185 | } 186 | 187 | async function createStream(meetingId: string) { 188 | const createChannelResponse: CreateChannelCommandOutput = 189 | await ivsClient.send(new CreateChannelCommand({ latencyMode: 'NORMAL' })); 190 | console.log( 191 | `createChannelResponse: ${JSON.stringify(createChannelResponse)}`, 192 | ); 193 | if ( 194 | createChannelResponse && 195 | createChannelResponse.channel && 196 | createChannelResponse.streamKey 197 | ) { 198 | createMediaLiveConnectorPipelineCommandInput!.Sources![0]!.ChimeSdkMeetingLiveConnectorConfiguration!.Arn = `arn:aws:chime::${awsAccountId}:meeting:${meetingId}`; 199 | createMediaLiveConnectorPipelineCommandInput!.Sinks![0]!.RTMPConfiguration!.Url = `rtmps://${createChannelResponse.channel.ingestEndpoint}:443/app/${createChannelResponse.streamKey.value}`; 200 | 201 | console.log( 202 | `CreateMediaCapturePipelineCommandInput: ${JSON.stringify( 203 | createMediaLiveConnectorPipelineCommandInput, 204 | )}`, 205 | ); 206 | 207 | const createPipelineResponse: CreateMediaLiveConnectorPipelineCommandOutput = 208 | await chimeSdkMediaPipelineclient.send( 209 | new CreateMediaLiveConnectorPipelineCommand( 210 | createMediaLiveConnectorPipelineCommandInput, 211 | ), 212 | ); 213 | console.log( 214 | `CreatePipelineResponse: ${JSON.stringify(createPipelineResponse)}`, 215 | ); 216 | if ( 217 | createPipelineResponse && 218 | createPipelineResponse.MediaLiveConnectorPipeline 219 | ) { 220 | const getStreamResponse: GetStreamCommandOutput | null = 221 | await checkForStream(createChannelResponse); 222 | console.log(`getStreamResponse: ${JSON.stringify(getStreamResponse)}`); 223 | if (getStreamResponse && getStreamResponse.stream) { 224 | response.body = JSON.stringify({ 225 | mediaPipelineId: 226 | createPipelineResponse.MediaLiveConnectorPipeline.MediaPipelineId, 227 | playbackUrl: getStreamResponse.stream.playbackUrl, 228 | }); 229 | 230 | response.statusCode = 200; 231 | console.info('streamInfo: ' + JSON.stringify(response)); 232 | return response; 233 | } 234 | } 235 | } 236 | response.statusCode = 503; 237 | return response; 238 | } 239 | 240 | async function deleteStream(mediaPipelineId: string) { 241 | try { 242 | const deletePipelineResponse = await chimeSdkMediaPipelineclient.send( 243 | new DeleteMediaPipelineCommand({ 244 | MediaPipelineId: mediaPipelineId, 245 | }), 246 | ); 247 | console.log( 248 | `DeletePipelineResponse: ${JSON.stringify(deletePipelineResponse)}`, 249 | ); 250 | 251 | response.statusCode = 200; 252 | return response; 253 | } catch (err) { 254 | response.statusCode = 503; 255 | return response; 256 | } 257 | } 258 | 259 | async function meetingRequest() { 260 | const currentMeetings = await checkForMeetings(); 261 | if (currentMeetings) { 262 | for (let meeting of currentMeetings) { 263 | if (meeting.joinInfo.Attendee.length < 2) { 264 | console.log( 265 | `Adding an attendee to an existing meeting: ${meeting.meetingId}`, 266 | ); 267 | const attendeeInfo = await createAttendee(meeting.meetingId); 268 | console.log(`attendeeInfo: ${JSON.stringify(attendeeInfo)}`); 269 | meeting.joinInfo.Attendee.push(attendeeInfo.Attendee); 270 | await putMeetingInfo(meeting.joinInfo); 271 | 272 | const responseInfo = { 273 | Meeting: meeting.joinInfo.Meeting, 274 | Attendee: attendeeInfo.Attendee, 275 | }; 276 | 277 | response.statusCode = 200; 278 | response.body = JSON.stringify(responseInfo); 279 | console.info('joinInfo: ' + JSON.stringify(response)); 280 | return response; 281 | } 282 | } 283 | } 284 | 285 | const meetingInfo = await createMeeting(); 286 | if (meetingInfo && meetingInfo.Meeting && meetingInfo.Meeting.MeetingId) { 287 | const attendeeInfo = await createAttendee(meetingInfo.Meeting.MeetingId); 288 | if (attendeeInfo && attendeeInfo.Attendee) { 289 | const joinInfo: JoinInfo = { 290 | Meeting: meetingInfo.Meeting, 291 | Attendee: [attendeeInfo.Attendee], 292 | }; 293 | await putMeetingInfo(joinInfo); 294 | 295 | const responseInfo = { 296 | Meeting: meetingInfo.Meeting, 297 | Attendee: attendeeInfo.Attendee, 298 | }; 299 | 300 | response.statusCode = 200; 301 | response.body = JSON.stringify(responseInfo); 302 | console.info('joinInfo: ' + JSON.stringify(response)); 303 | return response; 304 | } 305 | } 306 | response.statusCode = 503; 307 | return response; 308 | } 309 | 310 | async function checkForStream( 311 | createChannelResponse: CreateChannelCommandOutput, 312 | ) { 313 | console.log('Checking for Stream'); 314 | console.log( 315 | `createChannelResponse: ${JSON.stringify(createChannelResponse)}`, 316 | ); 317 | if (createChannelResponse.channel && createChannelResponse.channel.arn) { 318 | for (var m = 0; m < 5; m++) { 319 | await new Promise((resolve) => setTimeout(resolve, 5000)); 320 | try { 321 | var getStreamResponse = await ivsClient.send( 322 | new GetStreamCommand({ 323 | channelArn: createChannelResponse.channel.arn, 324 | }), 325 | ); 326 | console.log(`getStreamResponse: ${JSON.stringify(getStreamResponse)}`); 327 | console.log(`Loop: ${m}`); 328 | 329 | if (getStreamResponse) { 330 | return getStreamResponse; 331 | } 332 | } catch (err) { 333 | console.log('No Stream'); 334 | console.log(`Loop: ${m}`); 335 | console.log(`Error: ${err}`); 336 | continue; 337 | } 338 | } 339 | return null; 340 | } 341 | return null; 342 | } 343 | 344 | async function createMeeting() { 345 | console.log('Creating Meeting'); 346 | createMeetingCommandInput.ClientRequestToken = randomUUID(); 347 | createMeetingCommandInput.ExternalMeetingId = randomUUID(); 348 | const meetingInfo = await chimeSdkMeetings.send( 349 | new CreateMeetingCommand(createMeetingCommandInput), 350 | ); 351 | console.info(`Meeting Info: ${JSON.stringify(meetingInfo)}`); 352 | return meetingInfo; 353 | } 354 | 355 | async function createAttendee(meetingId: string) { 356 | console.log(`Creating Attendee for Meeting: ${meetingId}`); 357 | createAttendeeCommandInput.MeetingId = meetingId; 358 | createAttendeeCommandInput.ExternalUserId = randomUUID(); 359 | const attendeeInfo = await chimeSdkMeetings.send( 360 | new CreateAttendeeCommand(createAttendeeCommandInput), 361 | ); 362 | return attendeeInfo; 363 | } 364 | async function putMeetingInfo(joinInfo: JoinInfo) { 365 | var timeToLive = new Date(); 366 | timeToLive.setMinutes(timeToLive.getMinutes() + 5); 367 | const putMeetingInfoInput = { 368 | TableName: meetingInfoTable, 369 | Item: { 370 | meetingId: joinInfo.Meeting.MeetingId, 371 | joinInfo, 372 | timeToLive: timeToLive.getTime() / 1e3, 373 | }, 374 | }; 375 | console.log(`info to put: ${JSON.stringify(putMeetingInfoInput)}`); 376 | try { 377 | const data = await ddbDocClient.send(new PutCommand(putMeetingInfoInput)); 378 | console.log('Success - item added or updated', data); 379 | return data; 380 | } catch (err) { 381 | console.log('Error', err); 382 | return false; 383 | } 384 | } 385 | async function checkForMeetings() { 386 | const scanMeetingInfo = { 387 | TableName: meetingInfoTable, 388 | FilterExpression: 'timeToLive >= :currentEpoch', 389 | ExpressionAttributeValues: { 390 | ':currentEpoch': Date.now() / 1e3, 391 | }, 392 | }; 393 | try { 394 | const data = await ddbDocClient.send(new ScanCommand(scanMeetingInfo)); 395 | console.log(data); 396 | return data.Items; 397 | } catch (err) { 398 | console.log('Error', err); 399 | return false; 400 | } 401 | } 402 | -------------------------------------------------------------------------------- /src/site.ts: -------------------------------------------------------------------------------- 1 | import { execSync, ExecSyncOptions } from 'child_process'; 2 | import { RemovalPolicy, DockerImage } from 'aws-cdk-lib'; 3 | import { 4 | Distribution, 5 | SecurityPolicyProtocol, 6 | CachePolicy, 7 | ViewerProtocolPolicy, 8 | } from 'aws-cdk-lib/aws-cloudfront'; 9 | import { S3Origin } from 'aws-cdk-lib/aws-cloudfront-origins'; 10 | import { Bucket } from 'aws-cdk-lib/aws-s3'; 11 | import { Source, BucketDeployment } from 'aws-cdk-lib/aws-s3-deployment'; 12 | import { Construct } from 'constructs'; 13 | import { copySync } from 'fs-extra'; 14 | 15 | interface SiteProps { 16 | apiUrl: string; 17 | } 18 | 19 | export class Site extends Construct { 20 | public readonly siteBucket: Bucket; 21 | public readonly distribution: Distribution; 22 | 23 | constructor(scope: Construct, id: string, props: SiteProps) { 24 | super(scope, id); 25 | 26 | this.siteBucket = new Bucket(this, 'websiteBucket', { 27 | publicReadAccess: false, 28 | removalPolicy: RemovalPolicy.DESTROY, 29 | autoDeleteObjects: true, 30 | }); 31 | 32 | this.distribution = new Distribution(this, 'CloudfrontDistribution', { 33 | enableLogging: true, 34 | minimumProtocolVersion: SecurityPolicyProtocol.TLS_V1_2_2021, 35 | defaultBehavior: { 36 | origin: new S3Origin(this.siteBucket), 37 | viewerProtocolPolicy: ViewerProtocolPolicy.REDIRECT_TO_HTTPS, 38 | cachePolicy: CachePolicy.CACHING_DISABLED, 39 | }, 40 | defaultRootObject: 'index.html', 41 | }); 42 | const execOptions: ExecSyncOptions = { stdio: 'inherit' }; 43 | 44 | const bundle = Source.asset('./site', { 45 | bundling: { 46 | command: [ 47 | 'sh', 48 | '-c', 49 | 'echo "Docker build not supported. Please install esbuild."', 50 | ], 51 | image: DockerImage.fromRegistry('alpine'), 52 | local: { 53 | tryBundle(outputDir: string) { 54 | try { 55 | execSync('esbuild --version', execOptions); 56 | } catch { 57 | /* istanbul ignore next */ 58 | return false; 59 | } 60 | execSync( 61 | 'cd site && yarn install --frozen-lockfile && yarn build', 62 | execOptions, 63 | ); 64 | copySync('./site/dist', outputDir, { 65 | ...execOptions, 66 | recursive: true, 67 | }); 68 | return true; 69 | }, 70 | }, 71 | }, 72 | }); 73 | 74 | const config = { 75 | apiUrl: props.apiUrl, 76 | }; 77 | 78 | new BucketDeployment(this, 'DeployBucket', { 79 | sources: [bundle, Source.jsonData('config.json', config)], 80 | destinationBucket: this.siteBucket, 81 | distribution: this.distribution, 82 | distributionPaths: ['/*'], 83 | }); 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /test/__snapshots__/main.test.ts.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Snapshot 1`] = ` 4 | Object { 5 | "Outputs": Object { 6 | "distribution": Object { 7 | "Value": Object { 8 | "Fn::GetAtt": Array [ 9 | "SiteCloudfrontDistribution0794B6B8", 10 | "DomainName", 11 | ], 12 | }, 13 | }, 14 | "infrastructureChimeSDKMeetingAPIEndpointA3077C32": Object { 15 | "Value": Object { 16 | "Fn::Join": Array [ 17 | "", 18 | Array [ 19 | "https://", 20 | Object { 21 | "Ref": "infrastructureChimeSDKMeetingAPI0524B384", 22 | }, 23 | ".execute-api.", 24 | Object { 25 | "Ref": "AWS::Region", 26 | }, 27 | ".", 28 | Object { 29 | "Ref": "AWS::URLSuffix", 30 | }, 31 | "/", 32 | Object { 33 | "Ref": "infrastructureChimeSDKMeetingAPIDeploymentStageprodDDE3819A", 34 | }, 35 | "/", 36 | ], 37 | ], 38 | }, 39 | }, 40 | "siteBucket": Object { 41 | "Value": Object { 42 | "Ref": "SitewebsiteBucketBC20A569", 43 | }, 44 | }, 45 | }, 46 | "Parameters": Object { 47 | "BootstrapVersion": Object { 48 | "Default": "/cdk-bootstrap/hnb659fds/version", 49 | "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]", 50 | "Type": "AWS::SSM::Parameter::Value", 51 | }, 52 | }, 53 | "Resources": Object { 54 | "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C81C01536": Object { 55 | "DependsOn": Array [ 56 | "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756CServiceRoleDefaultPolicy88902FDF", 57 | "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756CServiceRole89A01265", 58 | ], 59 | "Properties": Object { 60 | "Code": Object { 61 | "S3Bucket": Object { 62 | "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", 63 | }, 64 | "S3Key": "2d56e153cac88d3e0c2f842e8e6f6783b8725bf91f95e0673b4725448a56e96d.zip", 65 | }, 66 | "Environment": Object { 67 | "Variables": Object { 68 | "AWS_CA_BUNDLE": "/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem", 69 | }, 70 | }, 71 | "Handler": "index.handler", 72 | "Layers": Array [ 73 | Object { 74 | "Ref": "SiteDeployBucketAwsCliLayerB1A3335C", 75 | }, 76 | ], 77 | "Role": Object { 78 | "Fn::GetAtt": Array [ 79 | "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756CServiceRole89A01265", 80 | "Arn", 81 | ], 82 | }, 83 | "Runtime": "python3.9", 84 | "Timeout": 900, 85 | }, 86 | "Type": "AWS::Lambda::Function", 87 | }, 88 | "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756CServiceRole89A01265": Object { 89 | "Properties": Object { 90 | "AssumeRolePolicyDocument": Object { 91 | "Statement": Array [ 92 | Object { 93 | "Action": "sts:AssumeRole", 94 | "Effect": "Allow", 95 | "Principal": Object { 96 | "Service": "lambda.amazonaws.com", 97 | }, 98 | }, 99 | ], 100 | "Version": "2012-10-17", 101 | }, 102 | "ManagedPolicyArns": Array [ 103 | Object { 104 | "Fn::Join": Array [ 105 | "", 106 | Array [ 107 | "arn:", 108 | Object { 109 | "Ref": "AWS::Partition", 110 | }, 111 | ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", 112 | ], 113 | ], 114 | }, 115 | ], 116 | }, 117 | "Type": "AWS::IAM::Role", 118 | }, 119 | "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756CServiceRoleDefaultPolicy88902FDF": Object { 120 | "Properties": Object { 121 | "PolicyDocument": Object { 122 | "Statement": Array [ 123 | Object { 124 | "Action": Array [ 125 | "s3:GetObject*", 126 | "s3:GetBucket*", 127 | "s3:List*", 128 | ], 129 | "Effect": "Allow", 130 | "Resource": Array [ 131 | Object { 132 | "Fn::Join": Array [ 133 | "", 134 | Array [ 135 | "arn:", 136 | Object { 137 | "Ref": "AWS::Partition", 138 | }, 139 | ":s3:::", 140 | Object { 141 | "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", 142 | }, 143 | ], 144 | ], 145 | }, 146 | Object { 147 | "Fn::Join": Array [ 148 | "", 149 | Array [ 150 | "arn:", 151 | Object { 152 | "Ref": "AWS::Partition", 153 | }, 154 | ":s3:::", 155 | Object { 156 | "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", 157 | }, 158 | "/*", 159 | ], 160 | ], 161 | }, 162 | ], 163 | }, 164 | Object { 165 | "Action": Array [ 166 | "s3:GetObject*", 167 | "s3:GetBucket*", 168 | "s3:List*", 169 | "s3:DeleteObject*", 170 | "s3:PutObject", 171 | "s3:PutObjectLegalHold", 172 | "s3:PutObjectRetention", 173 | "s3:PutObjectTagging", 174 | "s3:PutObjectVersionTagging", 175 | "s3:Abort*", 176 | ], 177 | "Effect": "Allow", 178 | "Resource": Array [ 179 | Object { 180 | "Fn::GetAtt": Array [ 181 | "SitewebsiteBucketBC20A569", 182 | "Arn", 183 | ], 184 | }, 185 | Object { 186 | "Fn::Join": Array [ 187 | "", 188 | Array [ 189 | Object { 190 | "Fn::GetAtt": Array [ 191 | "SitewebsiteBucketBC20A569", 192 | "Arn", 193 | ], 194 | }, 195 | "/*", 196 | ], 197 | ], 198 | }, 199 | ], 200 | }, 201 | Object { 202 | "Action": Array [ 203 | "cloudfront:GetInvalidation", 204 | "cloudfront:CreateInvalidation", 205 | ], 206 | "Effect": "Allow", 207 | "Resource": "*", 208 | }, 209 | ], 210 | "Version": "2012-10-17", 211 | }, 212 | "PolicyName": "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756CServiceRoleDefaultPolicy88902FDF", 213 | "Roles": Array [ 214 | Object { 215 | "Ref": "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756CServiceRole89A01265", 216 | }, 217 | ], 218 | }, 219 | "Type": "AWS::IAM::Policy", 220 | }, 221 | "CustomS3AutoDeleteObjectsCustomResourceProviderHandler9D90184F": Object { 222 | "DependsOn": Array [ 223 | "CustomS3AutoDeleteObjectsCustomResourceProviderRole3B1BD092", 224 | ], 225 | "Properties": Object { 226 | "Code": Object { 227 | "S3Bucket": Object { 228 | "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", 229 | }, 230 | "S3Key": "6c1e9b465fa4b2d651dbc9ce3e732d8702a7b19137327684a71d89f1d355f1a2.zip", 231 | }, 232 | "Description": Object { 233 | "Fn::Join": Array [ 234 | "", 235 | Array [ 236 | "Lambda function for auto-deleting objects in ", 237 | Object { 238 | "Ref": "SitewebsiteBucketBC20A569", 239 | }, 240 | " S3 bucket.", 241 | ], 242 | ], 243 | }, 244 | "Handler": "index.handler", 245 | "MemorySize": 128, 246 | "Role": Object { 247 | "Fn::GetAtt": Array [ 248 | "CustomS3AutoDeleteObjectsCustomResourceProviderRole3B1BD092", 249 | "Arn", 250 | ], 251 | }, 252 | "Runtime": "nodejs18.x", 253 | "Timeout": 900, 254 | }, 255 | "Type": "AWS::Lambda::Function", 256 | }, 257 | "CustomS3AutoDeleteObjectsCustomResourceProviderRole3B1BD092": Object { 258 | "Properties": Object { 259 | "AssumeRolePolicyDocument": Object { 260 | "Statement": Array [ 261 | Object { 262 | "Action": "sts:AssumeRole", 263 | "Effect": "Allow", 264 | "Principal": Object { 265 | "Service": "lambda.amazonaws.com", 266 | }, 267 | }, 268 | ], 269 | "Version": "2012-10-17", 270 | }, 271 | "ManagedPolicyArns": Array [ 272 | Object { 273 | "Fn::Sub": "arn:\${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", 274 | }, 275 | ], 276 | }, 277 | "Type": "AWS::IAM::Role", 278 | }, 279 | "SiteCloudfrontDistribution0794B6B8": Object { 280 | "Properties": Object { 281 | "DistributionConfig": Object { 282 | "DefaultCacheBehavior": Object { 283 | "CachePolicyId": "4135ea2d-6df8-44a3-9df3-4b5a84be39ad", 284 | "Compress": true, 285 | "TargetOriginId": "AmazonChimeSDKWithLiveConnectorSiteCloudfrontDistributionOrigin1F54AE78F", 286 | "ViewerProtocolPolicy": "redirect-to-https", 287 | }, 288 | "DefaultRootObject": "index.html", 289 | "Enabled": true, 290 | "HttpVersion": "http2", 291 | "IPV6Enabled": true, 292 | "Logging": Object { 293 | "Bucket": Object { 294 | "Fn::GetAtt": Array [ 295 | "SiteCloudfrontDistributionLoggingBucket0054AC66", 296 | "RegionalDomainName", 297 | ], 298 | }, 299 | }, 300 | "Origins": Array [ 301 | Object { 302 | "DomainName": Object { 303 | "Fn::GetAtt": Array [ 304 | "SitewebsiteBucketBC20A569", 305 | "RegionalDomainName", 306 | ], 307 | }, 308 | "Id": "AmazonChimeSDKWithLiveConnectorSiteCloudfrontDistributionOrigin1F54AE78F", 309 | "S3OriginConfig": Object { 310 | "OriginAccessIdentity": Object { 311 | "Fn::Join": Array [ 312 | "", 313 | Array [ 314 | "origin-access-identity/cloudfront/", 315 | Object { 316 | "Ref": "SiteCloudfrontDistributionOrigin1S3Origin4F2AB6D1", 317 | }, 318 | ], 319 | ], 320 | }, 321 | }, 322 | }, 323 | ], 324 | }, 325 | }, 326 | "Type": "AWS::CloudFront::Distribution", 327 | }, 328 | "SiteCloudfrontDistributionLoggingBucket0054AC66": Object { 329 | "DeletionPolicy": "Retain", 330 | "Properties": Object { 331 | "BucketEncryption": Object { 332 | "ServerSideEncryptionConfiguration": Array [ 333 | Object { 334 | "ServerSideEncryptionByDefault": Object { 335 | "SSEAlgorithm": "AES256", 336 | }, 337 | }, 338 | ], 339 | }, 340 | "OwnershipControls": Object { 341 | "Rules": Array [ 342 | Object { 343 | "ObjectOwnership": "ObjectWriter", 344 | }, 345 | ], 346 | }, 347 | }, 348 | "Type": "AWS::S3::Bucket", 349 | "UpdateReplacePolicy": "Retain", 350 | }, 351 | "SiteCloudfrontDistributionOrigin1S3Origin4F2AB6D1": Object { 352 | "Properties": Object { 353 | "CloudFrontOriginAccessIdentityConfig": Object { 354 | "Comment": "Identity for AmazonChimeSDKWithLiveConnectorSiteCloudfrontDistributionOrigin1F54AE78F", 355 | }, 356 | }, 357 | "Type": "AWS::CloudFront::CloudFrontOriginAccessIdentity", 358 | }, 359 | "SiteDeployBucketAwsCliLayerB1A3335C": Object { 360 | "Properties": Object { 361 | "Content": Object { 362 | "S3Bucket": Object { 363 | "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", 364 | }, 365 | "S3Key": "3322b7049fb0ed2b7cbb644a2ada8d1116ff80c32dca89e6ada846b5de26f961.zip", 366 | }, 367 | "Description": "/opt/awscli/aws", 368 | }, 369 | "Type": "AWS::Lambda::LayerVersion", 370 | }, 371 | "SiteDeployBucketCustomResource08EC962A": Object { 372 | "DeletionPolicy": "Delete", 373 | "Properties": Object { 374 | "DestinationBucketName": Object { 375 | "Ref": "SitewebsiteBucketBC20A569", 376 | }, 377 | "DistributionId": Object { 378 | "Ref": "SiteCloudfrontDistribution0794B6B8", 379 | }, 380 | "DistributionPaths": Array [ 381 | "/*", 382 | ], 383 | "Prune": true, 384 | "ServiceToken": Object { 385 | "Fn::GetAtt": Array [ 386 | "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C81C01536", 387 | "Arn", 388 | ], 389 | }, 390 | "SourceBucketNames": Array [ 391 | Object { 392 | "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", 393 | }, 394 | Object { 395 | "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", 396 | }, 397 | ], 398 | "SourceMarkers": Array [ 399 | Object {}, 400 | Object { 401 | "<>": Object { 402 | "Ref": "infrastructureChimeSDKMeetingAPI0524B384", 403 | }, 404 | "<>": Object { 405 | "Ref": "AWS::Region", 406 | }, 407 | "<>": Object { 408 | "Ref": "AWS::URLSuffix", 409 | }, 410 | "<>": Object { 411 | "Ref": "infrastructureChimeSDKMeetingAPIDeploymentStageprodDDE3819A", 412 | }, 413 | }, 414 | ], 415 | "SourceObjectKeys": Array [ 416 | "c6d91cf0bb243865d6d085eb571ccf652cfc36c87dc6f19fb32babbe379b73c2.zip", 417 | "54db0af5da74dab89a93c249167c5b162223925d4c9385ff9262a09b67c99244.zip", 418 | ], 419 | }, 420 | "Type": "Custom::CDKBucketDeployment", 421 | "UpdateReplacePolicy": "Delete", 422 | }, 423 | "SitewebsiteBucketAutoDeleteObjectsCustomResourceB62EAF63": Object { 424 | "DeletionPolicy": "Delete", 425 | "DependsOn": Array [ 426 | "SitewebsiteBucketPolicyC20F0243", 427 | ], 428 | "Properties": Object { 429 | "BucketName": Object { 430 | "Ref": "SitewebsiteBucketBC20A569", 431 | }, 432 | "ServiceToken": Object { 433 | "Fn::GetAtt": Array [ 434 | "CustomS3AutoDeleteObjectsCustomResourceProviderHandler9D90184F", 435 | "Arn", 436 | ], 437 | }, 438 | }, 439 | "Type": "Custom::S3AutoDeleteObjects", 440 | "UpdateReplacePolicy": "Delete", 441 | }, 442 | "SitewebsiteBucketBC20A569": Object { 443 | "DeletionPolicy": "Delete", 444 | "Properties": Object { 445 | "Tags": Array [ 446 | Object { 447 | "Key": "aws-cdk:auto-delete-objects", 448 | "Value": "true", 449 | }, 450 | Object { 451 | "Key": "aws-cdk:cr-owned:a2643d0d", 452 | "Value": "true", 453 | }, 454 | ], 455 | }, 456 | "Type": "AWS::S3::Bucket", 457 | "UpdateReplacePolicy": "Delete", 458 | }, 459 | "SitewebsiteBucketPolicyC20F0243": Object { 460 | "Properties": Object { 461 | "Bucket": Object { 462 | "Ref": "SitewebsiteBucketBC20A569", 463 | }, 464 | "PolicyDocument": Object { 465 | "Statement": Array [ 466 | Object { 467 | "Action": Array [ 468 | "s3:PutBucketPolicy", 469 | "s3:GetBucket*", 470 | "s3:List*", 471 | "s3:DeleteObject*", 472 | ], 473 | "Effect": "Allow", 474 | "Principal": Object { 475 | "AWS": Object { 476 | "Fn::GetAtt": Array [ 477 | "CustomS3AutoDeleteObjectsCustomResourceProviderRole3B1BD092", 478 | "Arn", 479 | ], 480 | }, 481 | }, 482 | "Resource": Array [ 483 | Object { 484 | "Fn::GetAtt": Array [ 485 | "SitewebsiteBucketBC20A569", 486 | "Arn", 487 | ], 488 | }, 489 | Object { 490 | "Fn::Join": Array [ 491 | "", 492 | Array [ 493 | Object { 494 | "Fn::GetAtt": Array [ 495 | "SitewebsiteBucketBC20A569", 496 | "Arn", 497 | ], 498 | }, 499 | "/*", 500 | ], 501 | ], 502 | }, 503 | ], 504 | }, 505 | Object { 506 | "Action": "s3:GetObject", 507 | "Effect": "Allow", 508 | "Principal": Object { 509 | "CanonicalUser": Object { 510 | "Fn::GetAtt": Array [ 511 | "SiteCloudfrontDistributionOrigin1S3Origin4F2AB6D1", 512 | "S3CanonicalUserId", 513 | ], 514 | }, 515 | }, 516 | "Resource": Object { 517 | "Fn::Join": Array [ 518 | "", 519 | Array [ 520 | Object { 521 | "Fn::GetAtt": Array [ 522 | "SitewebsiteBucketBC20A569", 523 | "Arn", 524 | ], 525 | }, 526 | "/*", 527 | ], 528 | ], 529 | }, 530 | }, 531 | ], 532 | "Version": "2012-10-17", 533 | }, 534 | }, 535 | "Type": "AWS::S3::BucketPolicy", 536 | }, 537 | "infrastructureChimeSDKMeetingAPI0524B384": Object { 538 | "Properties": Object { 539 | "EndpointConfiguration": Object { 540 | "Types": Array [ 541 | "REGIONAL", 542 | ], 543 | }, 544 | "Name": "ChimeSDKMeetingAPI", 545 | }, 546 | "Type": "AWS::ApiGateway::RestApi", 547 | }, 548 | "infrastructureChimeSDKMeetingAPIAccount6336B0F1": Object { 549 | "DeletionPolicy": "Retain", 550 | "DependsOn": Array [ 551 | "infrastructureChimeSDKMeetingAPI0524B384", 552 | ], 553 | "Properties": Object { 554 | "CloudWatchRoleArn": Object { 555 | "Fn::GetAtt": Array [ 556 | "infrastructureChimeSDKMeetingAPICloudWatchRole61899E44", 557 | "Arn", 558 | ], 559 | }, 560 | }, 561 | "Type": "AWS::ApiGateway::Account", 562 | "UpdateReplacePolicy": "Retain", 563 | }, 564 | "infrastructureChimeSDKMeetingAPICloudWatchRole61899E44": Object { 565 | "DeletionPolicy": "Retain", 566 | "Properties": Object { 567 | "AssumeRolePolicyDocument": Object { 568 | "Statement": Array [ 569 | Object { 570 | "Action": "sts:AssumeRole", 571 | "Effect": "Allow", 572 | "Principal": Object { 573 | "Service": "apigateway.amazonaws.com", 574 | }, 575 | }, 576 | ], 577 | "Version": "2012-10-17", 578 | }, 579 | "ManagedPolicyArns": Array [ 580 | Object { 581 | "Fn::Join": Array [ 582 | "", 583 | Array [ 584 | "arn:", 585 | Object { 586 | "Ref": "AWS::Partition", 587 | }, 588 | ":iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs", 589 | ], 590 | ], 591 | }, 592 | ], 593 | }, 594 | "Type": "AWS::IAM::Role", 595 | "UpdateReplacePolicy": "Retain", 596 | }, 597 | "infrastructureChimeSDKMeetingAPIDeploymentBBBB89967b59bd24ec42caabf277b5daa4ea10f0": Object { 598 | "DependsOn": Array [ 599 | "infrastructureChimeSDKMeetingAPIendOPTIONS531B838C", 600 | "infrastructureChimeSDKMeetingAPIendPOSTE9B3F16A", 601 | "infrastructureChimeSDKMeetingAPIend5647DEB6", 602 | "infrastructureChimeSDKMeetingAPIjoinOPTIONS7CC1A74F", 603 | "infrastructureChimeSDKMeetingAPIjoinPOST7D618D65", 604 | "infrastructureChimeSDKMeetingAPIjoin290CDE2D", 605 | "infrastructureChimeSDKMeetingAPIOPTIONS0F18E938", 606 | "infrastructureChimeSDKMeetingAPIstreamOPTIONS267A1BAB", 607 | "infrastructureChimeSDKMeetingAPIstreamPOSTB640DEF2", 608 | "infrastructureChimeSDKMeetingAPIstreamE28D3C2F", 609 | ], 610 | "Properties": Object { 611 | "Description": "Automatically created by the RestApi construct", 612 | "RestApiId": Object { 613 | "Ref": "infrastructureChimeSDKMeetingAPI0524B384", 614 | }, 615 | }, 616 | "Type": "AWS::ApiGateway::Deployment", 617 | }, 618 | "infrastructureChimeSDKMeetingAPIDeploymentStageprodDDE3819A": Object { 619 | "DependsOn": Array [ 620 | "infrastructureChimeSDKMeetingAPIAccount6336B0F1", 621 | ], 622 | "Properties": Object { 623 | "DeploymentId": Object { 624 | "Ref": "infrastructureChimeSDKMeetingAPIDeploymentBBBB89967b59bd24ec42caabf277b5daa4ea10f0", 625 | }, 626 | "MethodSettings": Array [ 627 | Object { 628 | "DataTraceEnabled": true, 629 | "HttpMethod": "*", 630 | "LoggingLevel": "INFO", 631 | "ResourcePath": "/*", 632 | }, 633 | ], 634 | "RestApiId": Object { 635 | "Ref": "infrastructureChimeSDKMeetingAPI0524B384", 636 | }, 637 | "StageName": "prod", 638 | }, 639 | "Type": "AWS::ApiGateway::Stage", 640 | }, 641 | "infrastructureChimeSDKMeetingAPIOPTIONS0F18E938": Object { 642 | "Properties": Object { 643 | "ApiKeyRequired": false, 644 | "AuthorizationType": "NONE", 645 | "HttpMethod": "OPTIONS", 646 | "Integration": Object { 647 | "IntegrationResponses": Array [ 648 | Object { 649 | "ResponseParameters": Object { 650 | "method.response.header.Access-Control-Allow-Credentials": "'true'", 651 | "method.response.header.Access-Control-Allow-Headers": "'Content-Type,X-Amz-Date,Authorization,X-Api-Key'", 652 | "method.response.header.Access-Control-Allow-Methods": "'OPTIONS,POST'", 653 | "method.response.header.Access-Control-Allow-Origin": "'*'", 654 | }, 655 | "StatusCode": "204", 656 | }, 657 | ], 658 | "RequestTemplates": Object { 659 | "application/json": "{ statusCode: 200 }", 660 | }, 661 | "Type": "MOCK", 662 | }, 663 | "MethodResponses": Array [ 664 | Object { 665 | "ResponseParameters": Object { 666 | "method.response.header.Access-Control-Allow-Credentials": true, 667 | "method.response.header.Access-Control-Allow-Headers": true, 668 | "method.response.header.Access-Control-Allow-Methods": true, 669 | "method.response.header.Access-Control-Allow-Origin": true, 670 | }, 671 | "StatusCode": "204", 672 | }, 673 | ], 674 | "ResourceId": Object { 675 | "Fn::GetAtt": Array [ 676 | "infrastructureChimeSDKMeetingAPI0524B384", 677 | "RootResourceId", 678 | ], 679 | }, 680 | "RestApiId": Object { 681 | "Ref": "infrastructureChimeSDKMeetingAPI0524B384", 682 | }, 683 | }, 684 | "Type": "AWS::ApiGateway::Method", 685 | }, 686 | "infrastructureChimeSDKMeetingAPIend5647DEB6": Object { 687 | "Properties": Object { 688 | "ParentId": Object { 689 | "Fn::GetAtt": Array [ 690 | "infrastructureChimeSDKMeetingAPI0524B384", 691 | "RootResourceId", 692 | ], 693 | }, 694 | "PathPart": "end", 695 | "RestApiId": Object { 696 | "Ref": "infrastructureChimeSDKMeetingAPI0524B384", 697 | }, 698 | }, 699 | "Type": "AWS::ApiGateway::Resource", 700 | }, 701 | "infrastructureChimeSDKMeetingAPIendOPTIONS531B838C": Object { 702 | "Properties": Object { 703 | "ApiKeyRequired": false, 704 | "AuthorizationType": "NONE", 705 | "HttpMethod": "OPTIONS", 706 | "Integration": Object { 707 | "IntegrationResponses": Array [ 708 | Object { 709 | "ResponseParameters": Object { 710 | "method.response.header.Access-Control-Allow-Credentials": "'true'", 711 | "method.response.header.Access-Control-Allow-Headers": "'Content-Type,X-Amz-Date,Authorization,X-Api-Key'", 712 | "method.response.header.Access-Control-Allow-Methods": "'OPTIONS,POST'", 713 | "method.response.header.Access-Control-Allow-Origin": "'*'", 714 | }, 715 | "StatusCode": "204", 716 | }, 717 | ], 718 | "RequestTemplates": Object { 719 | "application/json": "{ statusCode: 200 }", 720 | }, 721 | "Type": "MOCK", 722 | }, 723 | "MethodResponses": Array [ 724 | Object { 725 | "ResponseParameters": Object { 726 | "method.response.header.Access-Control-Allow-Credentials": true, 727 | "method.response.header.Access-Control-Allow-Headers": true, 728 | "method.response.header.Access-Control-Allow-Methods": true, 729 | "method.response.header.Access-Control-Allow-Origin": true, 730 | }, 731 | "StatusCode": "204", 732 | }, 733 | ], 734 | "ResourceId": Object { 735 | "Ref": "infrastructureChimeSDKMeetingAPIend5647DEB6", 736 | }, 737 | "RestApiId": Object { 738 | "Ref": "infrastructureChimeSDKMeetingAPI0524B384", 739 | }, 740 | }, 741 | "Type": "AWS::ApiGateway::Method", 742 | }, 743 | "infrastructureChimeSDKMeetingAPIendPOSTApiPermissionAmazonChimeSDKWithLiveConnectorinfrastructureChimeSDKMeetingAPID3917592POSTend482327EC": Object { 744 | "Properties": Object { 745 | "Action": "lambda:InvokeFunction", 746 | "FunctionName": Object { 747 | "Fn::GetAtt": Array [ 748 | "infrastructuremeetingLambda262F5C95", 749 | "Arn", 750 | ], 751 | }, 752 | "Principal": "apigateway.amazonaws.com", 753 | "SourceArn": Object { 754 | "Fn::Join": Array [ 755 | "", 756 | Array [ 757 | "arn:", 758 | Object { 759 | "Ref": "AWS::Partition", 760 | }, 761 | ":execute-api:", 762 | Object { 763 | "Ref": "AWS::Region", 764 | }, 765 | ":", 766 | Object { 767 | "Ref": "AWS::AccountId", 768 | }, 769 | ":", 770 | Object { 771 | "Ref": "infrastructureChimeSDKMeetingAPI0524B384", 772 | }, 773 | "/", 774 | Object { 775 | "Ref": "infrastructureChimeSDKMeetingAPIDeploymentStageprodDDE3819A", 776 | }, 777 | "/POST/end", 778 | ], 779 | ], 780 | }, 781 | }, 782 | "Type": "AWS::Lambda::Permission", 783 | }, 784 | "infrastructureChimeSDKMeetingAPIendPOSTApiPermissionTestAmazonChimeSDKWithLiveConnectorinfrastructureChimeSDKMeetingAPID3917592POSTend909635CE": Object { 785 | "Properties": Object { 786 | "Action": "lambda:InvokeFunction", 787 | "FunctionName": Object { 788 | "Fn::GetAtt": Array [ 789 | "infrastructuremeetingLambda262F5C95", 790 | "Arn", 791 | ], 792 | }, 793 | "Principal": "apigateway.amazonaws.com", 794 | "SourceArn": Object { 795 | "Fn::Join": Array [ 796 | "", 797 | Array [ 798 | "arn:", 799 | Object { 800 | "Ref": "AWS::Partition", 801 | }, 802 | ":execute-api:", 803 | Object { 804 | "Ref": "AWS::Region", 805 | }, 806 | ":", 807 | Object { 808 | "Ref": "AWS::AccountId", 809 | }, 810 | ":", 811 | Object { 812 | "Ref": "infrastructureChimeSDKMeetingAPI0524B384", 813 | }, 814 | "/test-invoke-stage/POST/end", 815 | ], 816 | ], 817 | }, 818 | }, 819 | "Type": "AWS::Lambda::Permission", 820 | }, 821 | "infrastructureChimeSDKMeetingAPIendPOSTE9B3F16A": Object { 822 | "Properties": Object { 823 | "AuthorizationType": "NONE", 824 | "HttpMethod": "POST", 825 | "Integration": Object { 826 | "IntegrationHttpMethod": "POST", 827 | "Type": "AWS_PROXY", 828 | "Uri": Object { 829 | "Fn::Join": Array [ 830 | "", 831 | Array [ 832 | "arn:", 833 | Object { 834 | "Ref": "AWS::Partition", 835 | }, 836 | ":apigateway:", 837 | Object { 838 | "Ref": "AWS::Region", 839 | }, 840 | ":lambda:path/2015-03-31/functions/", 841 | Object { 842 | "Fn::GetAtt": Array [ 843 | "infrastructuremeetingLambda262F5C95", 844 | "Arn", 845 | ], 846 | }, 847 | "/invocations", 848 | ], 849 | ], 850 | }, 851 | }, 852 | "ResourceId": Object { 853 | "Ref": "infrastructureChimeSDKMeetingAPIend5647DEB6", 854 | }, 855 | "RestApiId": Object { 856 | "Ref": "infrastructureChimeSDKMeetingAPI0524B384", 857 | }, 858 | }, 859 | "Type": "AWS::ApiGateway::Method", 860 | }, 861 | "infrastructureChimeSDKMeetingAPIjoin290CDE2D": Object { 862 | "Properties": Object { 863 | "ParentId": Object { 864 | "Fn::GetAtt": Array [ 865 | "infrastructureChimeSDKMeetingAPI0524B384", 866 | "RootResourceId", 867 | ], 868 | }, 869 | "PathPart": "join", 870 | "RestApiId": Object { 871 | "Ref": "infrastructureChimeSDKMeetingAPI0524B384", 872 | }, 873 | }, 874 | "Type": "AWS::ApiGateway::Resource", 875 | }, 876 | "infrastructureChimeSDKMeetingAPIjoinOPTIONS7CC1A74F": Object { 877 | "Properties": Object { 878 | "ApiKeyRequired": false, 879 | "AuthorizationType": "NONE", 880 | "HttpMethod": "OPTIONS", 881 | "Integration": Object { 882 | "IntegrationResponses": Array [ 883 | Object { 884 | "ResponseParameters": Object { 885 | "method.response.header.Access-Control-Allow-Credentials": "'true'", 886 | "method.response.header.Access-Control-Allow-Headers": "'Content-Type,X-Amz-Date,Authorization,X-Api-Key'", 887 | "method.response.header.Access-Control-Allow-Methods": "'OPTIONS,POST'", 888 | "method.response.header.Access-Control-Allow-Origin": "'*'", 889 | }, 890 | "StatusCode": "204", 891 | }, 892 | ], 893 | "RequestTemplates": Object { 894 | "application/json": "{ statusCode: 200 }", 895 | }, 896 | "Type": "MOCK", 897 | }, 898 | "MethodResponses": Array [ 899 | Object { 900 | "ResponseParameters": Object { 901 | "method.response.header.Access-Control-Allow-Credentials": true, 902 | "method.response.header.Access-Control-Allow-Headers": true, 903 | "method.response.header.Access-Control-Allow-Methods": true, 904 | "method.response.header.Access-Control-Allow-Origin": true, 905 | }, 906 | "StatusCode": "204", 907 | }, 908 | ], 909 | "ResourceId": Object { 910 | "Ref": "infrastructureChimeSDKMeetingAPIjoin290CDE2D", 911 | }, 912 | "RestApiId": Object { 913 | "Ref": "infrastructureChimeSDKMeetingAPI0524B384", 914 | }, 915 | }, 916 | "Type": "AWS::ApiGateway::Method", 917 | }, 918 | "infrastructureChimeSDKMeetingAPIjoinPOST7D618D65": Object { 919 | "Properties": Object { 920 | "AuthorizationType": "NONE", 921 | "HttpMethod": "POST", 922 | "Integration": Object { 923 | "IntegrationHttpMethod": "POST", 924 | "Type": "AWS_PROXY", 925 | "Uri": Object { 926 | "Fn::Join": Array [ 927 | "", 928 | Array [ 929 | "arn:", 930 | Object { 931 | "Ref": "AWS::Partition", 932 | }, 933 | ":apigateway:", 934 | Object { 935 | "Ref": "AWS::Region", 936 | }, 937 | ":lambda:path/2015-03-31/functions/", 938 | Object { 939 | "Fn::GetAtt": Array [ 940 | "infrastructuremeetingLambda262F5C95", 941 | "Arn", 942 | ], 943 | }, 944 | "/invocations", 945 | ], 946 | ], 947 | }, 948 | }, 949 | "ResourceId": Object { 950 | "Ref": "infrastructureChimeSDKMeetingAPIjoin290CDE2D", 951 | }, 952 | "RestApiId": Object { 953 | "Ref": "infrastructureChimeSDKMeetingAPI0524B384", 954 | }, 955 | }, 956 | "Type": "AWS::ApiGateway::Method", 957 | }, 958 | "infrastructureChimeSDKMeetingAPIjoinPOSTApiPermissionAmazonChimeSDKWithLiveConnectorinfrastructureChimeSDKMeetingAPID3917592POSTjoinD1AEB47F": Object { 959 | "Properties": Object { 960 | "Action": "lambda:InvokeFunction", 961 | "FunctionName": Object { 962 | "Fn::GetAtt": Array [ 963 | "infrastructuremeetingLambda262F5C95", 964 | "Arn", 965 | ], 966 | }, 967 | "Principal": "apigateway.amazonaws.com", 968 | "SourceArn": Object { 969 | "Fn::Join": Array [ 970 | "", 971 | Array [ 972 | "arn:", 973 | Object { 974 | "Ref": "AWS::Partition", 975 | }, 976 | ":execute-api:", 977 | Object { 978 | "Ref": "AWS::Region", 979 | }, 980 | ":", 981 | Object { 982 | "Ref": "AWS::AccountId", 983 | }, 984 | ":", 985 | Object { 986 | "Ref": "infrastructureChimeSDKMeetingAPI0524B384", 987 | }, 988 | "/", 989 | Object { 990 | "Ref": "infrastructureChimeSDKMeetingAPIDeploymentStageprodDDE3819A", 991 | }, 992 | "/POST/join", 993 | ], 994 | ], 995 | }, 996 | }, 997 | "Type": "AWS::Lambda::Permission", 998 | }, 999 | "infrastructureChimeSDKMeetingAPIjoinPOSTApiPermissionTestAmazonChimeSDKWithLiveConnectorinfrastructureChimeSDKMeetingAPID3917592POSTjoin9C99007D": Object { 1000 | "Properties": Object { 1001 | "Action": "lambda:InvokeFunction", 1002 | "FunctionName": Object { 1003 | "Fn::GetAtt": Array [ 1004 | "infrastructuremeetingLambda262F5C95", 1005 | "Arn", 1006 | ], 1007 | }, 1008 | "Principal": "apigateway.amazonaws.com", 1009 | "SourceArn": Object { 1010 | "Fn::Join": Array [ 1011 | "", 1012 | Array [ 1013 | "arn:", 1014 | Object { 1015 | "Ref": "AWS::Partition", 1016 | }, 1017 | ":execute-api:", 1018 | Object { 1019 | "Ref": "AWS::Region", 1020 | }, 1021 | ":", 1022 | Object { 1023 | "Ref": "AWS::AccountId", 1024 | }, 1025 | ":", 1026 | Object { 1027 | "Ref": "infrastructureChimeSDKMeetingAPI0524B384", 1028 | }, 1029 | "/test-invoke-stage/POST/join", 1030 | ], 1031 | ], 1032 | }, 1033 | }, 1034 | "Type": "AWS::Lambda::Permission", 1035 | }, 1036 | "infrastructureChimeSDKMeetingAPIstreamE28D3C2F": Object { 1037 | "Properties": Object { 1038 | "ParentId": Object { 1039 | "Fn::GetAtt": Array [ 1040 | "infrastructureChimeSDKMeetingAPI0524B384", 1041 | "RootResourceId", 1042 | ], 1043 | }, 1044 | "PathPart": "stream", 1045 | "RestApiId": Object { 1046 | "Ref": "infrastructureChimeSDKMeetingAPI0524B384", 1047 | }, 1048 | }, 1049 | "Type": "AWS::ApiGateway::Resource", 1050 | }, 1051 | "infrastructureChimeSDKMeetingAPIstreamOPTIONS267A1BAB": Object { 1052 | "Properties": Object { 1053 | "ApiKeyRequired": false, 1054 | "AuthorizationType": "NONE", 1055 | "HttpMethod": "OPTIONS", 1056 | "Integration": Object { 1057 | "IntegrationResponses": Array [ 1058 | Object { 1059 | "ResponseParameters": Object { 1060 | "method.response.header.Access-Control-Allow-Credentials": "'true'", 1061 | "method.response.header.Access-Control-Allow-Headers": "'Content-Type,X-Amz-Date,Authorization,X-Api-Key'", 1062 | "method.response.header.Access-Control-Allow-Methods": "'OPTIONS,POST'", 1063 | "method.response.header.Access-Control-Allow-Origin": "'*'", 1064 | }, 1065 | "StatusCode": "204", 1066 | }, 1067 | ], 1068 | "RequestTemplates": Object { 1069 | "application/json": "{ statusCode: 200 }", 1070 | }, 1071 | "Type": "MOCK", 1072 | }, 1073 | "MethodResponses": Array [ 1074 | Object { 1075 | "ResponseParameters": Object { 1076 | "method.response.header.Access-Control-Allow-Credentials": true, 1077 | "method.response.header.Access-Control-Allow-Headers": true, 1078 | "method.response.header.Access-Control-Allow-Methods": true, 1079 | "method.response.header.Access-Control-Allow-Origin": true, 1080 | }, 1081 | "StatusCode": "204", 1082 | }, 1083 | ], 1084 | "ResourceId": Object { 1085 | "Ref": "infrastructureChimeSDKMeetingAPIstreamE28D3C2F", 1086 | }, 1087 | "RestApiId": Object { 1088 | "Ref": "infrastructureChimeSDKMeetingAPI0524B384", 1089 | }, 1090 | }, 1091 | "Type": "AWS::ApiGateway::Method", 1092 | }, 1093 | "infrastructureChimeSDKMeetingAPIstreamPOSTApiPermissionAmazonChimeSDKWithLiveConnectorinfrastructureChimeSDKMeetingAPID3917592POSTstream4AC439FC": Object { 1094 | "Properties": Object { 1095 | "Action": "lambda:InvokeFunction", 1096 | "FunctionName": Object { 1097 | "Fn::GetAtt": Array [ 1098 | "infrastructuremeetingLambda262F5C95", 1099 | "Arn", 1100 | ], 1101 | }, 1102 | "Principal": "apigateway.amazonaws.com", 1103 | "SourceArn": Object { 1104 | "Fn::Join": Array [ 1105 | "", 1106 | Array [ 1107 | "arn:", 1108 | Object { 1109 | "Ref": "AWS::Partition", 1110 | }, 1111 | ":execute-api:", 1112 | Object { 1113 | "Ref": "AWS::Region", 1114 | }, 1115 | ":", 1116 | Object { 1117 | "Ref": "AWS::AccountId", 1118 | }, 1119 | ":", 1120 | Object { 1121 | "Ref": "infrastructureChimeSDKMeetingAPI0524B384", 1122 | }, 1123 | "/", 1124 | Object { 1125 | "Ref": "infrastructureChimeSDKMeetingAPIDeploymentStageprodDDE3819A", 1126 | }, 1127 | "/POST/stream", 1128 | ], 1129 | ], 1130 | }, 1131 | }, 1132 | "Type": "AWS::Lambda::Permission", 1133 | }, 1134 | "infrastructureChimeSDKMeetingAPIstreamPOSTApiPermissionTestAmazonChimeSDKWithLiveConnectorinfrastructureChimeSDKMeetingAPID3917592POSTstream4BF17D25": Object { 1135 | "Properties": Object { 1136 | "Action": "lambda:InvokeFunction", 1137 | "FunctionName": Object { 1138 | "Fn::GetAtt": Array [ 1139 | "infrastructuremeetingLambda262F5C95", 1140 | "Arn", 1141 | ], 1142 | }, 1143 | "Principal": "apigateway.amazonaws.com", 1144 | "SourceArn": Object { 1145 | "Fn::Join": Array [ 1146 | "", 1147 | Array [ 1148 | "arn:", 1149 | Object { 1150 | "Ref": "AWS::Partition", 1151 | }, 1152 | ":execute-api:", 1153 | Object { 1154 | "Ref": "AWS::Region", 1155 | }, 1156 | ":", 1157 | Object { 1158 | "Ref": "AWS::AccountId", 1159 | }, 1160 | ":", 1161 | Object { 1162 | "Ref": "infrastructureChimeSDKMeetingAPI0524B384", 1163 | }, 1164 | "/test-invoke-stage/POST/stream", 1165 | ], 1166 | ], 1167 | }, 1168 | }, 1169 | "Type": "AWS::Lambda::Permission", 1170 | }, 1171 | "infrastructureChimeSDKMeetingAPIstreamPOSTB640DEF2": Object { 1172 | "Properties": Object { 1173 | "AuthorizationType": "NONE", 1174 | "HttpMethod": "POST", 1175 | "Integration": Object { 1176 | "IntegrationHttpMethod": "POST", 1177 | "Type": "AWS_PROXY", 1178 | "Uri": Object { 1179 | "Fn::Join": Array [ 1180 | "", 1181 | Array [ 1182 | "arn:", 1183 | Object { 1184 | "Ref": "AWS::Partition", 1185 | }, 1186 | ":apigateway:", 1187 | Object { 1188 | "Ref": "AWS::Region", 1189 | }, 1190 | ":lambda:path/2015-03-31/functions/", 1191 | Object { 1192 | "Fn::GetAtt": Array [ 1193 | "infrastructuremeetingLambda262F5C95", 1194 | "Arn", 1195 | ], 1196 | }, 1197 | "/invocations", 1198 | ], 1199 | ], 1200 | }, 1201 | }, 1202 | "ResourceId": Object { 1203 | "Ref": "infrastructureChimeSDKMeetingAPIstreamE28D3C2F", 1204 | }, 1205 | "RestApiId": Object { 1206 | "Ref": "infrastructureChimeSDKMeetingAPI0524B384", 1207 | }, 1208 | }, 1209 | "Type": "AWS::ApiGateway::Method", 1210 | }, 1211 | "infrastructureinfrastructureRole7CDA6EE1": Object { 1212 | "Properties": Object { 1213 | "AssumeRolePolicyDocument": Object { 1214 | "Statement": Array [ 1215 | Object { 1216 | "Action": "sts:AssumeRole", 1217 | "Effect": "Allow", 1218 | "Principal": Object { 1219 | "Service": "lambda.amazonaws.com", 1220 | }, 1221 | }, 1222 | ], 1223 | "Version": "2012-10-17", 1224 | }, 1225 | "ManagedPolicyArns": Array [ 1226 | Object { 1227 | "Fn::Join": Array [ 1228 | "", 1229 | Array [ 1230 | "arn:", 1231 | Object { 1232 | "Ref": "AWS::Partition", 1233 | }, 1234 | ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", 1235 | ], 1236 | ], 1237 | }, 1238 | ], 1239 | "Policies": Array [ 1240 | Object { 1241 | "PolicyDocument": Object { 1242 | "Statement": Array [ 1243 | Object { 1244 | "Action": "chime:*", 1245 | "Effect": "Allow", 1246 | "Resource": "*", 1247 | }, 1248 | ], 1249 | "Version": "2012-10-17", 1250 | }, 1251 | "PolicyName": "chimePolicy", 1252 | }, 1253 | Object { 1254 | "PolicyDocument": Object { 1255 | "Statement": Array [ 1256 | Object { 1257 | "Action": Array [ 1258 | "ivs:CreateChannel", 1259 | "ivs:GetStream", 1260 | ], 1261 | "Effect": "Allow", 1262 | "Resource": "*", 1263 | }, 1264 | ], 1265 | "Version": "2012-10-17", 1266 | }, 1267 | "PolicyName": "ivsPolicy", 1268 | }, 1269 | ], 1270 | }, 1271 | "Type": "AWS::IAM::Role", 1272 | }, 1273 | "infrastructureinfrastructureRoleDefaultPolicy8A8149BB": Object { 1274 | "Properties": Object { 1275 | "PolicyDocument": Object { 1276 | "Statement": Array [ 1277 | Object { 1278 | "Action": Array [ 1279 | "dynamodb:BatchGetItem", 1280 | "dynamodb:GetRecords", 1281 | "dynamodb:GetShardIterator", 1282 | "dynamodb:Query", 1283 | "dynamodb:GetItem", 1284 | "dynamodb:Scan", 1285 | "dynamodb:ConditionCheckItem", 1286 | "dynamodb:BatchWriteItem", 1287 | "dynamodb:PutItem", 1288 | "dynamodb:UpdateItem", 1289 | "dynamodb:DeleteItem", 1290 | "dynamodb:DescribeTable", 1291 | ], 1292 | "Effect": "Allow", 1293 | "Resource": Array [ 1294 | Object { 1295 | "Fn::GetAtt": Array [ 1296 | "infrastructuremeetings3685B870", 1297 | "Arn", 1298 | ], 1299 | }, 1300 | Object { 1301 | "Ref": "AWS::NoValue", 1302 | }, 1303 | ], 1304 | }, 1305 | ], 1306 | "Version": "2012-10-17", 1307 | }, 1308 | "PolicyName": "infrastructureinfrastructureRoleDefaultPolicy8A8149BB", 1309 | "Roles": Array [ 1310 | Object { 1311 | "Ref": "infrastructureinfrastructureRole7CDA6EE1", 1312 | }, 1313 | ], 1314 | }, 1315 | "Type": "AWS::IAM::Policy", 1316 | }, 1317 | "infrastructuremeetingLambda262F5C95": Object { 1318 | "DependsOn": Array [ 1319 | "infrastructureinfrastructureRoleDefaultPolicy8A8149BB", 1320 | "infrastructureinfrastructureRole7CDA6EE1", 1321 | ], 1322 | "Properties": Object { 1323 | "Architectures": Array [ 1324 | "arm64", 1325 | ], 1326 | "Code": Object { 1327 | "S3Bucket": Object { 1328 | "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", 1329 | }, 1330 | "S3Key": "2ff9e7bdad64e7ecc25bac54ebce8957968113aed06ac98daf7c2eba35986078.zip", 1331 | }, 1332 | "Environment": Object { 1333 | "Variables": Object { 1334 | "AWS_ACCOUNT_ID": Object { 1335 | "Ref": "AWS::AccountId", 1336 | }, 1337 | "AWS_NODEJS_CONNECTION_REUSE_ENABLED": "1", 1338 | "MEETINGS_TABLE": Object { 1339 | "Ref": "infrastructuremeetings3685B870", 1340 | }, 1341 | }, 1342 | }, 1343 | "Handler": "index.lambdaHandler", 1344 | "Role": Object { 1345 | "Fn::GetAtt": Array [ 1346 | "infrastructureinfrastructureRole7CDA6EE1", 1347 | "Arn", 1348 | ], 1349 | }, 1350 | "Runtime": "nodejs16.x", 1351 | "Timeout": 60, 1352 | }, 1353 | "Type": "AWS::Lambda::Function", 1354 | }, 1355 | "infrastructuremeetings3685B870": Object { 1356 | "DeletionPolicy": "Delete", 1357 | "Properties": Object { 1358 | "AttributeDefinitions": Array [ 1359 | Object { 1360 | "AttributeName": "meetingId", 1361 | "AttributeType": "S", 1362 | }, 1363 | ], 1364 | "BillingMode": "PAY_PER_REQUEST", 1365 | "KeySchema": Array [ 1366 | Object { 1367 | "AttributeName": "meetingId", 1368 | "KeyType": "HASH", 1369 | }, 1370 | ], 1371 | "TimeToLiveSpecification": Object { 1372 | "AttributeName": "timeToLive", 1373 | "Enabled": true, 1374 | }, 1375 | }, 1376 | "Type": "AWS::DynamoDB::Table", 1377 | "UpdateReplacePolicy": "Delete", 1378 | }, 1379 | }, 1380 | "Rules": Object { 1381 | "CheckBootstrapVersion": Object { 1382 | "Assertions": Array [ 1383 | Object { 1384 | "Assert": Object { 1385 | "Fn::Not": Array [ 1386 | Object { 1387 | "Fn::Contains": Array [ 1388 | Array [ 1389 | "1", 1390 | "2", 1391 | "3", 1392 | "4", 1393 | "5", 1394 | ], 1395 | Object { 1396 | "Ref": "BootstrapVersion", 1397 | }, 1398 | ], 1399 | }, 1400 | ], 1401 | }, 1402 | "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI.", 1403 | }, 1404 | ], 1405 | }, 1406 | }, 1407 | } 1408 | `; 1409 | -------------------------------------------------------------------------------- /test/main.test.ts: -------------------------------------------------------------------------------- 1 | import { App } from 'aws-cdk-lib'; 2 | import { Template } from 'aws-cdk-lib/assertions'; 3 | import { AmazonChimeSDKWithLiveConnector } from '../src/amazon-chime-sdk-meeting-with-live-connector'; 4 | 5 | test('Snapshot', () => { 6 | const app = new App(); 7 | const amazonChimeSDKWithLiveConnector = new AmazonChimeSDKWithLiveConnector( 8 | app, 9 | 'AmazonChimeSDKWithLiveConnector', 10 | ); 11 | 12 | const frontEndTemplate = Template.fromStack(amazonChimeSDKWithLiveConnector); 13 | expect(frontEndTemplate.toJSON()).toMatchSnapshot(); 14 | }); 15 | -------------------------------------------------------------------------------- /tsconfig.dev.json: -------------------------------------------------------------------------------- 1 | // ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". 2 | { 3 | "compilerOptions": { 4 | "alwaysStrict": true, 5 | "declaration": true, 6 | "esModuleInterop": true, 7 | "experimentalDecorators": true, 8 | "inlineSourceMap": true, 9 | "inlineSources": true, 10 | "lib": [ 11 | "es2019" 12 | ], 13 | "module": "CommonJS", 14 | "noEmitOnError": false, 15 | "noFallthroughCasesInSwitch": true, 16 | "noImplicitAny": true, 17 | "noImplicitReturns": true, 18 | "noImplicitThis": true, 19 | "noUnusedLocals": true, 20 | "noUnusedParameters": true, 21 | "resolveJsonModule": true, 22 | "strict": true, 23 | "strictNullChecks": true, 24 | "strictPropertyInitialization": true, 25 | "stripInternal": true, 26 | "target": "ES2019" 27 | }, 28 | "include": [ 29 | "src/**/*.ts", 30 | "test/**/*.ts", 31 | ".projenrc.ts", 32 | "projenrc/**/*.ts" 33 | ], 34 | "exclude": [ 35 | "node_modules" 36 | ] 37 | } 38 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | // ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". 2 | { 3 | "compilerOptions": { 4 | "rootDir": "src", 5 | "outDir": "lib", 6 | "alwaysStrict": true, 7 | "declaration": true, 8 | "esModuleInterop": true, 9 | "experimentalDecorators": true, 10 | "inlineSourceMap": true, 11 | "inlineSources": true, 12 | "lib": [ 13 | "es2019" 14 | ], 15 | "module": "CommonJS", 16 | "noEmitOnError": false, 17 | "noFallthroughCasesInSwitch": true, 18 | "noImplicitAny": true, 19 | "noImplicitReturns": true, 20 | "noImplicitThis": true, 21 | "noUnusedLocals": true, 22 | "noUnusedParameters": true, 23 | "resolveJsonModule": true, 24 | "strict": true, 25 | "strictNullChecks": true, 26 | "strictPropertyInitialization": true, 27 | "stripInternal": true, 28 | "target": "ES2019" 29 | }, 30 | "include": [ 31 | "src/**/*.ts" 32 | ], 33 | "exclude": [ 34 | "cdk.out" 35 | ] 36 | } 37 | --------------------------------------------------------------------------------