jonny-rimek / wowmate

combatlog analysis for world of warcraft players
http://wowmate.io
MIT License
4 stars 0 forks source link

Replace combatlogUUID with hash #363

Closed jonny-rimek closed 3 years ago

jonny-rimek commented 3 years ago

fix #350

github-actions[bot] commented 3 years ago
Stack wm
Resources
[~] AWS::Lambda::Function Api-/Lambda ApiLambdaB75D04FB 
 ├─ [~] Code
 │   └─ [~] .S3Key:
 │       ├─ [-] c070daac02489a748e9e0644a4457029e3a83e5040022b98ebd633daa7185557.zip
 │       └─ [+] 2a2dd2b026f1d171665207eb38bc3f350f5dd3ffa7de786ad8e4158b50154c8e.zip
 └─ [~] Metadata
     └─ [~] .aws:asset:path:
         ├─ [-] asset.c070daac02489a748e9e0644a4457029e3a83e5040022b98ebd633daa7185557
         └─ [+] asset.2a2dd2b026f1d171665207eb38bc3f350f5dd3ffa7de786ad8e4158b50154c8e
[~] Custom::CDKBucketDeployment Frontend-/DeployWebsite/CustomResource FrontendDeployWebsiteCustomResource1B4A6C7F 
 └─ [~] SourceObjectKeys
     └─ @@ -1,3 +1,3 @@
        [ ] [
        [-]   "243ebf0b364a71e47601ee0c80c9b50fe18a3e8ea11ddca13e7d2086a947c771.zip"
        [+]   "c1587a27d93e18f26a3020c355e683dc77e257bf06e89cafd5a4017bbebcbb64.zip"
        [ ] ]
[~] AWS::Synthetics::Canary Canary-/API CanaryAPI9F4B22EA 
 ├─ [~] Code
 │   └─ [~] .Script:
 │       ├─ [-] 
            var synthetics = require('Synthetics');
            const log = require('SyntheticsLogger');

            const apiCanaryBlueprint = async function () {
                const hostname = process.env.API_URL

                // Handle validation for positive scenario
                const validateSuccessful = async function(res) {
                    return new Promise((resolve, reject) => {
                        if (res.statusCode < 200 || res.statusCode > 299) {
                            throw res.statusCode + ' ' + res.statusMessage;
                        }

                        let responseBody = '';
                        res.on('data', (d) => {
                            responseBody += d;
                        });

                        res.on('end', () => {
                            // Add validation on 'responseBody' here if required.
                            resolve();
                        });
                    });
                };

                // Set request option for Verify /combatlogs/keys
                let requestOptionsStep1 = {
                    hostname: hostname,
                    method: 'GET',
                    path: '/combatlogs/keys',
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep1['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep1['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /combatlogs/keys
                let stepConfig1 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false,
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                await synthetics.executeHttpStep('Verify /combatlogs/keys', requestOptionsStep1, validateSuccessful, stepConfig1);

                // Set request option for Verify /presign/{filename}
                let requestOptionsStep2 = {
                    hostname: hostname,
                    method: 'POST',
                    path: '/presign/test.txt',
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep2['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep2['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /presign/{filename}
                let stepConfig2 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false,
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                await synthetics.executeHttpStep('Verify /presign/{filename}', requestOptionsStep2, validateSuccessful, stepConfig2);

                // Set request option for Verify /combatlogs/keys/{dungeon_id}
                let requestOptionsStep3 = {
                    hostname: hostname,
                    method: 'GET',
                    path: '/combatlogs/keys/2291',
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep3['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep3['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /combatlogs/keys/{dungeon_id}
                let stepConfig3 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false, 
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                // TODO: XMLHttpRequest
                // TODO: check response, must include body
                await synthetics.executeHttpStep('Verify /combatlogs/keys/{dungeon_id}', requestOptionsStep3, validateSuccessful, stepConfig3);

                const combatlogUUID = getCombatlogUUID(hostname)
                // Set request option for Verify /combatlogs/keys/{combatlog_uuid}/player-damage-done
                let requestOptionsStep4 = {
                    hostname: hostname,
                    method: 'GET',
                    path: '/combatlogs/keys/' + combatlogUUID,
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep4['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep4['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /combatlogs/keys/{combatlog_uuid}/player-damage-done
                let stepConfig4 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false,
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                await synthetics.executeHttpStep('Verify /combatlogs/keys/{combatlog_uuid}/player-damage-done', requestOptionsStep4, validateSuccessful, stepConfig4);

                // ----------------------------------------------------
                // Set request option for Verify /
                let requestOptionsStep5 = {
                    hostname: hostname,
                    method: 'GET',
                    path: '/',
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep4['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep4['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /
                let stepConfig5 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false,
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                await synthetics.executeHttpStep('Verify /', requestOptionsStep5, validateSuccessful, stepConfig5);
            };

            // neither fetch or XMLHttpRequest works and I can't install packages with inline code
            function getCombatlogUUID(apiUrl) {
                if (process.env.STAGE === "prod") {
                    return "ac18f293-e573-4994-8745-2a291d12bf9a"
                }
                return "2ac44ef5-d053-4232-881e-c8c21300ec4f"
                // let url = "https://" + apiUrl + "/combatlogs/keys"
                // let xmlHttp = new XMLHttpRequest()
                // xmlHttp.open( "GET", url, false ) // false for synchronous request
                // xmlHttp.send( null )
                // const resp = JSON.parse(xmlHttp.responseText)
                // return resp.data[0].combatlog_uuid
            }

            exports.handler = async () => {
                return await apiCanaryBlueprint();
            };

 │       └─ [+] 
            var synthetics = require('Synthetics');
            const log = require('SyntheticsLogger');

            const apiCanaryBlueprint = async function () {
                const hostname = process.env.API_URL
                const domainName = process.env.DOMAIN_NAME

                // Handle validation for positive scenario
                const validateSuccessful = async function(res) {
                    return new Promise((resolve, reject) => {
                        if (res.statusCode < 200 || res.statusCode > 299) {
                            throw res.statusCode + ' ' + res.statusMessage;
                        }

                        let responseBody = '';
                        res.on('data', (d) => {
                            responseBody += d;
                        });

                        res.on('end', () => {
                            // Add validation on 'responseBody' here if required.
                            resolve();
                        });
                    });
                };

                // Set request option for Verify /combatlogs/keys
                let requestOptionsStep1 = {
                    hostname: hostname,
                    method: 'GET',
                    path: '/combatlogs/keys',
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep1['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep1['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /combatlogs/keys
                let stepConfig1 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false,
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                await synthetics.executeHttpStep('Verify /combatlogs/keys', requestOptionsStep1, validateSuccessful, stepConfig1);

                // Set request option for Verify /presign/{filename}
                let requestOptionsStep2 = {
                    hostname: hostname,
                    method: 'POST',
                    path: '/presign/test.txt',
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep2['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep2['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /presign/{filename}
                let stepConfig2 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false,
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                await synthetics.executeHttpStep('Verify /presign/{filename}', requestOptionsStep2, validateSuccessful, stepConfig2);

                // Set request option for Verify /combatlogs/keys/{dungeon_id}
                let requestOptionsStep3 = {
                    hostname: hostname,
                    method: 'GET',
                    path: '/combatlogs/keys/2291',
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep3['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep3['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /combatlogs/keys/{dungeon_id}
                let stepConfig3 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false, 
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                // TODO: XMLHttpRequest
                // TODO: check response, must include body
                await synthetics.executeHttpStep('Verify /combatlogs/keys/{dungeon_id}', requestOptionsStep3, validateSuccessful, stepConfig3);

                const combatlogUUID = getCombatlogUUID(hostname)
                // Set request option for Verify /combatlogs/keys/{combatlog_uuid}/player-damage-done
                let requestOptionsStep4 = {
                    hostname: hostname,
                    method: 'GET',
                    path: '/combatlogs/keys/' + combatlogUUID,
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep4['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep4['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /combatlogs/keys/{combatlog_uuid}/player-damage-done
                let stepConfig4 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false,
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                await synthetics.executeHttpStep('Verify /combatlogs/keys/{combatlog_uuid}/player-damage-done', requestOptionsStep4, validateSuccessful, stepConfig4);

                // ----------------------------------------------------
                // Set request option for Verify /
                let requestOptionsStep5 = {
                    hostname: domainName,
                    method: 'GET',
                    path: '/',
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep4['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep4['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /
                let stepConfig5 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false,
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                await synthetics.executeHttpStep('Verify /', requestOptionsStep5, validateSuccessful, stepConfig5);
            };

            // neither fetch or XMLHttpRequest works and I can't install packages with inline code
            function getCombatlogUUID(apiUrl) {
                if (process.env.STAGE === "prod") {
                    return "ac18f293-e573-4994-8745-2a291d12bf9a"
                }
                return "2ac44ef5-d053-4232-881e-c8c21300ec4f"
                // let url = "https://" + apiUrl + "/combatlogs/keys"
                // let xmlHttp = new XMLHttpRequest()
                // xmlHttp.open( "GET", url, false ) // false for synchronous request
                // xmlHttp.send( null )
                // const resp = JSON.parse(xmlHttp.responseText)
                // return resp.data[0].combatlog_uuid
            }

            exports.handler = async () => {
                return await apiCanaryBlueprint();
            };

 └─ [~] RunConfig
     └─ [~] .EnvironmentVariables:
         └─ [+] Added: .DOMAIN_NAME
github-actions[bot] commented 3 years ago
Stack wm
Resources
[~] AWS::Lambda::Function Api-/Lambda ApiLambdaB75D04FB 
 ├─ [~] Code
 │   └─ [~] .S3Key:
 │       ├─ [-] c070daac02489a748e9e0644a4457029e3a83e5040022b98ebd633daa7185557.zip
 │       └─ [+] 2a2dd2b026f1d171665207eb38bc3f350f5dd3ffa7de786ad8e4158b50154c8e.zip
 └─ [~] Metadata
     └─ [~] .aws:asset:path:
         ├─ [-] asset.c070daac02489a748e9e0644a4457029e3a83e5040022b98ebd633daa7185557
         └─ [+] asset.2a2dd2b026f1d171665207eb38bc3f350f5dd3ffa7de786ad8e4158b50154c8e
[~] Custom::CDKBucketDeployment Frontend-/DeployWebsite/CustomResource FrontendDeployWebsiteCustomResource1B4A6C7F 
 └─ [~] SourceObjectKeys
     └─ @@ -1,3 +1,3 @@
        [ ] [
        [-]   "243ebf0b364a71e47601ee0c80c9b50fe18a3e8ea11ddca13e7d2086a947c771.zip"
        [+]   "c1587a27d93e18f26a3020c355e683dc77e257bf06e89cafd5a4017bbebcbb64.zip"
        [ ] ]
[~] AWS::Lambda::Function InsertKeysToTimestream-/Lambda InsertKeysToTimestreamLambdaA07E952E 
 ├─ [~] Code
 │   └─ [~] .S3Key:
 │       ├─ [-] e0c251abbc9c1665ae58bd93643f4b257f80bd51509f4754bdf9dd24bdf51719.zip
 │       └─ [+] 25c818bfe4f31ba515482352d749b791168d885ae675fa8fe6353a8b8281d2b4.zip
 └─ [~] Metadata
     └─ [~] .aws:asset:path:
         ├─ [-] asset.e0c251abbc9c1665ae58bd93643f4b257f80bd51509f4754bdf9dd24bdf51719
         └─ [+] asset.25c818bfe4f31ba515482352d749b791168d885ae675fa8fe6353a8b8281d2b4
[~] AWS::Lambda::Function Convert-/Lambda ConvertLambda3540DCCB 
 ├─ [~] Code
 │   └─ [~] .S3Key:
 │       ├─ [-] f08a80660ecc5650c47ecdd4a96d1892d9680678d381d999fdd77982a782fbb3.zip
 │       └─ [+] d8c814d8abff0ebdd3430c661b19795d74ddc859e9901be43c4435a7ef5c75a3.zip
 └─ [~] Metadata
     └─ [~] .aws:asset:path:
         ├─ [-] asset.f08a80660ecc5650c47ecdd4a96d1892d9680678d381d999fdd77982a782fbb3
         └─ [+] asset.d8c814d8abff0ebdd3430c661b19795d74ddc859e9901be43c4435a7ef5c75a3
[~] AWS::Synthetics::Canary Canary-/API CanaryAPI9F4B22EA 
 ├─ [~] Code
 │   └─ [~] .Script:
 │       ├─ [-] 
            var synthetics = require('Synthetics');
            const log = require('SyntheticsLogger');

            const apiCanaryBlueprint = async function () {
                const hostname = process.env.API_URL

                // Handle validation for positive scenario
                const validateSuccessful = async function(res) {
                    return new Promise((resolve, reject) => {
                        if (res.statusCode < 200 || res.statusCode > 299) {
                            throw res.statusCode + ' ' + res.statusMessage;
                        }

                        let responseBody = '';
                        res.on('data', (d) => {
                            responseBody += d;
                        });

                        res.on('end', () => {
                            // Add validation on 'responseBody' here if required.
                            resolve();
                        });
                    });
                };

                // Set request option for Verify /combatlogs/keys
                let requestOptionsStep1 = {
                    hostname: hostname,
                    method: 'GET',
                    path: '/combatlogs/keys',
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep1['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep1['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /combatlogs/keys
                let stepConfig1 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false,
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                await synthetics.executeHttpStep('Verify /combatlogs/keys', requestOptionsStep1, validateSuccessful, stepConfig1);

                // Set request option for Verify /presign/{filename}
                let requestOptionsStep2 = {
                    hostname: hostname,
                    method: 'POST',
                    path: '/presign/test.txt',
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep2['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep2['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /presign/{filename}
                let stepConfig2 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false,
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                await synthetics.executeHttpStep('Verify /presign/{filename}', requestOptionsStep2, validateSuccessful, stepConfig2);

                // Set request option for Verify /combatlogs/keys/{dungeon_id}
                let requestOptionsStep3 = {
                    hostname: hostname,
                    method: 'GET',
                    path: '/combatlogs/keys/2291',
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep3['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep3['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /combatlogs/keys/{dungeon_id}
                let stepConfig3 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false, 
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                // TODO: XMLHttpRequest
                // TODO: check response, must include body
                await synthetics.executeHttpStep('Verify /combatlogs/keys/{dungeon_id}', requestOptionsStep3, validateSuccessful, stepConfig3);

                const combatlogUUID = getCombatlogUUID(hostname)
                // Set request option for Verify /combatlogs/keys/{combatlog_uuid}/player-damage-done
                let requestOptionsStep4 = {
                    hostname: hostname,
                    method: 'GET',
                    path: '/combatlogs/keys/' + combatlogUUID,
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep4['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep4['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /combatlogs/keys/{combatlog_uuid}/player-damage-done
                let stepConfig4 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false,
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                await synthetics.executeHttpStep('Verify /combatlogs/keys/{combatlog_uuid}/player-damage-done', requestOptionsStep4, validateSuccessful, stepConfig4);

                // ----------------------------------------------------
                // Set request option for Verify /
                let requestOptionsStep5 = {
                    hostname: hostname,
                    method: 'GET',
                    path: '/',
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep4['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep4['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /
                let stepConfig5 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false,
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                await synthetics.executeHttpStep('Verify /', requestOptionsStep5, validateSuccessful, stepConfig5);
            };

            // neither fetch or XMLHttpRequest works and I can't install packages with inline code
            function getCombatlogUUID(apiUrl) {
                if (process.env.STAGE === "prod") {
                    return "ac18f293-e573-4994-8745-2a291d12bf9a"
                }
                return "2ac44ef5-d053-4232-881e-c8c21300ec4f"
                // let url = "https://" + apiUrl + "/combatlogs/keys"
                // let xmlHttp = new XMLHttpRequest()
                // xmlHttp.open( "GET", url, false ) // false for synchronous request
                // xmlHttp.send( null )
                // const resp = JSON.parse(xmlHttp.responseText)
                // return resp.data[0].combatlog_uuid
            }

            exports.handler = async () => {
                return await apiCanaryBlueprint();
            };

 │       └─ [+] 
            var synthetics = require('Synthetics');
            const log = require('SyntheticsLogger');

            const apiCanaryBlueprint = async function () {
                const hostname = process.env.API_URL
                const domainName = process.env.DOMAIN_NAME

                // Handle validation for positive scenario
                const validateSuccessful = async function(res) {
                    return new Promise((resolve, reject) => {
                        if (res.statusCode < 200 || res.statusCode > 299) {
                            throw res.statusCode + ' ' + res.statusMessage;
                        }

                        let responseBody = '';
                        res.on('data', (d) => {
                            responseBody += d;
                        });

                        res.on('end', () => {
                            // Add validation on 'responseBody' here if required.
                            resolve();
                        });
                    });
                };

                // Set request option for Verify /combatlogs/keys
                let requestOptionsStep1 = {
                    hostname: hostname,
                    method: 'GET',
                    path: '/combatlogs/keys',
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep1['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep1['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /combatlogs/keys
                let stepConfig1 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false,
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                await synthetics.executeHttpStep('Verify /combatlogs/keys', requestOptionsStep1, validateSuccessful, stepConfig1);

                // Set request option for Verify /presign/{filename}
                let requestOptionsStep2 = {
                    hostname: hostname,
                    method: 'POST',
                    path: '/presign/test.txt',
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep2['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep2['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /presign/{filename}
                let stepConfig2 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false,
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                await synthetics.executeHttpStep('Verify /presign/{filename}', requestOptionsStep2, validateSuccessful, stepConfig2);

                // Set request option for Verify /combatlogs/keys/{dungeon_id}
                let requestOptionsStep3 = {
                    hostname: hostname,
                    method: 'GET',
                    path: '/combatlogs/keys/2291',
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep3['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep3['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /combatlogs/keys/{dungeon_id}
                let stepConfig3 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false, 
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                // TODO: XMLHttpRequest
                // TODO: check response, must include body
                await synthetics.executeHttpStep('Verify /combatlogs/keys/{dungeon_id}', requestOptionsStep3, validateSuccessful, stepConfig3);

                const combatlogUUID = getCombatlogUUID(hostname)
                // Set request option for Verify /combatlogs/keys/{combatlog_uuid}/player-damage-done
                let requestOptionsStep4 = {
                    hostname: hostname,
                    method: 'GET',
                    path: '/combatlogs/keys/' + combatlogUUID,
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep4['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep4['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /combatlogs/keys/{combatlog_uuid}/player-damage-done
                let stepConfig4 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false,
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                await synthetics.executeHttpStep('Verify /combatlogs/keys/{combatlog_uuid}/player-damage-done', requestOptionsStep4, validateSuccessful, stepConfig4);

                // ----------------------------------------------------
                // Set request option for Verify /
                let requestOptionsStep5 = {
                    hostname: domainName,
                    method: 'GET',
                    path: '/',
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep4['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep4['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /
                let stepConfig5 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false,
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                await synthetics.executeHttpStep('Verify /', requestOptionsStep5, validateSuccessful, stepConfig5);
            };

            // neither fetch or XMLHttpRequest works and I can't install packages with inline code
            function getCombatlogUUID(apiUrl) {
                if (process.env.STAGE === "prod") {
                    return "ac18f293-e573-4994-8745-2a291d12bf9a"
                }
                return "2ac44ef5-d053-4232-881e-c8c21300ec4f"
                // let url = "https://" + apiUrl + "/combatlogs/keys"
                // let xmlHttp = new XMLHttpRequest()
                // xmlHttp.open( "GET", url, false ) // false for synchronous request
                // xmlHttp.send( null )
                // const resp = JSON.parse(xmlHttp.responseText)
                // return resp.data[0].combatlog_uuid
            }

            exports.handler = async () => {
                return await apiCanaryBlueprint();
            };

 └─ [~] RunConfig
     └─ [~] .EnvironmentVariables:
         └─ [+] Added: .DOMAIN_NAME
github-actions[bot] commented 3 years ago
Stack wm
Resources
[~] AWS::Lambda::Function Api-/GetKeysLambda ApiGetKeysLambdaFDF1A526 
 ├─ [~] Code
 │   └─ [~] .S3Key:
 │       ├─ [-] e879be6824f28368b30e679fce10c1e824b375566201922aab2c3896cfcc89bc.zip
 │       └─ [+] 4232ce2159ba2ea57751f84bc5b3c4a0ab762d6378d7d87c0a7d9e8b6971b15d.zip
 └─ [~] Metadata
     └─ [~] .aws:asset:path:
         ├─ [-] asset.e879be6824f28368b30e679fce10c1e824b375566201922aab2c3896cfcc89bc
         └─ [+] asset.4232ce2159ba2ea57751f84bc5b3c4a0ab762d6378d7d87c0a7d9e8b6971b15d
[~] AWS::Lambda::Function Api-/GetKeysPerDungeonLambda ApiGetKeysPerDungeonLambda073DE524 
 ├─ [~] Code
 │   └─ [~] .S3Key:
 │       ├─ [-] 6857a3821c4de6757d06019ba9dd75507df092fc82bb95c480d6885f4c60b456.zip
 │       └─ [+] e816caaa8d355ccedb622aca3b37cd28c95eb3f629649b85207a92c73f7abb6c.zip
 └─ [~] Metadata
     └─ [~] .aws:asset:path:
         ├─ [-] asset.6857a3821c4de6757d06019ba9dd75507df092fc82bb95c480d6885f4c60b456
         └─ [+] asset.e816caaa8d355ccedb622aca3b37cd28c95eb3f629649b85207a92c73f7abb6c
[~] AWS::Lambda::Function Api-/GetPlayerDamageDoneLambda ApiGetPlayerDamageDoneLambda7F052E98 
 ├─ [~] Code
 │   └─ [~] .S3Key:
 │       ├─ [-] 1dead25d404a1e85d975d399d23f0bee9c45c07b89e5a6b74d974e340155f287.zip
 │       └─ [+] fad8416ba9323f920207cfc896e469f5d03038b1fccf591c19f989300680e371.zip
 └─ [~] Metadata
     └─ [~] .aws:asset:path:
         ├─ [-] asset.1dead25d404a1e85d975d399d23f0bee9c45c07b89e5a6b74d974e340155f287
         └─ [+] asset.fad8416ba9323f920207cfc896e469f5d03038b1fccf591c19f989300680e371
[~] AWS::Lambda::Function Api-/Lambda ApiLambdaB75D04FB 
 ├─ [~] Code
 │   └─ [~] .S3Key:
 │       ├─ [-] c070daac02489a748e9e0644a4457029e3a83e5040022b98ebd633daa7185557.zip
 │       └─ [+] 2a2dd2b026f1d171665207eb38bc3f350f5dd3ffa7de786ad8e4158b50154c8e.zip
 └─ [~] Metadata
     └─ [~] .aws:asset:path:
         ├─ [-] asset.c070daac02489a748e9e0644a4457029e3a83e5040022b98ebd633daa7185557
         └─ [+] asset.2a2dd2b026f1d171665207eb38bc3f350f5dd3ffa7de786ad8e4158b50154c8e
[~] Custom::CDKBucketDeployment Frontend-/DeployWebsite/CustomResource FrontendDeployWebsiteCustomResource1B4A6C7F 
 └─ [~] SourceObjectKeys
     └─ @@ -1,3 +1,3 @@
        [ ] [
        [-]   "243ebf0b364a71e47601ee0c80c9b50fe18a3e8ea11ddca13e7d2086a947c771.zip"
        [+]   "c1587a27d93e18f26a3020c355e683dc77e257bf06e89cafd5a4017bbebcbb64.zip"
        [ ] ]
[~] AWS::Lambda::Function QueryKeys-/Lambda QueryKeysLambda58DE9A2E 
 ├─ [~] Code
 │   └─ [~] .S3Key:
 │       ├─ [-] 16b0a1161b37d26c070c219bfc5b8e277ee5e6626eb69f9b7f89e26b419a5014.zip
 │       └─ [+] ce3beb0072ff31dca6317b6746f87fb2e0ad54f1b73c049c4e6a44b8e17f0eb6.zip
 └─ [~] Metadata
     └─ [~] .aws:asset:path:
         ├─ [-] asset.16b0a1161b37d26c070c219bfc5b8e277ee5e6626eb69f9b7f89e26b419a5014
         └─ [+] asset.ce3beb0072ff31dca6317b6746f87fb2e0ad54f1b73c049c4e6a44b8e17f0eb6
[~] AWS::Lambda::Function InsertKeysToDynamodb-/Lambda InsertKeysToDynamodbLambda15825024 
 ├─ [~] Code
 │   └─ [~] .S3Key:
 │       ├─ [-] e81d233834310b1b15e9aac581e61ca55e1f54966dd7b93f625cd854d33bf683.zip
 │       └─ [+] c47e26a999cc90b262411956bdf17e2e8d5e68aebbc9884a4a22f04386674769.zip
 └─ [~] Metadata
     └─ [~] .aws:asset:path:
         ├─ [-] asset.e81d233834310b1b15e9aac581e61ca55e1f54966dd7b93f625cd854d33bf683
         └─ [+] asset.c47e26a999cc90b262411956bdf17e2e8d5e68aebbc9884a4a22f04386674769
[~] AWS::Lambda::Function InsertKeysToTimestream-/Lambda InsertKeysToTimestreamLambdaA07E952E 
 ├─ [~] Code
 │   └─ [~] .S3Key:
 │       ├─ [-] e0c251abbc9c1665ae58bd93643f4b257f80bd51509f4754bdf9dd24bdf51719.zip
 │       └─ [+] 23e1f4e1a6c4e48d71e8a0afeecb50a88887bd5d936a71a934a93faf8f703e15.zip
 └─ [~] Metadata
     └─ [~] .aws:asset:path:
         ├─ [-] asset.e0c251abbc9c1665ae58bd93643f4b257f80bd51509f4754bdf9dd24bdf51719
         └─ [+] asset.23e1f4e1a6c4e48d71e8a0afeecb50a88887bd5d936a71a934a93faf8f703e15
[~] AWS::Lambda::Function QueryPlayerDamageDone-/Lambda QueryPlayerDamageDoneLambda98AFC037 
 ├─ [~] Code
 │   └─ [~] .S3Key:
 │       ├─ [-] 427ec4d755977222255bbe84005f6dba679e30bb54e992274beea3085e71d82a.zip
 │       └─ [+] c2d8513f15bfe0f65d6004e34d199204c7163739bcdbe6cf2cd7c3549fff0e38.zip
 └─ [~] Metadata
     └─ [~] .aws:asset:path:
         ├─ [-] asset.427ec4d755977222255bbe84005f6dba679e30bb54e992274beea3085e71d82a
         └─ [+] asset.c2d8513f15bfe0f65d6004e34d199204c7163739bcdbe6cf2cd7c3549fff0e38
[~] AWS::Lambda::Function InsertPlayerDamageDoneToDynamodb-/Lambda InsertPlayerDamageDoneToDynamodbLambda659E0DA7 
 ├─ [~] Code
 │   └─ [~] .S3Key:
 │       ├─ [-] ca648d974272bfc1f79917ff9af9335697880157f35fa7a1382e7b014a774177.zip
 │       └─ [+] da6482ed79c5169ad840541dd59f4b7ab31fd938a7e76c8a654490494961d26e.zip
 └─ [~] Metadata
     └─ [~] .aws:asset:path:
         ├─ [-] asset.ca648d974272bfc1f79917ff9af9335697880157f35fa7a1382e7b014a774177
         └─ [+] asset.da6482ed79c5169ad840541dd59f4b7ab31fd938a7e76c8a654490494961d26e
[~] AWS::Lambda::Function Convert-/Lambda ConvertLambda3540DCCB 
 ├─ [~] Code
 │   └─ [~] .S3Key:
 │       ├─ [-] f08a80660ecc5650c47ecdd4a96d1892d9680678d381d999fdd77982a782fbb3.zip
 │       └─ [+] bebe0010975a11edc8db2741996e6d0e0c0ae2074e1e61dc4d5438e46cf9fb30.zip
 └─ [~] Metadata
     └─ [~] .aws:asset:path:
         ├─ [-] asset.f08a80660ecc5650c47ecdd4a96d1892d9680678d381d999fdd77982a782fbb3
         └─ [+] asset.bebe0010975a11edc8db2741996e6d0e0c0ae2074e1e61dc4d5438e46cf9fb30
[~] AWS::Synthetics::Canary Canary-/API CanaryAPI9F4B22EA 
 ├─ [~] Code
 │   └─ [~] .Script:
 │       ├─ [-] 
            var synthetics = require('Synthetics');
            const log = require('SyntheticsLogger');

            const apiCanaryBlueprint = async function () {
                const hostname = process.env.API_URL

                // Handle validation for positive scenario
                const validateSuccessful = async function(res) {
                    return new Promise((resolve, reject) => {
                        if (res.statusCode < 200 || res.statusCode > 299) {
                            throw res.statusCode + ' ' + res.statusMessage;
                        }

                        let responseBody = '';
                        res.on('data', (d) => {
                            responseBody += d;
                        });

                        res.on('end', () => {
                            // Add validation on 'responseBody' here if required.
                            resolve();
                        });
                    });
                };

                // Set request option for Verify /combatlogs/keys
                let requestOptionsStep1 = {
                    hostname: hostname,
                    method: 'GET',
                    path: '/combatlogs/keys',
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep1['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep1['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /combatlogs/keys
                let stepConfig1 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false,
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                await synthetics.executeHttpStep('Verify /combatlogs/keys', requestOptionsStep1, validateSuccessful, stepConfig1);

                // Set request option for Verify /presign/{filename}
                let requestOptionsStep2 = {
                    hostname: hostname,
                    method: 'POST',
                    path: '/presign/test.txt',
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep2['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep2['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /presign/{filename}
                let stepConfig2 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false,
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                await synthetics.executeHttpStep('Verify /presign/{filename}', requestOptionsStep2, validateSuccessful, stepConfig2);

                // Set request option for Verify /combatlogs/keys/{dungeon_id}
                let requestOptionsStep3 = {
                    hostname: hostname,
                    method: 'GET',
                    path: '/combatlogs/keys/2291',
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep3['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep3['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /combatlogs/keys/{dungeon_id}
                let stepConfig3 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false, 
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                // TODO: XMLHttpRequest
                // TODO: check response, must include body
                await synthetics.executeHttpStep('Verify /combatlogs/keys/{dungeon_id}', requestOptionsStep3, validateSuccessful, stepConfig3);

                const combatlogUUID = getCombatlogUUID(hostname)
                // Set request option for Verify /combatlogs/keys/{combatlog_uuid}/player-damage-done
                let requestOptionsStep4 = {
                    hostname: hostname,
                    method: 'GET',
                    path: '/combatlogs/keys/' + combatlogUUID,
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep4['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep4['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /combatlogs/keys/{combatlog_uuid}/player-damage-done
                let stepConfig4 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false,
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                await synthetics.executeHttpStep('Verify /combatlogs/keys/{combatlog_uuid}/player-damage-done', requestOptionsStep4, validateSuccessful, stepConfig4);

                // ----------------------------------------------------
                // Set request option for Verify /
                let requestOptionsStep5 = {
                    hostname: hostname,
                    method: 'GET',
                    path: '/',
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep4['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep4['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /
                let stepConfig5 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false,
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                await synthetics.executeHttpStep('Verify /', requestOptionsStep5, validateSuccessful, stepConfig5);
            };

            // neither fetch or XMLHttpRequest works and I can't install packages with inline code
            function getCombatlogUUID(apiUrl) {
                if (process.env.STAGE === "prod") {
                    return "ac18f293-e573-4994-8745-2a291d12bf9a"
                }
                return "2ac44ef5-d053-4232-881e-c8c21300ec4f"
                // let url = "https://" + apiUrl + "/combatlogs/keys"
                // let xmlHttp = new XMLHttpRequest()
                // xmlHttp.open( "GET", url, false ) // false for synchronous request
                // xmlHttp.send( null )
                // const resp = JSON.parse(xmlHttp.responseText)
                // return resp.data[0].combatlog_uuid
            }

            exports.handler = async () => {
                return await apiCanaryBlueprint();
            };

 │       └─ [+] 
            var synthetics = require('Synthetics');
            const log = require('SyntheticsLogger');

            const apiCanaryBlueprint = async function () {
                const hostname = process.env.API_URL
                const domainName = process.env.DOMAIN_NAME

                // Handle validation for positive scenario
                const validateSuccessful = async function(res) {
                    return new Promise((resolve, reject) => {
                        if (res.statusCode < 200 || res.statusCode > 299) {
                            throw res.statusCode + ' ' + res.statusMessage;
                        }

                        let responseBody = '';
                        res.on('data', (d) => {
                            responseBody += d;
                        });

                        res.on('end', () => {
                            // Add validation on 'responseBody' here if required.
                            resolve();
                        });
                    });
                };

                // Set request option for Verify /combatlogs/keys
                let requestOptionsStep1 = {
                    hostname: hostname,
                    method: 'GET',
                    path: '/combatlogs/keys',
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep1['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep1['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /combatlogs/keys
                let stepConfig1 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false,
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                await synthetics.executeHttpStep('Verify /combatlogs/keys', requestOptionsStep1, validateSuccessful, stepConfig1);

                // Set request option for Verify /presign/{filename}
                let requestOptionsStep2 = {
                    hostname: hostname,
                    method: 'POST',
                    path: '/presign/test.txt',
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep2['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep2['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /presign/{filename}
                let stepConfig2 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false,
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                await synthetics.executeHttpStep('Verify /presign/{filename}', requestOptionsStep2, validateSuccessful, stepConfig2);

                // Set request option for Verify /combatlogs/keys/{dungeon_id}
                let requestOptionsStep3 = {
                    hostname: hostname,
                    method: 'GET',
                    path: '/combatlogs/keys/2291',
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep3['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep3['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /combatlogs/keys/{dungeon_id}
                let stepConfig3 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false, 
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                // TODO: XMLHttpRequest
                // TODO: check response, must include body
                await synthetics.executeHttpStep('Verify /combatlogs/keys/{dungeon_id}', requestOptionsStep3, validateSuccessful, stepConfig3);

                const combatlogUUID = getCombatlogUUID(hostname)
                // Set request option for Verify /combatlogs/keys/{combatlog_uuid}/player-damage-done
                let requestOptionsStep4 = {
                    hostname: hostname,
                    method: 'GET',
                    path: '/combatlogs/keys/' + combatlogUUID,
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep4['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep4['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /combatlogs/keys/{combatlog_uuid}/player-damage-done
                let stepConfig4 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false,
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                await synthetics.executeHttpStep('Verify /combatlogs/keys/{combatlog_uuid}/player-damage-done', requestOptionsStep4, validateSuccessful, stepConfig4);

                // ----------------------------------------------------
                // Set request option for Verify /
                let requestOptionsStep5 = {
                    hostname: domainName,
                    method: 'GET',
                    path: '/',
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep4['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep4['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /
                let stepConfig5 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false,
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                await synthetics.executeHttpStep('Verify /', requestOptionsStep5, validateSuccessful, stepConfig5);
            };

            // neither fetch or XMLHttpRequest works and I can't install packages with inline code
            function getCombatlogUUID(apiUrl) {
                if (process.env.STAGE === "prod") {
                    return "ac18f293-e573-4994-8745-2a291d12bf9a"
                }
                return "2ac44ef5-d053-4232-881e-c8c21300ec4f"
                // let url = "https://" + apiUrl + "/combatlogs/keys"
                // let xmlHttp = new XMLHttpRequest()
                // xmlHttp.open( "GET", url, false ) // false for synchronous request
                // xmlHttp.send( null )
                // const resp = JSON.parse(xmlHttp.responseText)
                // return resp.data[0].combatlog_uuid
            }

            exports.handler = async () => {
                return await apiCanaryBlueprint();
            };

 └─ [~] RunConfig
     └─ [~] .EnvironmentVariables:
         └─ [+] Added: .DOMAIN_NAME
github-actions[bot] commented 3 years ago
Stack wm
Resources
[~] AWS::Lambda::Function Api-/GetKeysLambda ApiGetKeysLambdaFDF1A526 
 ├─ [~] Code
 │   └─ [~] .S3Key:
 │       ├─ [-] e879be6824f28368b30e679fce10c1e824b375566201922aab2c3896cfcc89bc.zip
 │       └─ [+] 4232ce2159ba2ea57751f84bc5b3c4a0ab762d6378d7d87c0a7d9e8b6971b15d.zip
 └─ [~] Metadata
     └─ [~] .aws:asset:path:
         ├─ [-] asset.e879be6824f28368b30e679fce10c1e824b375566201922aab2c3896cfcc89bc
         └─ [+] asset.4232ce2159ba2ea57751f84bc5b3c4a0ab762d6378d7d87c0a7d9e8b6971b15d
[~] AWS::Lambda::Function Api-/GetKeysPerDungeonLambda ApiGetKeysPerDungeonLambda073DE524 
 ├─ [~] Code
 │   └─ [~] .S3Key:
 │       ├─ [-] 6857a3821c4de6757d06019ba9dd75507df092fc82bb95c480d6885f4c60b456.zip
 │       └─ [+] e816caaa8d355ccedb622aca3b37cd28c95eb3f629649b85207a92c73f7abb6c.zip
 └─ [~] Metadata
     └─ [~] .aws:asset:path:
         ├─ [-] asset.6857a3821c4de6757d06019ba9dd75507df092fc82bb95c480d6885f4c60b456
         └─ [+] asset.e816caaa8d355ccedb622aca3b37cd28c95eb3f629649b85207a92c73f7abb6c
[~] AWS::Lambda::Function Api-/GetPlayerDamageDoneLambda ApiGetPlayerDamageDoneLambda7F052E98 
 ├─ [~] Code
 │   └─ [~] .S3Key:
 │       ├─ [-] 1dead25d404a1e85d975d399d23f0bee9c45c07b89e5a6b74d974e340155f287.zip
 │       └─ [+] fad8416ba9323f920207cfc896e469f5d03038b1fccf591c19f989300680e371.zip
 └─ [~] Metadata
     └─ [~] .aws:asset:path:
         ├─ [-] asset.1dead25d404a1e85d975d399d23f0bee9c45c07b89e5a6b74d974e340155f287
         └─ [+] asset.fad8416ba9323f920207cfc896e469f5d03038b1fccf591c19f989300680e371
[~] AWS::Lambda::Function Api-/Lambda ApiLambdaB75D04FB 
 ├─ [~] Code
 │   └─ [~] .S3Key:
 │       ├─ [-] c070daac02489a748e9e0644a4457029e3a83e5040022b98ebd633daa7185557.zip
 │       └─ [+] 2a2dd2b026f1d171665207eb38bc3f350f5dd3ffa7de786ad8e4158b50154c8e.zip
 └─ [~] Metadata
     └─ [~] .aws:asset:path:
         ├─ [-] asset.c070daac02489a748e9e0644a4457029e3a83e5040022b98ebd633daa7185557
         └─ [+] asset.2a2dd2b026f1d171665207eb38bc3f350f5dd3ffa7de786ad8e4158b50154c8e
[~] Custom::CDKBucketDeployment Frontend-/DeployWebsite/CustomResource FrontendDeployWebsiteCustomResource1B4A6C7F 
 └─ [~] SourceObjectKeys
     └─ @@ -1,3 +1,3 @@
        [ ] [
        [-]   "243ebf0b364a71e47601ee0c80c9b50fe18a3e8ea11ddca13e7d2086a947c771.zip"
        [+]   "c1587a27d93e18f26a3020c355e683dc77e257bf06e89cafd5a4017bbebcbb64.zip"
        [ ] ]
[~] AWS::Lambda::Function QueryKeys-/Lambda QueryKeysLambda58DE9A2E 
 ├─ [~] Code
 │   └─ [~] .S3Key:
 │       ├─ [-] 16b0a1161b37d26c070c219bfc5b8e277ee5e6626eb69f9b7f89e26b419a5014.zip
 │       └─ [+] ce3beb0072ff31dca6317b6746f87fb2e0ad54f1b73c049c4e6a44b8e17f0eb6.zip
 └─ [~] Metadata
     └─ [~] .aws:asset:path:
         ├─ [-] asset.16b0a1161b37d26c070c219bfc5b8e277ee5e6626eb69f9b7f89e26b419a5014
         └─ [+] asset.ce3beb0072ff31dca6317b6746f87fb2e0ad54f1b73c049c4e6a44b8e17f0eb6
[~] AWS::Lambda::Function InsertKeysToDynamodb-/Lambda InsertKeysToDynamodbLambda15825024 
 ├─ [~] Code
 │   └─ [~] .S3Key:
 │       ├─ [-] e81d233834310b1b15e9aac581e61ca55e1f54966dd7b93f625cd854d33bf683.zip
 │       └─ [+] c47e26a999cc90b262411956bdf17e2e8d5e68aebbc9884a4a22f04386674769.zip
 └─ [~] Metadata
     └─ [~] .aws:asset:path:
         ├─ [-] asset.e81d233834310b1b15e9aac581e61ca55e1f54966dd7b93f625cd854d33bf683
         └─ [+] asset.c47e26a999cc90b262411956bdf17e2e8d5e68aebbc9884a4a22f04386674769
[~] AWS::Lambda::Function InsertKeysToTimestream-/Lambda InsertKeysToTimestreamLambdaA07E952E 
 ├─ [~] Code
 │   └─ [~] .S3Key:
 │       ├─ [-] e0c251abbc9c1665ae58bd93643f4b257f80bd51509f4754bdf9dd24bdf51719.zip
 │       └─ [+] 23e1f4e1a6c4e48d71e8a0afeecb50a88887bd5d936a71a934a93faf8f703e15.zip
 └─ [~] Metadata
     └─ [~] .aws:asset:path:
         ├─ [-] asset.e0c251abbc9c1665ae58bd93643f4b257f80bd51509f4754bdf9dd24bdf51719
         └─ [+] asset.23e1f4e1a6c4e48d71e8a0afeecb50a88887bd5d936a71a934a93faf8f703e15
[~] AWS::Lambda::Function QueryPlayerDamageDone-/Lambda QueryPlayerDamageDoneLambda98AFC037 
 ├─ [~] Code
 │   └─ [~] .S3Key:
 │       ├─ [-] 427ec4d755977222255bbe84005f6dba679e30bb54e992274beea3085e71d82a.zip
 │       └─ [+] c2d8513f15bfe0f65d6004e34d199204c7163739bcdbe6cf2cd7c3549fff0e38.zip
 └─ [~] Metadata
     └─ [~] .aws:asset:path:
         ├─ [-] asset.427ec4d755977222255bbe84005f6dba679e30bb54e992274beea3085e71d82a
         └─ [+] asset.c2d8513f15bfe0f65d6004e34d199204c7163739bcdbe6cf2cd7c3549fff0e38
[~] AWS::Lambda::Function InsertPlayerDamageDoneToDynamodb-/Lambda InsertPlayerDamageDoneToDynamodbLambda659E0DA7 
 ├─ [~] Code
 │   └─ [~] .S3Key:
 │       ├─ [-] ca648d974272bfc1f79917ff9af9335697880157f35fa7a1382e7b014a774177.zip
 │       └─ [+] da6482ed79c5169ad840541dd59f4b7ab31fd938a7e76c8a654490494961d26e.zip
 └─ [~] Metadata
     └─ [~] .aws:asset:path:
         ├─ [-] asset.ca648d974272bfc1f79917ff9af9335697880157f35fa7a1382e7b014a774177
         └─ [+] asset.da6482ed79c5169ad840541dd59f4b7ab31fd938a7e76c8a654490494961d26e
[~] AWS::Lambda::Function Convert-/Lambda ConvertLambda3540DCCB 
 ├─ [~] Code
 │   └─ [~] .S3Key:
 │       ├─ [-] f08a80660ecc5650c47ecdd4a96d1892d9680678d381d999fdd77982a782fbb3.zip
 │       └─ [+] bebe0010975a11edc8db2741996e6d0e0c0ae2074e1e61dc4d5438e46cf9fb30.zip
 └─ [~] Metadata
     └─ [~] .aws:asset:path:
         ├─ [-] asset.f08a80660ecc5650c47ecdd4a96d1892d9680678d381d999fdd77982a782fbb3
         └─ [+] asset.bebe0010975a11edc8db2741996e6d0e0c0ae2074e1e61dc4d5438e46cf9fb30
[~] AWS::Synthetics::Canary Canary-/API CanaryAPI9F4B22EA 
 ├─ [~] Code
 │   └─ [~] .Script:
 │       ├─ [-] 
            var synthetics = require('Synthetics');
            const log = require('SyntheticsLogger');

            const apiCanaryBlueprint = async function () {
                const hostname = process.env.API_URL

                // Handle validation for positive scenario
                const validateSuccessful = async function(res) {
                    return new Promise((resolve, reject) => {
                        if (res.statusCode < 200 || res.statusCode > 299) {
                            throw res.statusCode + ' ' + res.statusMessage;
                        }

                        let responseBody = '';
                        res.on('data', (d) => {
                            responseBody += d;
                        });

                        res.on('end', () => {
                            // Add validation on 'responseBody' here if required.
                            resolve();
                        });
                    });
                };

                // Set request option for Verify /combatlogs/keys
                let requestOptionsStep1 = {
                    hostname: hostname,
                    method: 'GET',
                    path: '/combatlogs/keys',
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep1['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep1['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /combatlogs/keys
                let stepConfig1 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false,
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                await synthetics.executeHttpStep('Verify /combatlogs/keys', requestOptionsStep1, validateSuccessful, stepConfig1);

                // Set request option for Verify /presign/{filename}
                let requestOptionsStep2 = {
                    hostname: hostname,
                    method: 'POST',
                    path: '/presign/test.txt',
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep2['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep2['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /presign/{filename}
                let stepConfig2 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false,
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                await synthetics.executeHttpStep('Verify /presign/{filename}', requestOptionsStep2, validateSuccessful, stepConfig2);

                // Set request option for Verify /combatlogs/keys/{dungeon_id}
                let requestOptionsStep3 = {
                    hostname: hostname,
                    method: 'GET',
                    path: '/combatlogs/keys/2291',
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep3['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep3['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /combatlogs/keys/{dungeon_id}
                let stepConfig3 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false, 
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                // TODO: XMLHttpRequest
                // TODO: check response, must include body
                await synthetics.executeHttpStep('Verify /combatlogs/keys/{dungeon_id}', requestOptionsStep3, validateSuccessful, stepConfig3);

                const combatlogUUID = getCombatlogUUID(hostname)
                // Set request option for Verify /combatlogs/keys/{combatlog_uuid}/player-damage-done
                let requestOptionsStep4 = {
                    hostname: hostname,
                    method: 'GET',
                    path: '/combatlogs/keys/' + combatlogUUID,
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep4['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep4['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /combatlogs/keys/{combatlog_uuid}/player-damage-done
                let stepConfig4 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false,
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                await synthetics.executeHttpStep('Verify /combatlogs/keys/{combatlog_uuid}/player-damage-done', requestOptionsStep4, validateSuccessful, stepConfig4);

                // ----------------------------------------------------
                // Set request option for Verify /
                let requestOptionsStep5 = {
                    hostname: hostname,
                    method: 'GET',
                    path: '/',
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep4['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep4['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /
                let stepConfig5 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false,
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                await synthetics.executeHttpStep('Verify /', requestOptionsStep5, validateSuccessful, stepConfig5);
            };

            // neither fetch or XMLHttpRequest works and I can't install packages with inline code
            function getCombatlogUUID(apiUrl) {
                if (process.env.STAGE === "prod") {
                    return "ac18f293-e573-4994-8745-2a291d12bf9a"
                }
                return "2ac44ef5-d053-4232-881e-c8c21300ec4f"
                // let url = "https://" + apiUrl + "/combatlogs/keys"
                // let xmlHttp = new XMLHttpRequest()
                // xmlHttp.open( "GET", url, false ) // false for synchronous request
                // xmlHttp.send( null )
                // const resp = JSON.parse(xmlHttp.responseText)
                // return resp.data[0].combatlog_uuid
            }

            exports.handler = async () => {
                return await apiCanaryBlueprint();
            };

 │       └─ [+] 
            var synthetics = require('Synthetics');
            const log = require('SyntheticsLogger');

            const apiCanaryBlueprint = async function () {
                const hostname = process.env.API_URL
                const domainName = process.env.DOMAIN_NAME

                // Handle validation for positive scenario
                const validateSuccessful = async function(res) {
                    return new Promise((resolve, reject) => {
                        if (res.statusCode < 200 || res.statusCode > 299) {
                            throw res.statusCode + ' ' + res.statusMessage;
                        }

                        let responseBody = '';
                        res.on('data', (d) => {
                            responseBody += d;
                        });

                        res.on('end', () => {
                            // Add validation on 'responseBody' here if required.
                            resolve();
                        });
                    });
                };

                // Set request option for Verify /combatlogs/keys
                let requestOptionsStep1 = {
                    hostname: hostname,
                    method: 'GET',
                    path: '/combatlogs/keys',
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep1['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep1['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /combatlogs/keys
                let stepConfig1 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false,
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                await synthetics.executeHttpStep('Verify /combatlogs/keys', requestOptionsStep1, validateSuccessful, stepConfig1);

                // Set request option for Verify /presign/{filename}
                let requestOptionsStep2 = {
                    hostname: hostname,
                    method: 'POST',
                    path: '/presign/test.txt',
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep2['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep2['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /presign/{filename}
                let stepConfig2 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false,
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                await synthetics.executeHttpStep('Verify /presign/{filename}', requestOptionsStep2, validateSuccessful, stepConfig2);

                // Set request option for Verify /combatlogs/keys/{dungeon_id}
                let requestOptionsStep3 = {
                    hostname: hostname,
                    method: 'GET',
                    path: '/combatlogs/keys/2291',
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep3['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep3['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /combatlogs/keys/{dungeon_id}
                let stepConfig3 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false, 
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                // TODO: XMLHttpRequest
                // TODO: check response, must include body
                await synthetics.executeHttpStep('Verify /combatlogs/keys/{dungeon_id}', requestOptionsStep3, validateSuccessful, stepConfig3);

                const combatlogUUID = getCombatlogUUID(hostname)
                // Set request option for Verify /combatlogs/keys/{combatlog_uuid}/player-damage-done
                let requestOptionsStep4 = {
                    hostname: hostname,
                    method: 'GET',
                    path: '/combatlogs/keys/' + combatlogUUID,
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep4['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep4['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /combatlogs/keys/{combatlog_uuid}/player-damage-done
                let stepConfig4 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false,
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                await synthetics.executeHttpStep('Verify /combatlogs/keys/{combatlog_uuid}/player-damage-done', requestOptionsStep4, validateSuccessful, stepConfig4);

                // ----------------------------------------------------
                // Set request option for Verify /
                let requestOptionsStep5 = {
                    hostname: domainName,
                    method: 'GET',
                    path: '/',
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep4['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep4['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /
                let stepConfig5 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false,
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                await synthetics.executeHttpStep('Verify /', requestOptionsStep5, validateSuccessful, stepConfig5);
            };

            // neither fetch or XMLHttpRequest works and I can't install packages with inline code
            function getCombatlogUUID(apiUrl) {
                if (process.env.STAGE === "prod") {
                    return "ac18f293-e573-4994-8745-2a291d12bf9a"
                }
                return "2ac44ef5-d053-4232-881e-c8c21300ec4f"
                // let url = "https://" + apiUrl + "/combatlogs/keys"
                // let xmlHttp = new XMLHttpRequest()
                // xmlHttp.open( "GET", url, false ) // false for synchronous request
                // xmlHttp.send( null )
                // const resp = JSON.parse(xmlHttp.responseText)
                // return resp.data[0].combatlog_uuid
            }

            exports.handler = async () => {
                return await apiCanaryBlueprint();
            };

 └─ [~] RunConfig
     └─ [~] .EnvironmentVariables:
         └─ [+] Added: .DOMAIN_NAME
github-actions[bot] commented 3 years ago
Stack wm
Resources
[~] AWS::Lambda::Function Api-/GetKeysLambda ApiGetKeysLambdaFDF1A526 
 ├─ [~] Code
 │   └─ [~] .S3Key:
 │       ├─ [-] e879be6824f28368b30e679fce10c1e824b375566201922aab2c3896cfcc89bc.zip
 │       └─ [+] 4232ce2159ba2ea57751f84bc5b3c4a0ab762d6378d7d87c0a7d9e8b6971b15d.zip
 └─ [~] Metadata
     └─ [~] .aws:asset:path:
         ├─ [-] asset.e879be6824f28368b30e679fce10c1e824b375566201922aab2c3896cfcc89bc
         └─ [+] asset.4232ce2159ba2ea57751f84bc5b3c4a0ab762d6378d7d87c0a7d9e8b6971b15d
[~] AWS::Lambda::Function Api-/GetKeysPerDungeonLambda ApiGetKeysPerDungeonLambda073DE524 
 ├─ [~] Code
 │   └─ [~] .S3Key:
 │       ├─ [-] 6857a3821c4de6757d06019ba9dd75507df092fc82bb95c480d6885f4c60b456.zip
 │       └─ [+] e816caaa8d355ccedb622aca3b37cd28c95eb3f629649b85207a92c73f7abb6c.zip
 └─ [~] Metadata
     └─ [~] .aws:asset:path:
         ├─ [-] asset.6857a3821c4de6757d06019ba9dd75507df092fc82bb95c480d6885f4c60b456
         └─ [+] asset.e816caaa8d355ccedb622aca3b37cd28c95eb3f629649b85207a92c73f7abb6c
[~] AWS::Lambda::Function Api-/GetPlayerDamageDoneLambda ApiGetPlayerDamageDoneLambda7F052E98 
 ├─ [~] Code
 │   └─ [~] .S3Key:
 │       ├─ [-] 1dead25d404a1e85d975d399d23f0bee9c45c07b89e5a6b74d974e340155f287.zip
 │       └─ [+] fad8416ba9323f920207cfc896e469f5d03038b1fccf591c19f989300680e371.zip
 └─ [~] Metadata
     └─ [~] .aws:asset:path:
         ├─ [-] asset.1dead25d404a1e85d975d399d23f0bee9c45c07b89e5a6b74d974e340155f287
         └─ [+] asset.fad8416ba9323f920207cfc896e469f5d03038b1fccf591c19f989300680e371
[~] AWS::Lambda::Function Api-/Lambda ApiLambdaB75D04FB 
 ├─ [~] Code
 │   └─ [~] .S3Key:
 │       ├─ [-] c070daac02489a748e9e0644a4457029e3a83e5040022b98ebd633daa7185557.zip
 │       └─ [+] 2a2dd2b026f1d171665207eb38bc3f350f5dd3ffa7de786ad8e4158b50154c8e.zip
 └─ [~] Metadata
     └─ [~] .aws:asset:path:
         ├─ [-] asset.c070daac02489a748e9e0644a4457029e3a83e5040022b98ebd633daa7185557
         └─ [+] asset.2a2dd2b026f1d171665207eb38bc3f350f5dd3ffa7de786ad8e4158b50154c8e
[~] Custom::CDKBucketDeployment Frontend-/DeployWebsite/CustomResource FrontendDeployWebsiteCustomResource1B4A6C7F 
 └─ [~] SourceObjectKeys
     └─ @@ -1,3 +1,3 @@
        [ ] [
        [-]   "243ebf0b364a71e47601ee0c80c9b50fe18a3e8ea11ddca13e7d2086a947c771.zip"
        [+]   "c1587a27d93e18f26a3020c355e683dc77e257bf06e89cafd5a4017bbebcbb64.zip"
        [ ] ]
[~] AWS::Lambda::Function QueryKeys-/Lambda QueryKeysLambda58DE9A2E 
 ├─ [~] Code
 │   └─ [~] .S3Key:
 │       ├─ [-] 16b0a1161b37d26c070c219bfc5b8e277ee5e6626eb69f9b7f89e26b419a5014.zip
 │       └─ [+] ce3beb0072ff31dca6317b6746f87fb2e0ad54f1b73c049c4e6a44b8e17f0eb6.zip
 └─ [~] Metadata
     └─ [~] .aws:asset:path:
         ├─ [-] asset.16b0a1161b37d26c070c219bfc5b8e277ee5e6626eb69f9b7f89e26b419a5014
         └─ [+] asset.ce3beb0072ff31dca6317b6746f87fb2e0ad54f1b73c049c4e6a44b8e17f0eb6
[~] AWS::Lambda::Function InsertKeysToDynamodb-/Lambda InsertKeysToDynamodbLambda15825024 
 ├─ [~] Code
 │   └─ [~] .S3Key:
 │       ├─ [-] e81d233834310b1b15e9aac581e61ca55e1f54966dd7b93f625cd854d33bf683.zip
 │       └─ [+] c47e26a999cc90b262411956bdf17e2e8d5e68aebbc9884a4a22f04386674769.zip
 └─ [~] Metadata
     └─ [~] .aws:asset:path:
         ├─ [-] asset.e81d233834310b1b15e9aac581e61ca55e1f54966dd7b93f625cd854d33bf683
         └─ [+] asset.c47e26a999cc90b262411956bdf17e2e8d5e68aebbc9884a4a22f04386674769
[~] AWS::Lambda::Function InsertKeysToTimestream-/Lambda InsertKeysToTimestreamLambdaA07E952E 
 ├─ [~] Code
 │   └─ [~] .S3Key:
 │       ├─ [-] e0c251abbc9c1665ae58bd93643f4b257f80bd51509f4754bdf9dd24bdf51719.zip
 │       └─ [+] 23e1f4e1a6c4e48d71e8a0afeecb50a88887bd5d936a71a934a93faf8f703e15.zip
 └─ [~] Metadata
     └─ [~] .aws:asset:path:
         ├─ [-] asset.e0c251abbc9c1665ae58bd93643f4b257f80bd51509f4754bdf9dd24bdf51719
         └─ [+] asset.23e1f4e1a6c4e48d71e8a0afeecb50a88887bd5d936a71a934a93faf8f703e15
[~] AWS::Lambda::Function QueryPlayerDamageDone-/Lambda QueryPlayerDamageDoneLambda98AFC037 
 ├─ [~] Code
 │   └─ [~] .S3Key:
 │       ├─ [-] 427ec4d755977222255bbe84005f6dba679e30bb54e992274beea3085e71d82a.zip
 │       └─ [+] c2d8513f15bfe0f65d6004e34d199204c7163739bcdbe6cf2cd7c3549fff0e38.zip
 └─ [~] Metadata
     └─ [~] .aws:asset:path:
         ├─ [-] asset.427ec4d755977222255bbe84005f6dba679e30bb54e992274beea3085e71d82a
         └─ [+] asset.c2d8513f15bfe0f65d6004e34d199204c7163739bcdbe6cf2cd7c3549fff0e38
[~] AWS::Lambda::Function InsertPlayerDamageDoneToDynamodb-/Lambda InsertPlayerDamageDoneToDynamodbLambda659E0DA7 
 ├─ [~] Code
 │   └─ [~] .S3Key:
 │       ├─ [-] ca648d974272bfc1f79917ff9af9335697880157f35fa7a1382e7b014a774177.zip
 │       └─ [+] da6482ed79c5169ad840541dd59f4b7ab31fd938a7e76c8a654490494961d26e.zip
 └─ [~] Metadata
     └─ [~] .aws:asset:path:
         ├─ [-] asset.ca648d974272bfc1f79917ff9af9335697880157f35fa7a1382e7b014a774177
         └─ [+] asset.da6482ed79c5169ad840541dd59f4b7ab31fd938a7e76c8a654490494961d26e
[~] AWS::Lambda::Function Convert-/Lambda ConvertLambda3540DCCB 
 ├─ [~] Code
 │   └─ [~] .S3Key:
 │       ├─ [-] f08a80660ecc5650c47ecdd4a96d1892d9680678d381d999fdd77982a782fbb3.zip
 │       └─ [+] bebe0010975a11edc8db2741996e6d0e0c0ae2074e1e61dc4d5438e46cf9fb30.zip
 └─ [~] Metadata
     └─ [~] .aws:asset:path:
         ├─ [-] asset.f08a80660ecc5650c47ecdd4a96d1892d9680678d381d999fdd77982a782fbb3
         └─ [+] asset.bebe0010975a11edc8db2741996e6d0e0c0ae2074e1e61dc4d5438e46cf9fb30
[~] AWS::Synthetics::Canary Canary-/API CanaryAPI9F4B22EA 
 ├─ [~] Code
 │   └─ [~] .Script:
 │       ├─ [-] 
            var synthetics = require('Synthetics');
            const log = require('SyntheticsLogger');

            const apiCanaryBlueprint = async function () {
                const hostname = process.env.API_URL

                // Handle validation for positive scenario
                const validateSuccessful = async function(res) {
                    return new Promise((resolve, reject) => {
                        if (res.statusCode < 200 || res.statusCode > 299) {
                            throw res.statusCode + ' ' + res.statusMessage;
                        }

                        let responseBody = '';
                        res.on('data', (d) => {
                            responseBody += d;
                        });

                        res.on('end', () => {
                            // Add validation on 'responseBody' here if required.
                            resolve();
                        });
                    });
                };

                // Set request option for Verify /combatlogs/keys
                let requestOptionsStep1 = {
                    hostname: hostname,
                    method: 'GET',
                    path: '/combatlogs/keys',
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep1['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep1['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /combatlogs/keys
                let stepConfig1 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false,
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                await synthetics.executeHttpStep('Verify /combatlogs/keys', requestOptionsStep1, validateSuccessful, stepConfig1);

                // Set request option for Verify /presign/{filename}
                let requestOptionsStep2 = {
                    hostname: hostname,
                    method: 'POST',
                    path: '/presign/test.txt',
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep2['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep2['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /presign/{filename}
                let stepConfig2 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false,
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                await synthetics.executeHttpStep('Verify /presign/{filename}', requestOptionsStep2, validateSuccessful, stepConfig2);

                // Set request option for Verify /combatlogs/keys/{dungeon_id}
                let requestOptionsStep3 = {
                    hostname: hostname,
                    method: 'GET',
                    path: '/combatlogs/keys/2291',
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep3['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep3['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /combatlogs/keys/{dungeon_id}
                let stepConfig3 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false, 
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                // TODO: XMLHttpRequest
                // TODO: check response, must include body
                await synthetics.executeHttpStep('Verify /combatlogs/keys/{dungeon_id}', requestOptionsStep3, validateSuccessful, stepConfig3);

                const combatlogUUID = getCombatlogUUID(hostname)
                // Set request option for Verify /combatlogs/keys/{combatlog_uuid}/player-damage-done
                let requestOptionsStep4 = {
                    hostname: hostname,
                    method: 'GET',
                    path: '/combatlogs/keys/' + combatlogUUID,
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep4['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep4['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /combatlogs/keys/{combatlog_uuid}/player-damage-done
                let stepConfig4 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false,
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                await synthetics.executeHttpStep('Verify /combatlogs/keys/{combatlog_uuid}/player-damage-done', requestOptionsStep4, validateSuccessful, stepConfig4);

                // ----------------------------------------------------
                // Set request option for Verify /
                let requestOptionsStep5 = {
                    hostname: hostname,
                    method: 'GET',
                    path: '/',
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep4['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep4['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /
                let stepConfig5 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false,
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                await synthetics.executeHttpStep('Verify /', requestOptionsStep5, validateSuccessful, stepConfig5);
            };

            // neither fetch or XMLHttpRequest works and I can't install packages with inline code
            function getCombatlogUUID(apiUrl) {
                if (process.env.STAGE === "prod") {
                    return "ac18f293-e573-4994-8745-2a291d12bf9a"
                }
                return "2ac44ef5-d053-4232-881e-c8c21300ec4f"
                // let url = "https://" + apiUrl + "/combatlogs/keys"
                // let xmlHttp = new XMLHttpRequest()
                // xmlHttp.open( "GET", url, false ) // false for synchronous request
                // xmlHttp.send( null )
                // const resp = JSON.parse(xmlHttp.responseText)
                // return resp.data[0].combatlog_uuid
            }

            exports.handler = async () => {
                return await apiCanaryBlueprint();
            };

 │       └─ [+] 
            var synthetics = require('Synthetics');
            const log = require('SyntheticsLogger');

            const apiCanaryBlueprint = async function () {
                const hostname = process.env.API_URL
                const domainName = process.env.DOMAIN_NAME

                // Handle validation for positive scenario
                const validateSuccessful = async function(res) {
                    return new Promise((resolve, reject) => {
                        if (res.statusCode < 200 || res.statusCode > 299) {
                            throw res.statusCode + ' ' + res.statusMessage;
                        }

                        let responseBody = '';
                        res.on('data', (d) => {
                            responseBody += d;
                        });

                        res.on('end', () => {
                            // Add validation on 'responseBody' here if required.
                            resolve();
                        });
                    });
                };

                // Set request option for Verify /combatlogs/keys
                let requestOptionsStep1 = {
                    hostname: hostname,
                    method: 'GET',
                    path: '/combatlogs/keys',
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep1['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep1['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /combatlogs/keys
                let stepConfig1 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false,
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                await synthetics.executeHttpStep('Verify /combatlogs/keys', requestOptionsStep1, validateSuccessful, stepConfig1);

                // Set request option for Verify /presign/{filename}
                let requestOptionsStep2 = {
                    hostname: hostname,
                    method: 'POST',
                    path: '/presign/test.txt',
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep2['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep2['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /presign/{filename}
                let stepConfig2 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false,
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                await synthetics.executeHttpStep('Verify /presign/{filename}', requestOptionsStep2, validateSuccessful, stepConfig2);

                // Set request option for Verify /combatlogs/keys/{dungeon_id}
                let requestOptionsStep3 = {
                    hostname: hostname,
                    method: 'GET',
                    path: '/combatlogs/keys/2291',
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep3['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep3['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /combatlogs/keys/{dungeon_id}
                let stepConfig3 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false, 
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                // TODO: XMLHttpRequest
                // TODO: check response, must include body
                await synthetics.executeHttpStep('Verify /combatlogs/keys/{dungeon_id}', requestOptionsStep3, validateSuccessful, stepConfig3);

                const combatlogUUID = getCombatlogUUID(hostname)
                // Set request option for Verify /combatlogs/keys/{combatlog_uuid}/player-damage-done
                let requestOptionsStep4 = {
                    hostname: hostname,
                    method: 'GET',
                    path: '/combatlogs/keys/' + combatlogUUID,
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep4['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep4['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /combatlogs/keys/{combatlog_uuid}/player-damage-done
                let stepConfig4 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false,
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                await synthetics.executeHttpStep('Verify /combatlogs/keys/{combatlog_uuid}/player-damage-done', requestOptionsStep4, validateSuccessful, stepConfig4);

                // ----------------------------------------------------
                // Set request option for Verify /
                let requestOptionsStep5 = {
                    hostname: domainName,
                    method: 'GET',
                    path: '/',
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep4['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep4['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /
                let stepConfig5 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false,
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                await synthetics.executeHttpStep('Verify /', requestOptionsStep5, validateSuccessful, stepConfig5);
            };

            // neither fetch or XMLHttpRequest works and I can't install packages with inline code
            function getCombatlogUUID(apiUrl) {
                if (process.env.STAGE === "prod") {
                    return "ac18f293-e573-4994-8745-2a291d12bf9a"
                }
                return "2ac44ef5-d053-4232-881e-c8c21300ec4f"
                // let url = "https://" + apiUrl + "/combatlogs/keys"
                // let xmlHttp = new XMLHttpRequest()
                // xmlHttp.open( "GET", url, false ) // false for synchronous request
                // xmlHttp.send( null )
                // const resp = JSON.parse(xmlHttp.responseText)
                // return resp.data[0].combatlog_uuid
            }

            exports.handler = async () => {
                return await apiCanaryBlueprint();
            };

 └─ [~] RunConfig
     └─ [~] .EnvironmentVariables:
         └─ [+] Added: .DOMAIN_NAME
github-actions[bot] commented 3 years ago
Stack wm
Resources
[~] AWS::Lambda::Function Api-/GetKeysLambda ApiGetKeysLambdaFDF1A526 
 ├─ [~] Code
 │   └─ [~] .S3Key:
 │       ├─ [-] e879be6824f28368b30e679fce10c1e824b375566201922aab2c3896cfcc89bc.zip
 │       └─ [+] 4232ce2159ba2ea57751f84bc5b3c4a0ab762d6378d7d87c0a7d9e8b6971b15d.zip
 └─ [~] Metadata
     └─ [~] .aws:asset:path:
         ├─ [-] asset.e879be6824f28368b30e679fce10c1e824b375566201922aab2c3896cfcc89bc
         └─ [+] asset.4232ce2159ba2ea57751f84bc5b3c4a0ab762d6378d7d87c0a7d9e8b6971b15d
[~] AWS::Lambda::Function Api-/GetKeysPerDungeonLambda ApiGetKeysPerDungeonLambda073DE524 
 ├─ [~] Code
 │   └─ [~] .S3Key:
 │       ├─ [-] 6857a3821c4de6757d06019ba9dd75507df092fc82bb95c480d6885f4c60b456.zip
 │       └─ [+] e816caaa8d355ccedb622aca3b37cd28c95eb3f629649b85207a92c73f7abb6c.zip
 └─ [~] Metadata
     └─ [~] .aws:asset:path:
         ├─ [-] asset.6857a3821c4de6757d06019ba9dd75507df092fc82bb95c480d6885f4c60b456
         └─ [+] asset.e816caaa8d355ccedb622aca3b37cd28c95eb3f629649b85207a92c73f7abb6c
[~] AWS::Lambda::Function Api-/GetPlayerDamageDoneLambda ApiGetPlayerDamageDoneLambda7F052E98 
 ├─ [~] Code
 │   └─ [~] .S3Key:
 │       ├─ [-] 1dead25d404a1e85d975d399d23f0bee9c45c07b89e5a6b74d974e340155f287.zip
 │       └─ [+] fad8416ba9323f920207cfc896e469f5d03038b1fccf591c19f989300680e371.zip
 └─ [~] Metadata
     └─ [~] .aws:asset:path:
         ├─ [-] asset.1dead25d404a1e85d975d399d23f0bee9c45c07b89e5a6b74d974e340155f287
         └─ [+] asset.fad8416ba9323f920207cfc896e469f5d03038b1fccf591c19f989300680e371
[~] AWS::Lambda::Function Api-/Lambda ApiLambdaB75D04FB 
 ├─ [~] Code
 │   └─ [~] .S3Key:
 │       ├─ [-] c070daac02489a748e9e0644a4457029e3a83e5040022b98ebd633daa7185557.zip
 │       └─ [+] 2a2dd2b026f1d171665207eb38bc3f350f5dd3ffa7de786ad8e4158b50154c8e.zip
 └─ [~] Metadata
     └─ [~] .aws:asset:path:
         ├─ [-] asset.c070daac02489a748e9e0644a4457029e3a83e5040022b98ebd633daa7185557
         └─ [+] asset.2a2dd2b026f1d171665207eb38bc3f350f5dd3ffa7de786ad8e4158b50154c8e
[~] Custom::CDKBucketDeployment Frontend-/DeployWebsite/CustomResource FrontendDeployWebsiteCustomResource1B4A6C7F 
 └─ [~] SourceObjectKeys
     └─ @@ -1,3 +1,3 @@
        [ ] [
        [-]   "243ebf0b364a71e47601ee0c80c9b50fe18a3e8ea11ddca13e7d2086a947c771.zip"
        [+]   "c1587a27d93e18f26a3020c355e683dc77e257bf06e89cafd5a4017bbebcbb64.zip"
        [ ] ]
[~] AWS::Lambda::Function QueryKeys-/Lambda QueryKeysLambda58DE9A2E 
 ├─ [~] Code
 │   └─ [~] .S3Key:
 │       ├─ [-] 16b0a1161b37d26c070c219bfc5b8e277ee5e6626eb69f9b7f89e26b419a5014.zip
 │       └─ [+] ce3beb0072ff31dca6317b6746f87fb2e0ad54f1b73c049c4e6a44b8e17f0eb6.zip
 └─ [~] Metadata
     └─ [~] .aws:asset:path:
         ├─ [-] asset.16b0a1161b37d26c070c219bfc5b8e277ee5e6626eb69f9b7f89e26b419a5014
         └─ [+] asset.ce3beb0072ff31dca6317b6746f87fb2e0ad54f1b73c049c4e6a44b8e17f0eb6
[~] AWS::Lambda::Function InsertKeysToDynamodb-/Lambda InsertKeysToDynamodbLambda15825024 
 ├─ [~] Code
 │   └─ [~] .S3Key:
 │       ├─ [-] e81d233834310b1b15e9aac581e61ca55e1f54966dd7b93f625cd854d33bf683.zip
 │       └─ [+] c47e26a999cc90b262411956bdf17e2e8d5e68aebbc9884a4a22f04386674769.zip
 └─ [~] Metadata
     └─ [~] .aws:asset:path:
         ├─ [-] asset.e81d233834310b1b15e9aac581e61ca55e1f54966dd7b93f625cd854d33bf683
         └─ [+] asset.c47e26a999cc90b262411956bdf17e2e8d5e68aebbc9884a4a22f04386674769
[~] AWS::Lambda::Function InsertKeysToTimestream-/Lambda InsertKeysToTimestreamLambdaA07E952E 
 ├─ [~] Code
 │   └─ [~] .S3Key:
 │       ├─ [-] e0c251abbc9c1665ae58bd93643f4b257f80bd51509f4754bdf9dd24bdf51719.zip
 │       └─ [+] 23e1f4e1a6c4e48d71e8a0afeecb50a88887bd5d936a71a934a93faf8f703e15.zip
 └─ [~] Metadata
     └─ [~] .aws:asset:path:
         ├─ [-] asset.e0c251abbc9c1665ae58bd93643f4b257f80bd51509f4754bdf9dd24bdf51719
         └─ [+] asset.23e1f4e1a6c4e48d71e8a0afeecb50a88887bd5d936a71a934a93faf8f703e15
[~] AWS::Lambda::Function QueryPlayerDamageDone-/Lambda QueryPlayerDamageDoneLambda98AFC037 
 ├─ [~] Code
 │   └─ [~] .S3Key:
 │       ├─ [-] 427ec4d755977222255bbe84005f6dba679e30bb54e992274beea3085e71d82a.zip
 │       └─ [+] c2d8513f15bfe0f65d6004e34d199204c7163739bcdbe6cf2cd7c3549fff0e38.zip
 └─ [~] Metadata
     └─ [~] .aws:asset:path:
         ├─ [-] asset.427ec4d755977222255bbe84005f6dba679e30bb54e992274beea3085e71d82a
         └─ [+] asset.c2d8513f15bfe0f65d6004e34d199204c7163739bcdbe6cf2cd7c3549fff0e38
[~] AWS::Lambda::Function InsertPlayerDamageDoneToDynamodb-/Lambda InsertPlayerDamageDoneToDynamodbLambda659E0DA7 
 ├─ [~] Code
 │   └─ [~] .S3Key:
 │       ├─ [-] ca648d974272bfc1f79917ff9af9335697880157f35fa7a1382e7b014a774177.zip
 │       └─ [+] da6482ed79c5169ad840541dd59f4b7ab31fd938a7e76c8a654490494961d26e.zip
 └─ [~] Metadata
     └─ [~] .aws:asset:path:
         ├─ [-] asset.ca648d974272bfc1f79917ff9af9335697880157f35fa7a1382e7b014a774177
         └─ [+] asset.da6482ed79c5169ad840541dd59f4b7ab31fd938a7e76c8a654490494961d26e
[~] AWS::Lambda::Function Convert-/Lambda ConvertLambda3540DCCB 
 ├─ [~] Code
 │   └─ [~] .S3Key:
 │       ├─ [-] f08a80660ecc5650c47ecdd4a96d1892d9680678d381d999fdd77982a782fbb3.zip
 │       └─ [+] bebe0010975a11edc8db2741996e6d0e0c0ae2074e1e61dc4d5438e46cf9fb30.zip
 └─ [~] Metadata
     └─ [~] .aws:asset:path:
         ├─ [-] asset.f08a80660ecc5650c47ecdd4a96d1892d9680678d381d999fdd77982a782fbb3
         └─ [+] asset.bebe0010975a11edc8db2741996e6d0e0c0ae2074e1e61dc4d5438e46cf9fb30
[~] AWS::Synthetics::Canary Canary-/API CanaryAPI9F4B22EA 
 ├─ [~] Code
 │   └─ [~] .Script:
 │       ├─ [-] 
            var synthetics = require('Synthetics');
            const log = require('SyntheticsLogger');

            const apiCanaryBlueprint = async function () {
                const hostname = process.env.API_URL

                // Handle validation for positive scenario
                const validateSuccessful = async function(res) {
                    return new Promise((resolve, reject) => {
                        if (res.statusCode < 200 || res.statusCode > 299) {
                            throw res.statusCode + ' ' + res.statusMessage;
                        }

                        let responseBody = '';
                        res.on('data', (d) => {
                            responseBody += d;
                        });

                        res.on('end', () => {
                            // Add validation on 'responseBody' here if required.
                            resolve();
                        });
                    });
                };

                // Set request option for Verify /combatlogs/keys
                let requestOptionsStep1 = {
                    hostname: hostname,
                    method: 'GET',
                    path: '/combatlogs/keys',
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep1['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep1['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /combatlogs/keys
                let stepConfig1 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false,
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                await synthetics.executeHttpStep('Verify /combatlogs/keys', requestOptionsStep1, validateSuccessful, stepConfig1);

                // Set request option for Verify /presign/{filename}
                let requestOptionsStep2 = {
                    hostname: hostname,
                    method: 'POST',
                    path: '/presign/test.txt',
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep2['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep2['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /presign/{filename}
                let stepConfig2 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false,
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                await synthetics.executeHttpStep('Verify /presign/{filename}', requestOptionsStep2, validateSuccessful, stepConfig2);

                // Set request option for Verify /combatlogs/keys/{dungeon_id}
                let requestOptionsStep3 = {
                    hostname: hostname,
                    method: 'GET',
                    path: '/combatlogs/keys/2291',
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep3['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep3['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /combatlogs/keys/{dungeon_id}
                let stepConfig3 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false, 
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                // TODO: XMLHttpRequest
                // TODO: check response, must include body
                await synthetics.executeHttpStep('Verify /combatlogs/keys/{dungeon_id}', requestOptionsStep3, validateSuccessful, stepConfig3);

                const combatlogUUID = getCombatlogUUID(hostname)
                // Set request option for Verify /combatlogs/keys/{combatlog_uuid}/player-damage-done
                let requestOptionsStep4 = {
                    hostname: hostname,
                    method: 'GET',
                    path: '/combatlogs/keys/' + combatlogUUID,
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep4['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep4['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /combatlogs/keys/{combatlog_uuid}/player-damage-done
                let stepConfig4 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false,
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                await synthetics.executeHttpStep('Verify /combatlogs/keys/{combatlog_uuid}/player-damage-done', requestOptionsStep4, validateSuccessful, stepConfig4);

                // ----------------------------------------------------
                // Set request option for Verify /
                let requestOptionsStep5 = {
                    hostname: hostname,
                    method: 'GET',
                    path: '/',
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep4['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep4['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /
                let stepConfig5 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false,
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                await synthetics.executeHttpStep('Verify /', requestOptionsStep5, validateSuccessful, stepConfig5);
            };

            // neither fetch or XMLHttpRequest works and I can't install packages with inline code
            function getCombatlogUUID(apiUrl) {
                if (process.env.STAGE === "prod") {
                    return "ac18f293-e573-4994-8745-2a291d12bf9a"
                }
                return "2ac44ef5-d053-4232-881e-c8c21300ec4f"
                // let url = "https://" + apiUrl + "/combatlogs/keys"
                // let xmlHttp = new XMLHttpRequest()
                // xmlHttp.open( "GET", url, false ) // false for synchronous request
                // xmlHttp.send( null )
                // const resp = JSON.parse(xmlHttp.responseText)
                // return resp.data[0].combatlog_uuid
            }

            exports.handler = async () => {
                return await apiCanaryBlueprint();
            };

 │       └─ [+] 
            var synthetics = require('Synthetics');
            const log = require('SyntheticsLogger');

            const apiCanaryBlueprint = async function () {
                const hostname = process.env.API_URL
                const domainName = process.env.DOMAIN_NAME

                // Handle validation for positive scenario
                const validateSuccessful = async function(res) {
                    return new Promise((resolve, reject) => {
                        if (res.statusCode < 200 || res.statusCode > 299) {
                            throw res.statusCode + ' ' + res.statusMessage;
                        }

                        let responseBody = '';
                        res.on('data', (d) => {
                            responseBody += d;
                        });

                        res.on('end', () => {
                            // Add validation on 'responseBody' here if required.
                            resolve();
                        });
                    });
                };

                // Set request option for Verify /combatlogs/keys
                let requestOptionsStep1 = {
                    hostname: hostname,
                    method: 'GET',
                    path: '/combatlogs/keys',
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep1['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep1['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /combatlogs/keys
                let stepConfig1 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false,
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                await synthetics.executeHttpStep('Verify /combatlogs/keys', requestOptionsStep1, validateSuccessful, stepConfig1);

                // Set request option for Verify /presign/{filename}
                let requestOptionsStep2 = {
                    hostname: hostname,
                    method: 'POST',
                    path: '/presign/test.txt',
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep2['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep2['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /presign/{filename}
                let stepConfig2 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false,
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                await synthetics.executeHttpStep('Verify /presign/{filename}', requestOptionsStep2, validateSuccessful, stepConfig2);

                // Set request option for Verify /combatlogs/keys/{dungeon_id}
                let requestOptionsStep3 = {
                    hostname: hostname,
                    method: 'GET',
                    path: '/combatlogs/keys/2291',
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep3['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep3['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /combatlogs/keys/{dungeon_id}
                let stepConfig3 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false, 
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                // TODO: XMLHttpRequest
                // TODO: check response, must include body
                await synthetics.executeHttpStep('Verify /combatlogs/keys/{dungeon_id}', requestOptionsStep3, validateSuccessful, stepConfig3);

                const combatlogUUID = getCombatlogUUID(hostname)
                // Set request option for Verify /combatlogs/keys/{combatlog_uuid}/player-damage-done
                let requestOptionsStep4 = {
                    hostname: hostname,
                    method: 'GET',
                    path: '/combatlogs/keys/' + combatlogUUID,
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep4['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep4['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /combatlogs/keys/{combatlog_uuid}/player-damage-done
                let stepConfig4 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false,
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                await synthetics.executeHttpStep('Verify /combatlogs/keys/{combatlog_uuid}/player-damage-done', requestOptionsStep4, validateSuccessful, stepConfig4);

                // ----------------------------------------------------
                // Set request option for Verify /
                let requestOptionsStep5 = {
                    hostname: domainName,
                    method: 'GET',
                    path: '/',
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep4['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep4['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /
                let stepConfig5 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false,
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                await synthetics.executeHttpStep('Verify /', requestOptionsStep5, validateSuccessful, stepConfig5);
            };

            // neither fetch or XMLHttpRequest works and I can't install packages with inline code
            function getCombatlogUUID(apiUrl) {
                if (process.env.STAGE === "prod") {
                    return "ac18f293-e573-4994-8745-2a291d12bf9a"
                }
                return "2ac44ef5-d053-4232-881e-c8c21300ec4f"
                // let url = "https://" + apiUrl + "/combatlogs/keys"
                // let xmlHttp = new XMLHttpRequest()
                // xmlHttp.open( "GET", url, false ) // false for synchronous request
                // xmlHttp.send( null )
                // const resp = JSON.parse(xmlHttp.responseText)
                // return resp.data[0].combatlog_uuid
            }

            exports.handler = async () => {
                return await apiCanaryBlueprint();
            };

 └─ [~] RunConfig
     └─ [~] .EnvironmentVariables:
         └─ [+] Added: .DOMAIN_NAME
github-actions[bot] commented 3 years ago
Stack wm
Resources
[~] AWS::Lambda::Function Api-/GetKeysLambda ApiGetKeysLambdaFDF1A526 
 ├─ [~] Code
 │   └─ [~] .S3Key:
 │       ├─ [-] e879be6824f28368b30e679fce10c1e824b375566201922aab2c3896cfcc89bc.zip
 │       └─ [+] 4232ce2159ba2ea57751f84bc5b3c4a0ab762d6378d7d87c0a7d9e8b6971b15d.zip
 └─ [~] Metadata
     └─ [~] .aws:asset:path:
         ├─ [-] asset.e879be6824f28368b30e679fce10c1e824b375566201922aab2c3896cfcc89bc
         └─ [+] asset.4232ce2159ba2ea57751f84bc5b3c4a0ab762d6378d7d87c0a7d9e8b6971b15d
[~] AWS::Lambda::Function Api-/GetKeysPerDungeonLambda ApiGetKeysPerDungeonLambda073DE524 
 ├─ [~] Code
 │   └─ [~] .S3Key:
 │       ├─ [-] 6857a3821c4de6757d06019ba9dd75507df092fc82bb95c480d6885f4c60b456.zip
 │       └─ [+] e816caaa8d355ccedb622aca3b37cd28c95eb3f629649b85207a92c73f7abb6c.zip
 └─ [~] Metadata
     └─ [~] .aws:asset:path:
         ├─ [-] asset.6857a3821c4de6757d06019ba9dd75507df092fc82bb95c480d6885f4c60b456
         └─ [+] asset.e816caaa8d355ccedb622aca3b37cd28c95eb3f629649b85207a92c73f7abb6c
[~] AWS::Lambda::Function Api-/GetPlayerDamageDoneLambda ApiGetPlayerDamageDoneLambda7F052E98 
 ├─ [~] Code
 │   └─ [~] .S3Key:
 │       ├─ [-] 1dead25d404a1e85d975d399d23f0bee9c45c07b89e5a6b74d974e340155f287.zip
 │       └─ [+] fad8416ba9323f920207cfc896e469f5d03038b1fccf591c19f989300680e371.zip
 └─ [~] Metadata
     └─ [~] .aws:asset:path:
         ├─ [-] asset.1dead25d404a1e85d975d399d23f0bee9c45c07b89e5a6b74d974e340155f287
         └─ [+] asset.fad8416ba9323f920207cfc896e469f5d03038b1fccf591c19f989300680e371
[~] AWS::Lambda::Function Api-/Lambda ApiLambdaB75D04FB 
 ├─ [~] Code
 │   └─ [~] .S3Key:
 │       ├─ [-] c070daac02489a748e9e0644a4457029e3a83e5040022b98ebd633daa7185557.zip
 │       └─ [+] 2a2dd2b026f1d171665207eb38bc3f350f5dd3ffa7de786ad8e4158b50154c8e.zip
 └─ [~] Metadata
     └─ [~] .aws:asset:path:
         ├─ [-] asset.c070daac02489a748e9e0644a4457029e3a83e5040022b98ebd633daa7185557
         └─ [+] asset.2a2dd2b026f1d171665207eb38bc3f350f5dd3ffa7de786ad8e4158b50154c8e
[~] Custom::CDKBucketDeployment Frontend-/DeployWebsite/CustomResource FrontendDeployWebsiteCustomResource1B4A6C7F 
 └─ [~] SourceObjectKeys
     └─ @@ -1,3 +1,3 @@
        [ ] [
        [-]   "243ebf0b364a71e47601ee0c80c9b50fe18a3e8ea11ddca13e7d2086a947c771.zip"
        [+]   "c1587a27d93e18f26a3020c355e683dc77e257bf06e89cafd5a4017bbebcbb64.zip"
        [ ] ]
[~] AWS::Lambda::Function QueryKeys-/Lambda QueryKeysLambda58DE9A2E 
 ├─ [~] Code
 │   └─ [~] .S3Key:
 │       ├─ [-] 16b0a1161b37d26c070c219bfc5b8e277ee5e6626eb69f9b7f89e26b419a5014.zip
 │       └─ [+] ce3beb0072ff31dca6317b6746f87fb2e0ad54f1b73c049c4e6a44b8e17f0eb6.zip
 └─ [~] Metadata
     └─ [~] .aws:asset:path:
         ├─ [-] asset.16b0a1161b37d26c070c219bfc5b8e277ee5e6626eb69f9b7f89e26b419a5014
         └─ [+] asset.ce3beb0072ff31dca6317b6746f87fb2e0ad54f1b73c049c4e6a44b8e17f0eb6
[~] AWS::Lambda::Function InsertKeysToDynamodb-/Lambda InsertKeysToDynamodbLambda15825024 
 ├─ [~] Code
 │   └─ [~] .S3Key:
 │       ├─ [-] e81d233834310b1b15e9aac581e61ca55e1f54966dd7b93f625cd854d33bf683.zip
 │       └─ [+] c47e26a999cc90b262411956bdf17e2e8d5e68aebbc9884a4a22f04386674769.zip
 └─ [~] Metadata
     └─ [~] .aws:asset:path:
         ├─ [-] asset.e81d233834310b1b15e9aac581e61ca55e1f54966dd7b93f625cd854d33bf683
         └─ [+] asset.c47e26a999cc90b262411956bdf17e2e8d5e68aebbc9884a4a22f04386674769
[~] AWS::Lambda::Function InsertKeysToTimestream-/Lambda InsertKeysToTimestreamLambdaA07E952E 
 ├─ [~] Code
 │   └─ [~] .S3Key:
 │       ├─ [-] e0c251abbc9c1665ae58bd93643f4b257f80bd51509f4754bdf9dd24bdf51719.zip
 │       └─ [+] 23e1f4e1a6c4e48d71e8a0afeecb50a88887bd5d936a71a934a93faf8f703e15.zip
 └─ [~] Metadata
     └─ [~] .aws:asset:path:
         ├─ [-] asset.e0c251abbc9c1665ae58bd93643f4b257f80bd51509f4754bdf9dd24bdf51719
         └─ [+] asset.23e1f4e1a6c4e48d71e8a0afeecb50a88887bd5d936a71a934a93faf8f703e15
[~] AWS::Lambda::Function QueryPlayerDamageDone-/Lambda QueryPlayerDamageDoneLambda98AFC037 
 ├─ [~] Code
 │   └─ [~] .S3Key:
 │       ├─ [-] 427ec4d755977222255bbe84005f6dba679e30bb54e992274beea3085e71d82a.zip
 │       └─ [+] abc3d74c2e2beb807ad1da6d83e5c347eaa6f41515894ad03e55d4dab91065d3.zip
 └─ [~] Metadata
     └─ [~] .aws:asset:path:
         ├─ [-] asset.427ec4d755977222255bbe84005f6dba679e30bb54e992274beea3085e71d82a
         └─ [+] asset.abc3d74c2e2beb807ad1da6d83e5c347eaa6f41515894ad03e55d4dab91065d3
[~] AWS::Lambda::Function InsertPlayerDamageDoneToDynamodb-/Lambda InsertPlayerDamageDoneToDynamodbLambda659E0DA7 
 ├─ [~] Code
 │   └─ [~] .S3Key:
 │       ├─ [-] ca648d974272bfc1f79917ff9af9335697880157f35fa7a1382e7b014a774177.zip
 │       └─ [+] da6482ed79c5169ad840541dd59f4b7ab31fd938a7e76c8a654490494961d26e.zip
 └─ [~] Metadata
     └─ [~] .aws:asset:path:
         ├─ [-] asset.ca648d974272bfc1f79917ff9af9335697880157f35fa7a1382e7b014a774177
         └─ [+] asset.da6482ed79c5169ad840541dd59f4b7ab31fd938a7e76c8a654490494961d26e
[~] AWS::Lambda::Function Convert-/Lambda ConvertLambda3540DCCB 
 ├─ [~] Code
 │   └─ [~] .S3Key:
 │       ├─ [-] f08a80660ecc5650c47ecdd4a96d1892d9680678d381d999fdd77982a782fbb3.zip
 │       └─ [+] bebe0010975a11edc8db2741996e6d0e0c0ae2074e1e61dc4d5438e46cf9fb30.zip
 └─ [~] Metadata
     └─ [~] .aws:asset:path:
         ├─ [-] asset.f08a80660ecc5650c47ecdd4a96d1892d9680678d381d999fdd77982a782fbb3
         └─ [+] asset.bebe0010975a11edc8db2741996e6d0e0c0ae2074e1e61dc4d5438e46cf9fb30
[~] AWS::Synthetics::Canary Canary-/API CanaryAPI9F4B22EA 
 ├─ [~] Code
 │   └─ [~] .Script:
 │       ├─ [-] 
            var synthetics = require('Synthetics');
            const log = require('SyntheticsLogger');

            const apiCanaryBlueprint = async function () {
                const hostname = process.env.API_URL

                // Handle validation for positive scenario
                const validateSuccessful = async function(res) {
                    return new Promise((resolve, reject) => {
                        if (res.statusCode < 200 || res.statusCode > 299) {
                            throw res.statusCode + ' ' + res.statusMessage;
                        }

                        let responseBody = '';
                        res.on('data', (d) => {
                            responseBody += d;
                        });

                        res.on('end', () => {
                            // Add validation on 'responseBody' here if required.
                            resolve();
                        });
                    });
                };

                // Set request option for Verify /combatlogs/keys
                let requestOptionsStep1 = {
                    hostname: hostname,
                    method: 'GET',
                    path: '/combatlogs/keys',
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep1['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep1['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /combatlogs/keys
                let stepConfig1 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false,
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                await synthetics.executeHttpStep('Verify /combatlogs/keys', requestOptionsStep1, validateSuccessful, stepConfig1);

                // Set request option for Verify /presign/{filename}
                let requestOptionsStep2 = {
                    hostname: hostname,
                    method: 'POST',
                    path: '/presign/test.txt',
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep2['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep2['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /presign/{filename}
                let stepConfig2 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false,
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                await synthetics.executeHttpStep('Verify /presign/{filename}', requestOptionsStep2, validateSuccessful, stepConfig2);

                // Set request option for Verify /combatlogs/keys/{dungeon_id}
                let requestOptionsStep3 = {
                    hostname: hostname,
                    method: 'GET',
                    path: '/combatlogs/keys/2291',
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep3['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep3['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /combatlogs/keys/{dungeon_id}
                let stepConfig3 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false, 
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                // TODO: XMLHttpRequest
                // TODO: check response, must include body
                await synthetics.executeHttpStep('Verify /combatlogs/keys/{dungeon_id}', requestOptionsStep3, validateSuccessful, stepConfig3);

                const combatlogUUID = getCombatlogUUID(hostname)
                // Set request option for Verify /combatlogs/keys/{combatlog_uuid}/player-damage-done
                let requestOptionsStep4 = {
                    hostname: hostname,
                    method: 'GET',
                    path: '/combatlogs/keys/' + combatlogUUID,
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep4['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep4['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /combatlogs/keys/{combatlog_uuid}/player-damage-done
                let stepConfig4 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false,
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                await synthetics.executeHttpStep('Verify /combatlogs/keys/{combatlog_uuid}/player-damage-done', requestOptionsStep4, validateSuccessful, stepConfig4);

                // ----------------------------------------------------
                // Set request option for Verify /
                let requestOptionsStep5 = {
                    hostname: hostname,
                    method: 'GET',
                    path: '/',
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep4['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep4['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /
                let stepConfig5 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false,
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                await synthetics.executeHttpStep('Verify /', requestOptionsStep5, validateSuccessful, stepConfig5);
            };

            // neither fetch or XMLHttpRequest works and I can't install packages with inline code
            function getCombatlogUUID(apiUrl) {
                if (process.env.STAGE === "prod") {
                    return "ac18f293-e573-4994-8745-2a291d12bf9a"
                }
                return "2ac44ef5-d053-4232-881e-c8c21300ec4f"
                // let url = "https://" + apiUrl + "/combatlogs/keys"
                // let xmlHttp = new XMLHttpRequest()
                // xmlHttp.open( "GET", url, false ) // false for synchronous request
                // xmlHttp.send( null )
                // const resp = JSON.parse(xmlHttp.responseText)
                // return resp.data[0].combatlog_uuid
            }

            exports.handler = async () => {
                return await apiCanaryBlueprint();
            };

 │       └─ [+] 
            var synthetics = require('Synthetics');
            const log = require('SyntheticsLogger');

            const apiCanaryBlueprint = async function () {
                const hostname = process.env.API_URL
                const domainName = process.env.DOMAIN_NAME

                // Handle validation for positive scenario
                const validateSuccessful = async function(res) {
                    return new Promise((resolve, reject) => {
                        if (res.statusCode < 200 || res.statusCode > 299) {
                            throw res.statusCode + ' ' + res.statusMessage;
                        }

                        let responseBody = '';
                        res.on('data', (d) => {
                            responseBody += d;
                        });

                        res.on('end', () => {
                            // Add validation on 'responseBody' here if required.
                            resolve();
                        });
                    });
                };

                // Set request option for Verify /combatlogs/keys
                let requestOptionsStep1 = {
                    hostname: hostname,
                    method: 'GET',
                    path: '/combatlogs/keys',
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep1['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep1['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /combatlogs/keys
                let stepConfig1 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false,
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                await synthetics.executeHttpStep('Verify /combatlogs/keys', requestOptionsStep1, validateSuccessful, stepConfig1);

                // Set request option for Verify /presign/{filename}
                let requestOptionsStep2 = {
                    hostname: hostname,
                    method: 'POST',
                    path: '/presign/test.txt',
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep2['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep2['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /presign/{filename}
                let stepConfig2 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false,
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                await synthetics.executeHttpStep('Verify /presign/{filename}', requestOptionsStep2, validateSuccessful, stepConfig2);

                // Set request option for Verify /combatlogs/keys/{dungeon_id}
                let requestOptionsStep3 = {
                    hostname: hostname,
                    method: 'GET',
                    path: '/combatlogs/keys/2291',
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep3['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep3['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /combatlogs/keys/{dungeon_id}
                let stepConfig3 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false, 
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                // TODO: XMLHttpRequest
                // TODO: check response, must include body
                await synthetics.executeHttpStep('Verify /combatlogs/keys/{dungeon_id}', requestOptionsStep3, validateSuccessful, stepConfig3);

                const combatlogUUID = getCombatlogUUID(hostname)
                // Set request option for Verify /combatlogs/keys/{combatlog_uuid}/player-damage-done
                let requestOptionsStep4 = {
                    hostname: hostname,
                    method: 'GET',
                    path: '/combatlogs/keys/' + combatlogUUID,
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep4['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep4['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /combatlogs/keys/{combatlog_uuid}/player-damage-done
                let stepConfig4 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false,
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                await synthetics.executeHttpStep('Verify /combatlogs/keys/{combatlog_uuid}/player-damage-done', requestOptionsStep4, validateSuccessful, stepConfig4);

                // ----------------------------------------------------
                // Set request option for Verify /
                let requestOptionsStep5 = {
                    hostname: domainName,
                    method: 'GET',
                    path: '/',
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep4['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep4['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /
                let stepConfig5 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false,
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                await synthetics.executeHttpStep('Verify /', requestOptionsStep5, validateSuccessful, stepConfig5);
            };

            // neither fetch or XMLHttpRequest works and I can't install packages with inline code
            function getCombatlogUUID(apiUrl) {
                if (process.env.STAGE === "prod") {
                    return "ac18f293-e573-4994-8745-2a291d12bf9a"
                }
                return "2ac44ef5-d053-4232-881e-c8c21300ec4f"
                // let url = "https://" + apiUrl + "/combatlogs/keys"
                // let xmlHttp = new XMLHttpRequest()
                // xmlHttp.open( "GET", url, false ) // false for synchronous request
                // xmlHttp.send( null )
                // const resp = JSON.parse(xmlHttp.responseText)
                // return resp.data[0].combatlog_uuid
            }

            exports.handler = async () => {
                return await apiCanaryBlueprint();
            };

 └─ [~] RunConfig
     └─ [~] .EnvironmentVariables:
         └─ [+] Added: .DOMAIN_NAME
github-actions[bot] commented 3 years ago
Stack wm
Resources
[~] AWS::Lambda::Function Api-/GetKeysLambda ApiGetKeysLambdaFDF1A526 
 ├─ [~] Code
 │   └─ [~] .S3Key:
 │       ├─ [-] e879be6824f28368b30e679fce10c1e824b375566201922aab2c3896cfcc89bc.zip
 │       └─ [+] 4232ce2159ba2ea57751f84bc5b3c4a0ab762d6378d7d87c0a7d9e8b6971b15d.zip
 └─ [~] Metadata
     └─ [~] .aws:asset:path:
         ├─ [-] asset.e879be6824f28368b30e679fce10c1e824b375566201922aab2c3896cfcc89bc
         └─ [+] asset.4232ce2159ba2ea57751f84bc5b3c4a0ab762d6378d7d87c0a7d9e8b6971b15d
[~] AWS::Lambda::Function Api-/GetKeysPerDungeonLambda ApiGetKeysPerDungeonLambda073DE524 
 ├─ [~] Code
 │   └─ [~] .S3Key:
 │       ├─ [-] 6857a3821c4de6757d06019ba9dd75507df092fc82bb95c480d6885f4c60b456.zip
 │       └─ [+] e816caaa8d355ccedb622aca3b37cd28c95eb3f629649b85207a92c73f7abb6c.zip
 └─ [~] Metadata
     └─ [~] .aws:asset:path:
         ├─ [-] asset.6857a3821c4de6757d06019ba9dd75507df092fc82bb95c480d6885f4c60b456
         └─ [+] asset.e816caaa8d355ccedb622aca3b37cd28c95eb3f629649b85207a92c73f7abb6c
[~] AWS::Lambda::Function Api-/GetPlayerDamageDoneLambda ApiGetPlayerDamageDoneLambda7F052E98 
 ├─ [~] Code
 │   └─ [~] .S3Key:
 │       ├─ [-] 1dead25d404a1e85d975d399d23f0bee9c45c07b89e5a6b74d974e340155f287.zip
 │       └─ [+] fad8416ba9323f920207cfc896e469f5d03038b1fccf591c19f989300680e371.zip
 └─ [~] Metadata
     └─ [~] .aws:asset:path:
         ├─ [-] asset.1dead25d404a1e85d975d399d23f0bee9c45c07b89e5a6b74d974e340155f287
         └─ [+] asset.fad8416ba9323f920207cfc896e469f5d03038b1fccf591c19f989300680e371
[~] AWS::Lambda::Function Api-/Lambda ApiLambdaB75D04FB 
 ├─ [~] Code
 │   └─ [~] .S3Key:
 │       ├─ [-] c070daac02489a748e9e0644a4457029e3a83e5040022b98ebd633daa7185557.zip
 │       └─ [+] 2a2dd2b026f1d171665207eb38bc3f350f5dd3ffa7de786ad8e4158b50154c8e.zip
 └─ [~] Metadata
     └─ [~] .aws:asset:path:
         ├─ [-] asset.c070daac02489a748e9e0644a4457029e3a83e5040022b98ebd633daa7185557
         └─ [+] asset.2a2dd2b026f1d171665207eb38bc3f350f5dd3ffa7de786ad8e4158b50154c8e
[~] Custom::CDKBucketDeployment Frontend-/DeployWebsite/CustomResource FrontendDeployWebsiteCustomResource1B4A6C7F 
 └─ [~] SourceObjectKeys
     └─ @@ -1,3 +1,3 @@
        [ ] [
        [-]   "243ebf0b364a71e47601ee0c80c9b50fe18a3e8ea11ddca13e7d2086a947c771.zip"
        [+]   "c1587a27d93e18f26a3020c355e683dc77e257bf06e89cafd5a4017bbebcbb64.zip"
        [ ] ]
[~] AWS::Lambda::Function QueryKeys-/Lambda QueryKeysLambda58DE9A2E 
 ├─ [~] Code
 │   └─ [~] .S3Key:
 │       ├─ [-] 16b0a1161b37d26c070c219bfc5b8e277ee5e6626eb69f9b7f89e26b419a5014.zip
 │       └─ [+] ce3beb0072ff31dca6317b6746f87fb2e0ad54f1b73c049c4e6a44b8e17f0eb6.zip
 └─ [~] Metadata
     └─ [~] .aws:asset:path:
         ├─ [-] asset.16b0a1161b37d26c070c219bfc5b8e277ee5e6626eb69f9b7f89e26b419a5014
         └─ [+] asset.ce3beb0072ff31dca6317b6746f87fb2e0ad54f1b73c049c4e6a44b8e17f0eb6
[~] AWS::Lambda::Function InsertKeysToDynamodb-/Lambda InsertKeysToDynamodbLambda15825024 
 ├─ [~] Code
 │   └─ [~] .S3Key:
 │       ├─ [-] e81d233834310b1b15e9aac581e61ca55e1f54966dd7b93f625cd854d33bf683.zip
 │       └─ [+] c47e26a999cc90b262411956bdf17e2e8d5e68aebbc9884a4a22f04386674769.zip
 └─ [~] Metadata
     └─ [~] .aws:asset:path:
         ├─ [-] asset.e81d233834310b1b15e9aac581e61ca55e1f54966dd7b93f625cd854d33bf683
         └─ [+] asset.c47e26a999cc90b262411956bdf17e2e8d5e68aebbc9884a4a22f04386674769
[~] AWS::Lambda::Function InsertKeysToTimestream-/Lambda InsertKeysToTimestreamLambdaA07E952E 
 ├─ [~] Code
 │   └─ [~] .S3Key:
 │       ├─ [-] e0c251abbc9c1665ae58bd93643f4b257f80bd51509f4754bdf9dd24bdf51719.zip
 │       └─ [+] e1d09781026dcdaf9d39264b02de3a80e153734d6ced06d1a8280196dff75f83.zip
 └─ [~] Metadata
     └─ [~] .aws:asset:path:
         ├─ [-] asset.e0c251abbc9c1665ae58bd93643f4b257f80bd51509f4754bdf9dd24bdf51719
         └─ [+] asset.e1d09781026dcdaf9d39264b02de3a80e153734d6ced06d1a8280196dff75f83
[~] AWS::Lambda::Function QueryPlayerDamageDone-/Lambda QueryPlayerDamageDoneLambda98AFC037 
 ├─ [~] Code
 │   └─ [~] .S3Key:
 │       ├─ [-] 427ec4d755977222255bbe84005f6dba679e30bb54e992274beea3085e71d82a.zip
 │       └─ [+] abc3d74c2e2beb807ad1da6d83e5c347eaa6f41515894ad03e55d4dab91065d3.zip
 └─ [~] Metadata
     └─ [~] .aws:asset:path:
         ├─ [-] asset.427ec4d755977222255bbe84005f6dba679e30bb54e992274beea3085e71d82a
         └─ [+] asset.abc3d74c2e2beb807ad1da6d83e5c347eaa6f41515894ad03e55d4dab91065d3
[~] AWS::Lambda::Function InsertPlayerDamageDoneToDynamodb-/Lambda InsertPlayerDamageDoneToDynamodbLambda659E0DA7 
 ├─ [~] Code
 │   └─ [~] .S3Key:
 │       ├─ [-] ca648d974272bfc1f79917ff9af9335697880157f35fa7a1382e7b014a774177.zip
 │       └─ [+] da6482ed79c5169ad840541dd59f4b7ab31fd938a7e76c8a654490494961d26e.zip
 └─ [~] Metadata
     └─ [~] .aws:asset:path:
         ├─ [-] asset.ca648d974272bfc1f79917ff9af9335697880157f35fa7a1382e7b014a774177
         └─ [+] asset.da6482ed79c5169ad840541dd59f4b7ab31fd938a7e76c8a654490494961d26e
[~] AWS::Lambda::Function Convert-/Lambda ConvertLambda3540DCCB 
 ├─ [~] Code
 │   └─ [~] .S3Key:
 │       ├─ [-] f08a80660ecc5650c47ecdd4a96d1892d9680678d381d999fdd77982a782fbb3.zip
 │       └─ [+] b3a2551d0145bc982d7e98e498fd65865dcdea296d74e84abeed4f14bd383e62.zip
 └─ [~] Metadata
     └─ [~] .aws:asset:path:
         ├─ [-] asset.f08a80660ecc5650c47ecdd4a96d1892d9680678d381d999fdd77982a782fbb3
         └─ [+] asset.b3a2551d0145bc982d7e98e498fd65865dcdea296d74e84abeed4f14bd383e62
[~] AWS::Synthetics::Canary Canary-/API CanaryAPI9F4B22EA 
 ├─ [~] Code
 │   └─ [~] .Script:
 │       ├─ [-] 
            var synthetics = require('Synthetics');
            const log = require('SyntheticsLogger');

            const apiCanaryBlueprint = async function () {
                const hostname = process.env.API_URL

                // Handle validation for positive scenario
                const validateSuccessful = async function(res) {
                    return new Promise((resolve, reject) => {
                        if (res.statusCode < 200 || res.statusCode > 299) {
                            throw res.statusCode + ' ' + res.statusMessage;
                        }

                        let responseBody = '';
                        res.on('data', (d) => {
                            responseBody += d;
                        });

                        res.on('end', () => {
                            // Add validation on 'responseBody' here if required.
                            resolve();
                        });
                    });
                };

                // Set request option for Verify /combatlogs/keys
                let requestOptionsStep1 = {
                    hostname: hostname,
                    method: 'GET',
                    path: '/combatlogs/keys',
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep1['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep1['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /combatlogs/keys
                let stepConfig1 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false,
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                await synthetics.executeHttpStep('Verify /combatlogs/keys', requestOptionsStep1, validateSuccessful, stepConfig1);

                // Set request option for Verify /presign/{filename}
                let requestOptionsStep2 = {
                    hostname: hostname,
                    method: 'POST',
                    path: '/presign/test.txt',
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep2['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep2['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /presign/{filename}
                let stepConfig2 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false,
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                await synthetics.executeHttpStep('Verify /presign/{filename}', requestOptionsStep2, validateSuccessful, stepConfig2);

                // Set request option for Verify /combatlogs/keys/{dungeon_id}
                let requestOptionsStep3 = {
                    hostname: hostname,
                    method: 'GET',
                    path: '/combatlogs/keys/2291',
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep3['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep3['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /combatlogs/keys/{dungeon_id}
                let stepConfig3 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false, 
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                // TODO: XMLHttpRequest
                // TODO: check response, must include body
                await synthetics.executeHttpStep('Verify /combatlogs/keys/{dungeon_id}', requestOptionsStep3, validateSuccessful, stepConfig3);

                const combatlogUUID = getCombatlogUUID(hostname)
                // Set request option for Verify /combatlogs/keys/{combatlog_uuid}/player-damage-done
                let requestOptionsStep4 = {
                    hostname: hostname,
                    method: 'GET',
                    path: '/combatlogs/keys/' + combatlogUUID,
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep4['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep4['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /combatlogs/keys/{combatlog_uuid}/player-damage-done
                let stepConfig4 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false,
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                await synthetics.executeHttpStep('Verify /combatlogs/keys/{combatlog_uuid}/player-damage-done', requestOptionsStep4, validateSuccessful, stepConfig4);

                // ----------------------------------------------------
                // Set request option for Verify /
                let requestOptionsStep5 = {
                    hostname: hostname,
                    method: 'GET',
                    path: '/',
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep4['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep4['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /
                let stepConfig5 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false,
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                await synthetics.executeHttpStep('Verify /', requestOptionsStep5, validateSuccessful, stepConfig5);
            };

            // neither fetch or XMLHttpRequest works and I can't install packages with inline code
            function getCombatlogUUID(apiUrl) {
                if (process.env.STAGE === "prod") {
                    return "ac18f293-e573-4994-8745-2a291d12bf9a"
                }
                return "2ac44ef5-d053-4232-881e-c8c21300ec4f"
                // let url = "https://" + apiUrl + "/combatlogs/keys"
                // let xmlHttp = new XMLHttpRequest()
                // xmlHttp.open( "GET", url, false ) // false for synchronous request
                // xmlHttp.send( null )
                // const resp = JSON.parse(xmlHttp.responseText)
                // return resp.data[0].combatlog_uuid
            }

            exports.handler = async () => {
                return await apiCanaryBlueprint();
            };

 │       └─ [+] 
            var synthetics = require('Synthetics');
            const log = require('SyntheticsLogger');

            const apiCanaryBlueprint = async function () {
                const hostname = process.env.API_URL
                const domainName = process.env.DOMAIN_NAME

                // Handle validation for positive scenario
                const validateSuccessful = async function(res) {
                    return new Promise((resolve, reject) => {
                        if (res.statusCode < 200 || res.statusCode > 299) {
                            throw res.statusCode + ' ' + res.statusMessage;
                        }

                        let responseBody = '';
                        res.on('data', (d) => {
                            responseBody += d;
                        });

                        res.on('end', () => {
                            // Add validation on 'responseBody' here if required.
                            resolve();
                        });
                    });
                };

                // Set request option for Verify /combatlogs/keys
                let requestOptionsStep1 = {
                    hostname: hostname,
                    method: 'GET',
                    path: '/combatlogs/keys',
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep1['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep1['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /combatlogs/keys
                let stepConfig1 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false,
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                await synthetics.executeHttpStep('Verify /combatlogs/keys', requestOptionsStep1, validateSuccessful, stepConfig1);

                // Set request option for Verify /presign/{filename}
                let requestOptionsStep2 = {
                    hostname: hostname,
                    method: 'POST',
                    path: '/presign/test.txt',
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep2['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep2['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /presign/{filename}
                let stepConfig2 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false,
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                await synthetics.executeHttpStep('Verify /presign/{filename}', requestOptionsStep2, validateSuccessful, stepConfig2);

                // Set request option for Verify /combatlogs/keys/{dungeon_id}
                let requestOptionsStep3 = {
                    hostname: hostname,
                    method: 'GET',
                    path: '/combatlogs/keys/2291',
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep3['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep3['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /combatlogs/keys/{dungeon_id}
                let stepConfig3 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false, 
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                // TODO: XMLHttpRequest
                // TODO: check response, must include body
                await synthetics.executeHttpStep('Verify /combatlogs/keys/{dungeon_id}', requestOptionsStep3, validateSuccessful, stepConfig3);

                const combatlogUUID = getCombatlogUUID(hostname)
                // Set request option for Verify /combatlogs/keys/{combatlog_uuid}/player-damage-done
                let requestOptionsStep4 = {
                    hostname: hostname,
                    method: 'GET',
                    path: '/combatlogs/keys/' + combatlogUUID,
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep4['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep4['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /combatlogs/keys/{combatlog_uuid}/player-damage-done
                let stepConfig4 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false,
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                await synthetics.executeHttpStep('Verify /combatlogs/keys/{combatlog_uuid}/player-damage-done', requestOptionsStep4, validateSuccessful, stepConfig4);

                // ----------------------------------------------------
                // Set request option for Verify /
                let requestOptionsStep5 = {
                    hostname: domainName,
                    method: 'GET',
                    path: '/',
                    port: '443',
                    protocol: 'https:',
                    body: "",
                    headers: {}
                };
                requestOptionsStep4['headers']['User-Agent'] = [synthetics.getCanaryUserAgentString(), requestOptionsStep4['headers']['User-Agent']].join(' ');

                // Set step config option for Verify /
                let stepConfig5 = {
                    includeRequestHeaders: false,
                    includeResponseHeaders: false,
                    includeRequestBody: false,
                    includeResponseBody: false,
                    restrictedHeaders: [],
                    continueOnHttpStepFailure: true
                };

                await synthetics.executeHttpStep('Verify /', requestOptionsStep5, validateSuccessful, stepConfig5);
            };

            // neither fetch or XMLHttpRequest works and I can't install packages with inline code
            function getCombatlogUUID(apiUrl) {
                if (process.env.STAGE === "prod") {
                    return "ac18f293-e573-4994-8745-2a291d12bf9a"
                }
                return "2ac44ef5-d053-4232-881e-c8c21300ec4f"
                // let url = "https://" + apiUrl + "/combatlogs/keys"
                // let xmlHttp = new XMLHttpRequest()
                // xmlHttp.open( "GET", url, false ) // false for synchronous request
                // xmlHttp.send( null )
                // const resp = JSON.parse(xmlHttp.responseText)
                // return resp.data[0].combatlog_uuid
            }

            exports.handler = async () => {
                return await apiCanaryBlueprint();
            };

 └─ [~] RunConfig
     └─ [~] .EnvironmentVariables:
         └─ [+] Added: .DOMAIN_NAME