Help Center/
EventGrid/
Best Practices/
Routing Messages from OBS Application Service to Custom Connections Based on Event Subscriptions/
Implementation Procedure/
Purchasing an ECS
Updated on 2025-08-07 GMT+08:00
Purchasing an ECS
- Log in to the ECS console.
- In the navigation pane on the left, choose Elastic Cloud Server. In the upper right corner, click Buy ECS. For details, see Buying an ECS. Select the VPC, subnet, and security group created in Creating a VPC, Subnet, and Security Group.
- Return to the ECS list and click Remote Login in the Operation column.
Figure 1 Remote login
- In the displayed dialog box, click Log In and enter the password to access the CloudShell terminal console.
Ensure that the security group allows access from the port (22 by default) used for CloudShell logins.
- In the usr directory, run the mkdir and openssl commands to create the local/test directory and generate the key certificate in the test directory.
- Run the following command to create the local/test directory in the usr directory:
mkdir -p local/test
- Run the following command to go to the test directory and generate the key certificate:
openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 365
- After the command in step 2 is executed, set PEM PASS to privatenetwork. After the setting is complete, enter the related information as prompted.
Figure 2 Generating the key certificate
- Run the following command to create the local/test directory in the usr directory:
- In the test directory, use Python 3 to set up a Python server.
Run the following command to create a python file in the test directory:
vi httpsserver.py
Enter the following content into the python file:
from http.server import HTTPServer, BaseHTTPRequestHandler from io import BytesIO import ssl class SimpleHTTPRequestHandler(BaseHTTPRequestHandler): def do_GET(self): self.send_response(200) self.end_headers() self.wfile.write(b'Hello, world!') def do_POST(self): content_length = int(self.headers['Content-Length']) body = self.rfile.read(content_length) self.send_response(200) self.end_headers() response = BytesIO() response.write(b'This is POST request. ') response.write(b'Received: ') response.write(body) print(body) self.wfile.write(response.getvalue()) httpd = HTTPServer(('0.0.0.0', 8000), SimpleHTTPRequestHandler) httpd.socket = ssl.wrap_socket (httpd.socket, keyfile="key.pem", certfile='cert.pem', server_side=True) httpd.serve_forever()
- Install Python 3 and configure environment variables. Run the following command to start the httpsserver.
python3 httpsserver.py
Parent topic: Implementation Procedure
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot