laravel - Connecting Google Compute Engine with Google App Engine -
i trying connect google compute engine instance mysql database google app engine using laravel. have connected google app engine cloud sql instance, don't have problem this, need additional database connection database located on google compute engine.
google compute engine instance on different project. scheme:
project -> compute engine -> instance -> mysql database
project b -> app engine -> laravel
project b -> cloud sql -> db-instance -> mysql database
this app.yaml file:
runtime: php env: flex runtime_config: document_root: public # ensure skip ".env", local development skip_files: - .env env_variables: # put production environment variables here. app_log: "errorlog" app_key: "[key]" storage_dir: "/tmp" cache_driver: "database" session_driver: "database" app_debug: "true" #cloud sql database connection db_connection: "[database_1_name]" db_host: "[cloud_sql_instance_name]" db_database: "[database_1_name]" db_username: "root" db_password: "[password]" db_socket: "/cloudsql/[projectb]:[region]:[cloud_sql_instance_name]" # compute engine database connection db_host_2: "[compute_engine_instance_name]" db_database_2: "[database_2_name]" db_username_2: "root" db_password_2: "[password]" beta_settings: cloud_sql_instances: "[projectb]:[region]:[cloud_sql_instance_name]"
Comments
Post a Comment