This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var imageController = { | |
| data: { | |
| config: null | |
| }, | |
| uiElements: { | |
| imageCardTemplate: null, | |
| imageList: null, | |
| loadingIndicator: null | |
| }, | |
| init: function (config,firebaseConfig) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'use strict'; | |
| const admin = require('firebase-admin'); | |
| const serviceAccount = require('serviceAccountKey.json'); | |
| admin.initializeApp({ | |
| credential: admin.credential.cert(serviceAccount) | |
| }); | |
| const db = admin.firestore(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| provider "google" { | |
| user_project_override = true | |
| } | |
| resource "google_firebase_project" "firebase" { | |
| provider = google-beta | |
| project = var.gcp_project_name | |
| } | |
| resource "google_app_engine_application" "imagelense" { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'use strict' | |
| const request = require('request'); | |
| const AWS = require('aws-sdk'); | |
| const s3 = new AWS.S3({signatureVersion: 'v4'}); | |
| const ssm = new AWS.SSM(); | |
| let subscriptionKeyPS = process.env['COMPUTER_VISION_SUBSCRIPTION_KEY_PS'] | |
| let endpoint = process.env['COMPUTER_VISION_ENDPOINT'] + '/vision/v2.1/analyze' | |
| let topic = process.env['TOPIC_ARN'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| provider "azurerm" { | |
| version = "=2.0.0" | |
| ### Fix for Error: "features": required field is not set | |
| features {} | |
| skip_provider_registration = true | |
| } | |
| provider "aws" { | |
| region = "us-east-1" | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var uploadController = { | |
| data: { | |
| config: null | |
| }, | |
| uiElements: { | |
| uploadButton: null | |
| }, | |
| init: function (configConstants) { | |
| console.log('Init function.') | |
| this.data.config = configConstants; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'use strict'; | |
| const AWS = require('aws-sdk'); | |
| const crypto = require('crypto'); | |
| const s3 = new AWS.S3({signatureVersion: 'v4'}); | |
| const generateResponse = (status, message) => { | |
| return { | |
| statusCode: status, | |
| headers: { 'Access-Control-Allow-Origin': '*' }, | |
| body : JSON.stringify(message) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| resource "aws_api_gateway_rest_api" "imagelenseapi" { | |
| name = "imagelenseApi" | |
| description = "Image Analyser API for web application." | |
| } | |
| resource "aws_api_gateway_resource" "imagelenseapi_res" { | |
| rest_api_id = aws_api_gateway_rest_api.imagelenseapi.id | |
| parent_id = aws_api_gateway_rest_api.imagelenseapi.root_resource_id | |
| path_part = "presigneds3url" | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import json | |
| import boto3 | |
| from botocore.exceptions import ClientError | |
| import logging | |
| import os | |
| logger = logging.getLogger() | |
| logger.setLevel(logging.INFO) | |
| #ec2_client = boto3.client('ec2') | |
| asg_client = boto3.client('autoscaling') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "variables": { | |
| "aws_region": "us-east-1", | |
| "base_ami": "" | |
| }, | |
| "builders": [ | |
| { | |
| "type": "amazon-ebs", | |
| "region": "{{user `aws_region`}}", | |
| "source_ami": "{{user `base_ami`}}", |