@geek-fun/serverlessinsight
Version:
Full life cycle cross providers serverless application management for your fast-growing business.
41 lines (39 loc) • 980 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.RfsStack = void 0;
const function_1 = require("./function");
const common_1 = require("../../common");
const provider = (stack, context) => {
const hcl = `
terraform {
required_providers {
huaweicloud = {
source = "huaweicloud/huaweicloud"
version = ">= 1.67.1"
}
}
}
provider "huaweicloud" {
region = "${context.region}"
access_key = "${context.accessKeyId}"
secret_key = "${context.accessKeySecret}"
}
`;
stack.appendHcl(hcl);
};
class RfsStack {
constructor(iac, context = (0, common_1.getContext)()) {
this.iac = iac;
this.context = context;
this.hcl = '';
provider(this, context);
(0, function_1.resolveFunction)(this, iac.functions, context, iac.service);
}
toHclTerraform() {
return this.hcl;
}
appendHcl(hcl) {
this.hcl += hcl;
}
}
exports.RfsStack = RfsStack;