官术网_书友最值得收藏!

How to do it...

  1. Create the project from the following template:
$ sls create --template-url https://github.com/danteinc/js-cloud-native-cookbook/tree/master/ch1/create-stack --path cncb-create-stack
  1. Navigate to the cncb-create-stack directory with cd cncb-create-stack.
  2. Review the file named serverless.yml with the following content:
service: cncb-create-stack

provider:
name: aws
  1. Review the file named package.json with the following content:
{
"name": "cncb-create-stack",
"version": "1.0.0",
"private": true,
"scripts": {
"test": "sls package -r us-east-1 -s test",
"dp:lcl": "sls deploy -r us-east-1",
"rm:lcl": "sls remove -r us-east-1"
},
"devDependencies": {
"serverless": "1.26.0"
}
}
  1. Install the dependencies with npm install.
  2. Run the tests with npm test.
  3. Review the contents generated in the .serverless directory.
  4. Deploy the stack:
$ npm run dp:lcl -- -s $MY_STAGE

> cncb-create-stack@1.0.0 dp:lcl <path-to-your-workspace>/cncb-create-stack
> sls deploy -r us-east-1 "-s" "john"

Serverless: Packaging service...
Serverless: Creating Stack...
Serverless: Checking Stack create progress...
.....
Serverless: Stack create finished...
Serverless: Uploading CloudFormation file to S3...
Serverless: Uploading artifacts...
Serverless: Validating template...
Serverless: Updating Stack...
Service Information
service: cncb-create-stack
stage: john
region: us-east-1
stack: cncb-create-stack-john
api keys:
None
endpoints:
None
functions:
None
  1. Review the stack in the AWS Console:
  1. Remove the stack once you have finished with npm run rm:lcl -- -s $MY_STAGE.
主站蜘蛛池模板: 额济纳旗| 柞水县| 汉寿县| 麻江县| 库伦旗| 镇康县| 应城市| 青神县| 股票| 乳山市| 旬阳县| 扬州市| 绵阳市| 库伦旗| 巩留县| 漳浦县| 阜新| 奎屯市| 洪雅县| 田东县| 新兴县| 建水县| 永善县| 太白县| 四川省| 通江县| 根河市| 吐鲁番市| 城固县| 德钦县| 蚌埠市| 射阳县| 鹤庆县| 庆元县| 哈巴河县| 全州县| 睢宁县| 罗江县| 鄂托克旗| 浦北县| 东乡|