-
Notifications
You must be signed in to change notification settings - Fork 194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Alibaba Cloud Announcement post #930
Open
fernando-mc
wants to merge
5
commits into
serverless:master
Choose a base branch
from
fernando-mc:serverless-alibaba-cloud
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
4b48ee4
Add alibaba cloud annoucement post
fernando-mc 5eafba7
Merge branch 'master' of github.com:serverless/blog into serverless-a…
fernando-mc 959b638
Changes for new demo
fernando-mc b4ad098
feedback from Alibaba Cloud
fernando-mc 93f1feb
Push out a week, waiting on assets and approval
fernando-mc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
--- | ||
title: "Announcing Serverless Framework Support for Alibaba Cloud" | ||
description: "Learn how to deploy your first microservice in the Alibaba Cloud with the Serverless Framework." | ||
date: 2019-10-08 | ||
thumbnail: "" | ||
heroImage: "" | ||
category: | ||
- news | ||
authors: | ||
- FernandoMedinaCorey | ||
--- | ||
|
||
# Overview | ||
|
||
Today we're excited to announce Serverless Framework support for the biggest public cloud providers in the biggest country in the world - Alibaba Cloud (Aliyun). | ||
|
||
As we continue our push towards more vendor choice with [Twilio](https://serverless.com/blog/serverless-and-twilio/) and new improvements to the [Microsoft Azure](https://serverless.com/blog/serverless-azure-functions-v1/) integration we are excited to offer developers everywhere a chance to use the Alibaba Cloud plugin to deploy to Alibaba regions in China and around the world. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "Alibaba cloud regions"? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sounds good! I'll fix it. |
||
|
||
This will allow organizations with customers or users inside China or other parts of East Asia and the Pacific to build geographically-proximate serverless applications. Organizations with previous Serveress Framework experience can use the framework they're used to while adopting features and services of Alibaba Cloud. | ||
|
||
# Deploying Our First Alibaba Cloud Microservice | ||
|
||
Let's take a look at how you can get started working with Alibaba Cloud by deploying our first hello world microservice. | ||
|
||
## Setup Your Credentials | ||
|
||
First, you'll need to create an Alibaba Cloud account and get setup with some credentials. | ||
|
||
1. [Create an Alibaba Cloud Account](https://alibabacloud.com/help/doc-detail/50482.htm) | ||
2. [Add your billing information](https://www.alibabacloud.com/help/doc-detail/50517.htm) | ||
3. **Importantly** - If you are trying to deploy any services or applications in a Mainland China region you will need to also do a third step for [real name registration](https://www.alibabacloud.com/help/doc-detail/52595.htm). To avoid these requirements, you can deploy to a region outside of Mainland China such as `us-west-1`. | ||
4. After these initial setup steps you will need to activate all the services that you will need for your first microservice. | ||
- [Resource Access Management](https://www.alibabacloud.com/product/ram) | ||
- [Log Service](https://www.alibabacloud.com/product/log-service) | ||
- [API Gateway](https://www.alibabacloud.com/product/api-gateway) | ||
- [Object Storage Service](https://www.alibabacloud.com/product/oss) | ||
- [Function Compute](https://www.alibabacloud.com/products/function-compute) | ||
|
||
5. With all of these activated, you can then [create a RAM user](https://www.alibabacloud.com/help/doc-detail/28637.htm). Make sure that you create one with Programmatic Access so that you will be given an Access Key and Access Key Secret - be sure to save these values for later. | ||
6. When the user is created, [add permissions](https://www.alibabacloud.com/help/doc-detail/28653.htm) for that user that include the following policies: | ||
- AliyunOSSFullAccess | ||
- AliyunRAMFullAccess | ||
- AliyunLogFullAccess | ||
- AliyunApiGatewayFullAccess | ||
- AliyunFCFullAccess | ||
7. With that user created and permissions added, copy down the Account ID value for your Alibaba Cloud account from the [Security Settings page](https://account.console.aliyun.com/#/secure). | ||
8. Finally, create a file containing the Alibaba Cloud credentials that you have collected: | ||
```ini | ||
[default] | ||
aliyun_access_key_secret = <collected in step 5> | ||
aliyun_access_key_id = <collected in step 5> | ||
aliyun_account_id = <collected in step 7> | ||
``` | ||
Save this file somewhere like `~/.aliyuncli/credentials`. But make sure you remember the path for later. | ||
|
||
## Setup the Demo Application | ||
|
||
Now that we have the credentials, let's get started setting up our microservice. First, make sure you've already installed npm and node.js. You'll also need the Serverless Framework, which you can install with `npm i -g serverless`. | ||
|
||
To get the demo, run: | ||
|
||
`serverless install --url https://github.com/aliyun/serverless-function-compute-examples/tree/master/aliyun-nodejs` | ||
|
||
Then, when you `cd aliyun-nodejs` and run `ls` you should see something like this: | ||
|
||
``` | ||
├── index.js | ||
├── package.json | ||
└── serverless.yml | ||
``` | ||
|
||
Next, you'll need to install the Alibaba Cloud plugin with: | ||
|
||
`serverless plugin install --name serverless-aliyun-function-compute` | ||
|
||
After this, you will want to open up the `serverless.yml` file and make a few changes. First, make sure that the provider section accurately refers to where you put your `credentials` file. | ||
``` | ||
provider: | ||
. . . | ||
credentials: ~/.aliyuncli/credentials | ||
``` | ||
|
||
Next, if you have not gone through the [real name registration](https://www.alibabacloud.com/help/doc-detail/52595.htm) process mentioned above you should select a region outside of mainland China to deploy your microservice into. You can add that region to the `provider` section of your `serverless.yml` configuration: | ||
|
||
``` | ||
provider: | ||
name: aliyun | ||
runtime: nodejs8 | ||
region: ap-southeast-1 | ||
credentials: ~/.aliyuncli/credentials | ||
``` | ||
|
||
After saving the `serverless.yml` file with these changes you can run `serverless deploy` and see your application created inside of the Alibaba Cloud! | ||
|
||
After the deployment has completed you could load up your API Endpoint in the browser to see the GET request response, use Postman to do the same, or skip the Alibaba Cloud API Gateway portion of the architecture and invoke the function directly with `serverless invoke --function hello`. | ||
|
||
Finally, if you're interested in deploying the function to alternate regions you can also use the `--region` flag with the deploy command. For example, to deploy to Hong Kong you could use: `serverless deploy --region cn-hongkong`. | ||
|
||
And that's it! You've just deployed your own microservice into the Alibaba Cloud. If you'd like to help guide the development of this plugin check out the [GitHub repo](https://github.com/aliyun/serverless-aliyun-function-compute). | ||
|
||
## Takeaways | ||
|
||
Using Alibaba Cloud's Function Compete gives you access to the same serverless characteristics we love, like pay-as-you-go pricing, auto-scaling, and event triggers. You also have the ability to program in a variety of languages including node.js, Python, PHP, and Java. | ||
|
||
We think this is an exciting addition to the growing number of cloud providers you can choose from to build your Serverless Framework applications and we hope to give developers continued access to the best cloud providers and best services. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit, China is not the "biggest country" in terms of land.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair, I meant population here but I can clarify.