Skip to content

Commit 3edf9e5

Browse files
author
chenyumic
authored
Added config for using Memorystore (Redis) with App Engine standard P… (#2921)
1 parent d8dbc3a commit 3edf9e5

File tree

3 files changed

+70
-0
lines changed

3 files changed

+70
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Copyright 2019 Google LLC.
2+
# Licensed under the Apache License, Version 2.0 (the "License");
3+
# you may not use this file except in compliance with the License.
4+
# You may obtain a copy of the License at
5+
#
6+
# http://www.apache.org/licenses/LICENSE-2.0
7+
#
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License.
13+
# [START memorystore_app_yaml_standard_py2]
14+
runtime: python27
15+
threadsafe: yes
16+
api_version: 1
17+
18+
# Update with Redis instance details
19+
env_variables:
20+
REDISHOST: '<REDIS_IP>'
21+
REDISPORT: '6379'
22+
23+
# Use the built-in libraries
24+
libraries:
25+
- name: flask
26+
version: latest
27+
- name: ssl
28+
version: latest
29+
30+
# Handlers
31+
handlers:
32+
- url: .*
33+
script: main.app
34+
35+
# Update with Serverless VPC Access connector details
36+
vpc_access_connector:
37+
name: 'projects/<PROJECT_ID>/locations/<REGION>/connectors/<CONNECTOR_NAME>'
38+
# [END memorystore_app_yaml_standard_py2]
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Copyright 2019 Google LLC.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
from google.appengine.ext import vendor
15+
16+
# Add any libraries installed in the "lib" folder.
17+
vendor.add('lib')
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Copyright 2018 Google LLC.
2+
# Licensed under the Apache License, Version 2.0 (the "License");
3+
# you may not use this file except in compliance with the License.
4+
# You may obtain a copy of the License at
5+
#
6+
# http://www.apache.org/licenses/LICENSE-2.0
7+
#
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License.
13+
# [START memorystore_requirements_app_engine_standard_py2]
14+
redis==3.3.11
15+
# [END memorystore_requirements_app_engine_standard_py2]

0 commit comments

Comments
 (0)