UNPKG

@geek-fun/serverlessinsight

Version:

Full life cycle cross providers serverless application management for your fast-growing business.

42 lines (41 loc) 1.62 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.prepareBootstrapStack = void 0; const common_1 = require("../../common"); const getBootstrapTemplate = async (context) => { const iamInfo = await (0, common_1.getIamInfo)(context); const stackName = `si-bootstrap-${iamInfo?.accountId}-${context.region}`; const template = { Description: 'ServerlessInsight Bootstrap Stack', Metadata: { 'ALIYUN::ROS::Interface': { TemplateTags: ['Bootstrap stack created by ServerlessInsight'], }, }, ROSTemplateFormatVersion: '2015-09-01', Resources: { si_auto_artifacts_bucket: { Type: 'ALIYUN::OSS::Bucket', Properties: { BucketName: { 'Fn::Sub': 'si-bootstrap-artifacts-${ALIYUN::AccountId}-${ALIYUN::Region}', }, AccessControl: 'private', DeletionForce: false, EnableOssHdfsService: false, RedundancyType: 'LRS', ServerSideEncryptionConfiguration: { SSEAlgorithm: 'KMS', }, }, }, }, }; return { stackName, template }; }; const prepareBootstrapStack = async () => { const context = (0, common_1.getContext)(); const { stackName, template } = await getBootstrapTemplate(context); await (0, common_1.rosStackDeploy)(stackName, template); }; exports.prepareBootstrapStack = prepareBootstrapStack;