cloudformation/firehoseStack.yaml [238:305]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                      HtmlFile.push(lineToWrite, '</html>');
                      s3Result = await s3.upload({
                          Key: streamsHtmlKey,
                          Bucket: event.ResourceProperties.WebHostingS3Bucket,
                          Body: HtmlFile.join("\n"),
                          ContentType: 'text/html'
                      }).promise();
                      console.log(`Finished uploading HTML with result ${JSON.stringify(s3Result, 0, 4)}`);

                      copyResult = await Promise.all(
                          sourceObjectArray.map( async (object) => {
                              s3Result = await s3.copyObject({
                                  Bucket: event.ResourceProperties.WebHostingS3Bucket,
                                  Key: object,
                                  CopySource: `${sourceBucket}/${sourcePrefix}/${object}`
                              }).promise();
                              console.log(`Finished uploading File with result ${JSON.stringify(s3Result, 0, 4)}`);
                          }),
                      );
                      
                      result.responseStatus = 'SUCCESS';
                      result.responseData['Data'] = 'Successfully uploaded files';
                  } else if (event.RequestType === 'Delete') {
                      var s3Result = await s3.deleteObjects({
                          Delete: {
                              Objects:[
                                  {
                                      Key: 'index.html'
                                  }
                              ],
                              Quiet: false
                          },
                          Bucket: event.ResourceProperties.WebHostingS3Bucket
                      }).promise();
                      console.log(`Deletion result: ${s3Result}`)
                      result.responseStatus = 'SUCCESS',
                      result.responseData['Data'] = 'Successfully deleted files';
                  }
              } catch (error) {
                  console.log(JSON.stringify(error, 0, 4));
                  result.responseStatus = 'FAILED';
                  result.responseData['Data'] = 'Failed to process event';
              } finally {
                  return await responsePromise(event, context, result.responseStatus, result.responseData, `StreamsAPIWebpage`);
              }
          };

          function responsePromise(event, context, responseStatus, responseData, physicalResourceId) {
              return new Promise(() => response.send(event, context, responseStatus, responseData, physicalResourceId));
          }

          function checkPreconditions(event) {
              return new Promise( function (resolve, reject) {
                  if( (event.ResourceProperties.ApiGatewayUrl && 
                  event.ResourceProperties.WebHostingS3Bucket  &&
                  event.ResourceProperties.CcpUrl  &&
                  event.ResourceProperties.Region )){
                      resolve(true);
                  } else {
                      console.log(`Missing properties on event. ${JSON.stringify(event, 0, 4)}`)
                      reject(false);
                  }
              });
          }
      Timeout: 50


  CloudFrontOAI:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



cloudformation/frontend.yaml [286:353]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                      HtmlFile.push(lineToWrite, '</html>');
                      s3Result = await s3.upload({
                          Key: streamsHtmlKey,
                          Bucket: event.ResourceProperties.WebHostingS3Bucket,
                          Body: HtmlFile.join("\n"),
                          ContentType: 'text/html'
                      }).promise();
                      console.log(`Finished uploading HTML with result ${JSON.stringify(s3Result, 0, 4)}`);

                      copyResult = await Promise.all(
                          sourceObjectArray.map( async (object) => {
                              s3Result = await s3.copyObject({
                                  Bucket: event.ResourceProperties.WebHostingS3Bucket,
                                  Key: object,
                                  CopySource: `${sourceBucket}/${sourcePrefix}/${object}`
                              }).promise();
                              console.log(`Finished uploading File with result ${JSON.stringify(s3Result, 0, 4)}`);
                          }),
                      );
                      
                      result.responseStatus = 'SUCCESS';
                      result.responseData['Data'] = 'Successfully uploaded files';
                  } else if (event.RequestType === 'Delete') {
                      var s3Result = await s3.deleteObjects({
                          Delete: {
                              Objects:[
                                  {
                                      Key: 'index.html'
                                  }
                              ],
                              Quiet: false
                          },
                          Bucket: event.ResourceProperties.WebHostingS3Bucket
                      }).promise();
                      console.log(`Deletion result: ${s3Result}`)
                      result.responseStatus = 'SUCCESS',
                      result.responseData['Data'] = 'Successfully deleted files';
                  }
              } catch (error) {
                  console.log(JSON.stringify(error, 0, 4));
                  result.responseStatus = 'FAILED';
                  result.responseData['Data'] = 'Failed to process event';
              } finally {
                  return await responsePromise(event, context, result.responseStatus, result.responseData, `StreamsAPIWebpage`);
              }
          };

          function responsePromise(event, context, responseStatus, responseData, physicalResourceId) {
              return new Promise(() => response.send(event, context, responseStatus, responseData, physicalResourceId));
          }

          function checkPreconditions(event) {
              return new Promise( function (resolve, reject) {
                  if( (event.ResourceProperties.ApiGatewayUrl && 
                  event.ResourceProperties.WebHostingS3Bucket  &&
                  event.ResourceProperties.CcpUrl  &&
                  event.ResourceProperties.Region )){
                      resolve(true);
                  } else {
                      console.log(`Missing properties on event. ${JSON.stringify(event, 0, 4)}`)
                      reject(false);
                  }
              });
          }
      Timeout: 50


  CloudFrontOAI:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



