cdk 构造
可重复使用的 CDK 其他电子驾驶微服务消耗的构造
设置
用 npm 为您的工程添加最新软件包
npm i -D @epilot/cdk-constructs
在您的基础设施定义中开始使用 cdk 构造
实例
1. 联合国.Http OpenAPI 定义
内容提要: 它将在 API 网关中创建 Http API V2 资源, 路由定义和每个定义的路由的 1 lambda 集成
import { HttpOpenApi } from '@epilot/cdk-constructs'
// ... in your stack definition
const api = new HttpOpenApi(this, 'MyApi', {
serviceName: 'my-service',
openApiSpec: './openapi.yml',
integrations: [
{
operationId: 'getEntity', // found in openapi.yml
handler: 'api.getEntity' // file.method to handle the request
entry: 'index.ts'
},
{
operationId: 'storeEntity',
handler: 'api.storeEntity',
entry: 'index.ts'
}
]
})
释放步骤
- npm 登录( 证书用 1password 存储)
- npm 运行释放
- npm 发布