@geek-fun/serverlessinsight 0.7.0 → 0.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -0
- package/README.md +58 -1
- package/README.zh-CN.md +3 -1
- package/dist/package.json +37 -35
- package/dist/src/commands/index.js +1 -3
- package/dist/src/commands/local.js +1 -2
- package/dist/src/common/aliyunClient/apigwOperations.js +9 -4
- package/dist/src/common/aliyunClient/cdnOperations.js +191 -0
- package/dist/src/common/aliyunClient/ecsOperations.js +2 -2
- package/dist/src/common/aliyunClient/fc3Operations.js +1 -1
- package/dist/src/common/aliyunClient/index.js +8 -0
- package/dist/src/common/aliyunClient/ossOperations.js +62 -2
- package/dist/src/common/aliyunClient/ramOperations.js +1 -1
- package/dist/src/common/hashUtils.js +4 -0
- package/dist/src/common/iacHelper.js +5 -0
- package/dist/src/common/lockManager.js +8 -0
- package/dist/src/common/planFormatter.js +4 -0
- package/dist/src/common/retryUtils.js +1 -1
- package/dist/src/common/stateManager.js +10 -0
- package/dist/src/common/volcengineClient/apigwOperations.js +1 -1
- package/dist/src/lang/en.js +16 -1
- package/dist/src/lang/zh-CN.js +17 -2
- package/dist/src/parser/bucketParser.js +111 -46
- package/dist/src/stack/aliyunStack/apigwResource.js +310 -47
- package/dist/src/stack/aliyunStack/apigwTypes.js +61 -1
- package/dist/src/stack/aliyunStack/ossResource.js +401 -69
- package/dist/src/stack/aliyunStack/ossTypes.js +58 -16
- package/dist/src/stack/localStack/event.js +1 -1
- package/dist/src/stack/localStack/functionRunner.js +4 -1
- package/dist/src/stack/scfStack/cosTypes.js +3 -6
- package/dist/src/stack/volcengineStack/tosTypes.js +1 -3
- package/dist/src/types/domains/state.js +3 -0
- package/dist/src/validator/bucketSchema.js +124 -56
- package/dist/src/validator/eventSchema.js +20 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +37 -35
- package/samples/README_TENCENT_COS.md +3 -15
- package/samples/aliyun-poc-bucket-cdn.yml +63 -0
- package/samples/aliyun-poc-bucket.yml +0 -2
- package/samples/aliyun-poc-domain.yml +0 -2
- package/samples/tencent-poc-cos.yml +0 -2
- package/samples/volcengine-poc-bucket.yml +0 -1
|
@@ -3,12 +3,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.extractOssBucketDefinition = exports.bucketToOssBucketConfig = void 0;
|
|
4
4
|
const types_1 = require("../../types");
|
|
5
5
|
const bucketTypes_1 = require("../bucketTypes");
|
|
6
|
-
// Map from domain enum to provider ACL type
|
|
7
6
|
const aclMap = {
|
|
8
7
|
[types_1.BucketAccessEnum.PRIVATE]: bucketTypes_1.BucketACL.PRIVATE,
|
|
9
8
|
[types_1.BucketAccessEnum.PUBLIC_READ]: bucketTypes_1.BucketACL.PUBLIC_READ,
|
|
10
9
|
[types_1.BucketAccessEnum.PUBLIC_READ_WRITE]: bucketTypes_1.BucketACL.PUBLIC_READ_WRITE,
|
|
11
10
|
};
|
|
11
|
+
const getDomain = (bucket) => {
|
|
12
|
+
if (bucket.domain?.domain_name)
|
|
13
|
+
return bucket.domain.domain_name;
|
|
14
|
+
return bucket.website?.domain;
|
|
15
|
+
};
|
|
16
|
+
/* istanbul ignore next */
|
|
12
17
|
const bucketToOssBucketConfig = (bucket) => {
|
|
13
18
|
const config = {
|
|
14
19
|
bucketName: bucket.name,
|
|
@@ -19,30 +24,44 @@ const bucketToOssBucketConfig = (bucket) => {
|
|
|
19
24
|
if (bucket.website) {
|
|
20
25
|
config.websiteConfig = {
|
|
21
26
|
indexDocument: bucket.website.index,
|
|
27
|
+
errorDocument: bucket.website.index,
|
|
22
28
|
};
|
|
23
|
-
if (bucket.website.error_page) {
|
|
24
|
-
config.websiteConfig.errorDocument = bucket.website.error_page;
|
|
25
|
-
}
|
|
26
29
|
}
|
|
27
30
|
if (bucket.storage?.class) {
|
|
28
31
|
config.storageClass = bucket.storage.class;
|
|
29
32
|
}
|
|
30
|
-
|
|
31
|
-
|
|
33
|
+
const domain = getDomain(bucket);
|
|
34
|
+
if (domain) {
|
|
35
|
+
config.domain = domain;
|
|
32
36
|
}
|
|
33
|
-
if (bucket.
|
|
34
|
-
config.wwwBindApex = bucket.
|
|
37
|
+
if (bucket.domain) {
|
|
38
|
+
config.wwwBindApex = bucket.domain.www_bind_apex;
|
|
39
|
+
config.domainCertificateId = bucket.domain.certificate_id;
|
|
40
|
+
config.domainCertificateBody = bucket.domain.certificate_body;
|
|
41
|
+
config.domainCertificatePrivateKey = bucket.domain.certificate_private_key;
|
|
42
|
+
config.domainProtocol = bucket.domain.protocol;
|
|
43
|
+
config.accelerateEnabled = bucket.domain.accelerate;
|
|
44
|
+
if (bucket.domain.cdn != null) {
|
|
45
|
+
if (typeof bucket.domain.cdn === 'boolean') {
|
|
46
|
+
config.cdnEnabled = bucket.domain.cdn;
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
config.cdnEnabled = bucket.domain.cdn.enabled;
|
|
50
|
+
config.cdnType = bucket.domain.cdn.cdn_type;
|
|
51
|
+
config.cdnScope = bucket.domain.cdn.scope;
|
|
52
|
+
config.cdnCacheTtl = bucket.domain.cdn.cache_ttl;
|
|
53
|
+
config.cdnIgnoreQueryString = bucket.domain.cdn.ignore_query_string;
|
|
54
|
+
config.cdnOriginProtocol = bucket.domain.cdn.origin_protocol;
|
|
55
|
+
config.cdnCompression = bucket.domain.cdn.compression;
|
|
56
|
+
config.cdnForceRedirectHttps = bucket.domain.cdn.force_redirect_https;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
35
59
|
}
|
|
36
|
-
if (bucket.website?.
|
|
60
|
+
else if (bucket.website?.domain) {
|
|
61
|
+
config.wwwBindApex = bucket.website.www_bind_apex;
|
|
37
62
|
config.domainCertificateId = bucket.website.domain_certificate_id;
|
|
38
|
-
}
|
|
39
|
-
if (bucket.website?.domain_certificate_body) {
|
|
40
63
|
config.domainCertificateBody = bucket.website.domain_certificate_body;
|
|
41
|
-
}
|
|
42
|
-
if (bucket.website?.domain_certificate_private_key) {
|
|
43
64
|
config.domainCertificatePrivateKey = bucket.website.domain_certificate_private_key;
|
|
44
|
-
}
|
|
45
|
-
if (bucket.website?.domain_protocol) {
|
|
46
65
|
config.domainProtocol = bucket.website.domain_protocol;
|
|
47
66
|
}
|
|
48
67
|
if (bucket.versioning?.status) {
|
|
@@ -57,8 +76,9 @@ const bucketToOssBucketConfig = (bucket) => {
|
|
|
57
76
|
return config;
|
|
58
77
|
};
|
|
59
78
|
exports.bucketToOssBucketConfig = bucketToOssBucketConfig;
|
|
79
|
+
/* istanbul ignore next */
|
|
60
80
|
const extractOssBucketDefinition = (config, websiteCodeHash) => {
|
|
61
|
-
|
|
81
|
+
const def = {
|
|
62
82
|
bucketName: config.bucketName,
|
|
63
83
|
acl: config.acl ?? null,
|
|
64
84
|
websiteConfiguration: config.websiteConfig
|
|
@@ -79,5 +99,27 @@ const extractOssBucketDefinition = (config, websiteCodeHash) => {
|
|
|
79
99
|
sseAlgorithm: config.sseAlgorithm ?? null,
|
|
80
100
|
sseKmsMasterKeyId: config.sseKmsMasterKeyId ?? null,
|
|
81
101
|
};
|
|
102
|
+
// Only include CDN/accelerate fields when they're actually enabled
|
|
103
|
+
if (config.cdnEnabled) {
|
|
104
|
+
def.cdnEnabled = true;
|
|
105
|
+
if (config.cdnType)
|
|
106
|
+
def.cdnType = config.cdnType;
|
|
107
|
+
if (config.cdnScope)
|
|
108
|
+
def.cdnScope = config.cdnScope;
|
|
109
|
+
if (config.cdnCacheTtl != null)
|
|
110
|
+
def.cdnCacheTtl = config.cdnCacheTtl;
|
|
111
|
+
if (config.cdnIgnoreQueryString != null)
|
|
112
|
+
def.cdnIgnoreQueryString = config.cdnIgnoreQueryString;
|
|
113
|
+
if (config.cdnOriginProtocol)
|
|
114
|
+
def.cdnOriginProtocol = config.cdnOriginProtocol;
|
|
115
|
+
if (config.cdnCompression != null)
|
|
116
|
+
def.cdnCompression = config.cdnCompression;
|
|
117
|
+
if (config.cdnForceRedirectHttps != null)
|
|
118
|
+
def.cdnForceRedirectHttps = config.cdnForceRedirectHttps;
|
|
119
|
+
}
|
|
120
|
+
if (config.accelerateEnabled) {
|
|
121
|
+
def.accelerateEnabled = true;
|
|
122
|
+
}
|
|
123
|
+
return def;
|
|
82
124
|
};
|
|
83
125
|
exports.extractOssBucketDefinition = extractOssBucketDefinition;
|
|
@@ -15,7 +15,7 @@ const node_fs_1 = __importDefault(require("node:fs"));
|
|
|
15
15
|
const utils_1 = require("./utils");
|
|
16
16
|
const lang_1 = require("../../lang");
|
|
17
17
|
const matchTrigger = (req, trigger) => {
|
|
18
|
-
if (
|
|
18
|
+
if (trigger.method !== 'ANY' && req.method !== trigger.method) {
|
|
19
19
|
return false;
|
|
20
20
|
}
|
|
21
21
|
const normalize = (s) => s.replace(/^\/+|\/+$/g, '');
|
|
@@ -54,8 +54,11 @@ const loadHandlerModule = async (handlerPath) => {
|
|
|
54
54
|
return require(handlerPath);
|
|
55
55
|
}
|
|
56
56
|
catch {
|
|
57
|
+
// Dynamic import — use Function constructor to prevent TypeScript CJS transform
|
|
58
|
+
// which would replace import() with require() that breaks with file:// URLs
|
|
59
|
+
const importModule = new Function('specifier', 'return import(specifier)');
|
|
57
60
|
const fileUrl = (0, node_url_1.pathToFileURL)(handlerPath + '.js').href;
|
|
58
|
-
return (
|
|
61
|
+
return importModule(fileUrl);
|
|
59
62
|
}
|
|
60
63
|
};
|
|
61
64
|
const getHandlerFunction = (handlerModule, handlerMethod, handlerPath) => {
|
|
@@ -20,12 +20,9 @@ const bucketToCosBucketConfig = (bucket, region) => {
|
|
|
20
20
|
Suffix: bucket.website.index,
|
|
21
21
|
},
|
|
22
22
|
};
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
Key: bucket.website.error_page,
|
|
27
|
-
};
|
|
28
|
-
}
|
|
23
|
+
config.WebsiteConfiguration.ErrorDocument = {
|
|
24
|
+
Key: bucket.website.index,
|
|
25
|
+
};
|
|
29
26
|
if (bucket.website.domain) {
|
|
30
27
|
config.Domain = bucket.website.domain;
|
|
31
28
|
}
|
|
@@ -19,10 +19,8 @@ const bucketToTosConfig = (bucket) => {
|
|
|
19
19
|
if (bucket.website) {
|
|
20
20
|
config.websiteConfig = {
|
|
21
21
|
indexDocument: bucket.website.index,
|
|
22
|
+
errorDocument: bucket.website.index,
|
|
22
23
|
};
|
|
23
|
-
if (bucket.website.error_page) {
|
|
24
|
-
config.websiteConfig.errorDocument = bucket.website.error_page;
|
|
25
|
-
}
|
|
26
24
|
}
|
|
27
25
|
return config;
|
|
28
26
|
};
|
|
@@ -19,6 +19,9 @@ var ResourceTypeEnum;
|
|
|
19
19
|
ResourceTypeEnum["ALIYUN_RDS_SERVERLESS"] = "ALIYUN_RDS_SERVERLESS";
|
|
20
20
|
ResourceTypeEnum["ALIYUN_ES_SERVERLESS"] = "ALIYUN_ES_SERVERLESS";
|
|
21
21
|
ResourceTypeEnum["ALIYUN_TABLESTORE_TABLE"] = "ALIYUN_TABLESTORE_TABLE";
|
|
22
|
+
// Aliyun - CDN Resources
|
|
23
|
+
ResourceTypeEnum["ALIYUN_CDN_DISTRIBUTION"] = "ALIYUN_CDN_DISTRIBUTION";
|
|
24
|
+
ResourceTypeEnum["ALIYUN_CDN_DNS_CNAME"] = "ALIYUN_CDN_DNS_CNAME";
|
|
22
25
|
// Aliyun - FC3 Dependent Resources
|
|
23
26
|
ResourceTypeEnum["ALIYUN_SLS_PROJECT"] = "ALIYUN_SLS_PROJECT";
|
|
24
27
|
ResourceTypeEnum["ALIYUN_SLS_LOGSTORE"] = "ALIYUN_SLS_LOGSTORE";
|
|
@@ -2,6 +2,126 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.bucketSchema = void 0;
|
|
4
4
|
const templateRefSchema_1 = require("./templateRefSchema");
|
|
5
|
+
const cdnSchema = {
|
|
6
|
+
oneOf: [
|
|
7
|
+
{ type: 'boolean' },
|
|
8
|
+
{
|
|
9
|
+
type: 'object',
|
|
10
|
+
properties: {
|
|
11
|
+
enabled: templateRefSchema_1.resolvableBoolean,
|
|
12
|
+
cdn_type: { type: 'string', enum: ['web', 'download', 'video'] },
|
|
13
|
+
scope: { type: 'string', enum: ['domestic', 'overseas', 'global'] },
|
|
14
|
+
cache_ttl: { type: 'number' },
|
|
15
|
+
ignore_query_string: templateRefSchema_1.resolvableBoolean,
|
|
16
|
+
origin_protocol: { type: 'string', enum: ['http', 'https', 'follow'] },
|
|
17
|
+
compression: templateRefSchema_1.resolvableBoolean,
|
|
18
|
+
force_redirect_https: templateRefSchema_1.resolvableBoolean,
|
|
19
|
+
},
|
|
20
|
+
additionalProperties: false,
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
};
|
|
24
|
+
const bucketDomainSchema = {
|
|
25
|
+
oneOf: [
|
|
26
|
+
{ type: 'string' },
|
|
27
|
+
{
|
|
28
|
+
type: 'object',
|
|
29
|
+
properties: {
|
|
30
|
+
domain_name: { type: 'string' },
|
|
31
|
+
certificate_id: { type: 'string' },
|
|
32
|
+
certificate_body: { type: 'string' },
|
|
33
|
+
certificate_private_key: { type: 'string' },
|
|
34
|
+
protocol: {
|
|
35
|
+
oneOf: [
|
|
36
|
+
{ type: 'string', enum: ['HTTP', 'HTTPS'] },
|
|
37
|
+
{
|
|
38
|
+
type: 'array',
|
|
39
|
+
items: { type: 'string', enum: ['HTTP', 'HTTPS'] },
|
|
40
|
+
minItems: 1,
|
|
41
|
+
uniqueItems: true,
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
},
|
|
45
|
+
www_bind_apex: templateRefSchema_1.resolvableBoolean,
|
|
46
|
+
cdn: cdnSchema,
|
|
47
|
+
accelerate: templateRefSchema_1.resolvableBoolean,
|
|
48
|
+
},
|
|
49
|
+
required: ['domain_name'],
|
|
50
|
+
additionalProperties: false,
|
|
51
|
+
oneOf: [
|
|
52
|
+
{
|
|
53
|
+
not: {
|
|
54
|
+
anyOf: [
|
|
55
|
+
{ required: ['certificate_id'] },
|
|
56
|
+
{ required: ['certificate_body'] },
|
|
57
|
+
{ required: ['certificate_private_key'] },
|
|
58
|
+
],
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
required: ['certificate_body', 'certificate_private_key'],
|
|
63
|
+
not: { required: ['certificate_id'] },
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
required: ['certificate_id'],
|
|
67
|
+
not: {
|
|
68
|
+
anyOf: [{ required: ['certificate_body'] }, { required: ['certificate_private_key'] }],
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
],
|
|
72
|
+
},
|
|
73
|
+
],
|
|
74
|
+
};
|
|
75
|
+
const bucketWebsiteDomainSchema = {
|
|
76
|
+
oneOf: [
|
|
77
|
+
{ type: 'string' },
|
|
78
|
+
{
|
|
79
|
+
type: 'object',
|
|
80
|
+
properties: {
|
|
81
|
+
domain_name: { type: 'string' },
|
|
82
|
+
certificate_id: { type: 'string' },
|
|
83
|
+
certificate_body: { type: 'string' },
|
|
84
|
+
certificate_private_key: { type: 'string' },
|
|
85
|
+
protocol: {
|
|
86
|
+
oneOf: [
|
|
87
|
+
{ type: 'string', enum: ['HTTP', 'HTTPS'] },
|
|
88
|
+
{
|
|
89
|
+
type: 'array',
|
|
90
|
+
items: { type: 'string', enum: ['HTTP', 'HTTPS'] },
|
|
91
|
+
minItems: 1,
|
|
92
|
+
uniqueItems: true,
|
|
93
|
+
},
|
|
94
|
+
],
|
|
95
|
+
},
|
|
96
|
+
www_bind_apex: templateRefSchema_1.resolvableBoolean,
|
|
97
|
+
cdn: cdnSchema,
|
|
98
|
+
},
|
|
99
|
+
required: ['domain_name'],
|
|
100
|
+
additionalProperties: false,
|
|
101
|
+
oneOf: [
|
|
102
|
+
{
|
|
103
|
+
not: {
|
|
104
|
+
anyOf: [
|
|
105
|
+
{ required: ['certificate_id'] },
|
|
106
|
+
{ required: ['certificate_body'] },
|
|
107
|
+
{ required: ['certificate_private_key'] },
|
|
108
|
+
],
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
required: ['certificate_body', 'certificate_private_key'],
|
|
113
|
+
not: { required: ['certificate_id'] },
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
required: ['certificate_id'],
|
|
117
|
+
not: {
|
|
118
|
+
anyOf: [{ required: ['certificate_body'] }, { required: ['certificate_private_key'] }],
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
],
|
|
122
|
+
},
|
|
123
|
+
],
|
|
124
|
+
};
|
|
5
125
|
exports.bucketSchema = {
|
|
6
126
|
$id: 'https://serverlessinsight.geekfun.club/schemas/bucketschema.json',
|
|
7
127
|
type: 'object',
|
|
@@ -46,71 +166,19 @@ exports.bucketSchema = {
|
|
|
46
166
|
},
|
|
47
167
|
additionalProperties: false,
|
|
48
168
|
},
|
|
169
|
+
// Canonical domain config (top-level)
|
|
170
|
+
domain: bucketDomainSchema,
|
|
49
171
|
website: {
|
|
50
172
|
type: 'object',
|
|
51
173
|
properties: {
|
|
52
174
|
code: {
|
|
53
175
|
type: 'string',
|
|
54
176
|
},
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
{ type: 'string' },
|
|
58
|
-
{
|
|
59
|
-
type: 'object',
|
|
60
|
-
properties: {
|
|
61
|
-
domain_name: { type: 'string' },
|
|
62
|
-
certificate_id: { type: 'string' },
|
|
63
|
-
certificate_body: { type: 'string' },
|
|
64
|
-
certificate_private_key: { type: 'string' },
|
|
65
|
-
protocol: {
|
|
66
|
-
oneOf: [
|
|
67
|
-
{ type: 'string', enum: ['HTTP', 'HTTPS'] },
|
|
68
|
-
{
|
|
69
|
-
type: 'array',
|
|
70
|
-
items: { type: 'string', enum: ['HTTP', 'HTTPS'] },
|
|
71
|
-
minItems: 1,
|
|
72
|
-
uniqueItems: true,
|
|
73
|
-
},
|
|
74
|
-
],
|
|
75
|
-
},
|
|
76
|
-
www_bind_apex: templateRefSchema_1.resolvableBoolean,
|
|
77
|
-
},
|
|
78
|
-
required: ['domain_name'],
|
|
79
|
-
additionalProperties: false,
|
|
80
|
-
oneOf: [
|
|
81
|
-
{
|
|
82
|
-
not: {
|
|
83
|
-
anyOf: [
|
|
84
|
-
{ required: ['certificate_id'] },
|
|
85
|
-
{ required: ['certificate_body'] },
|
|
86
|
-
{ required: ['certificate_private_key'] },
|
|
87
|
-
],
|
|
88
|
-
},
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
required: ['certificate_body', 'certificate_private_key'],
|
|
92
|
-
not: { required: ['certificate_id'] },
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
required: ['certificate_id'],
|
|
96
|
-
not: {
|
|
97
|
-
anyOf: [
|
|
98
|
-
{ required: ['certificate_body'] },
|
|
99
|
-
{ required: ['certificate_private_key'] },
|
|
100
|
-
],
|
|
101
|
-
},
|
|
102
|
-
},
|
|
103
|
-
],
|
|
104
|
-
},
|
|
105
|
-
],
|
|
106
|
-
},
|
|
177
|
+
// Deprecated: Use top-level `domain` instead
|
|
178
|
+
domain: bucketWebsiteDomainSchema,
|
|
107
179
|
index: {
|
|
108
180
|
type: 'string',
|
|
109
181
|
},
|
|
110
|
-
error_page: {
|
|
111
|
-
type: 'string',
|
|
112
|
-
},
|
|
113
|
-
error_code: templateRefSchema_1.resolvableNumber,
|
|
114
182
|
},
|
|
115
183
|
required: ['code'],
|
|
116
184
|
additionalProperties: false,
|
|
@@ -2,6 +2,25 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.eventSchema = void 0;
|
|
4
4
|
const templateRefSchema_1 = require("./templateRefSchema");
|
|
5
|
+
const cdnSchema = {
|
|
6
|
+
oneOf: [
|
|
7
|
+
{ type: 'boolean' },
|
|
8
|
+
{
|
|
9
|
+
type: 'object',
|
|
10
|
+
properties: {
|
|
11
|
+
enabled: { type: 'boolean' },
|
|
12
|
+
cdn_type: { type: 'string', enum: ['web', 'download', 'video'] },
|
|
13
|
+
scope: { type: 'string', enum: ['domestic', 'overseas', 'global'] },
|
|
14
|
+
cache_ttl: { type: 'number' },
|
|
15
|
+
ignore_query_string: { type: 'boolean' },
|
|
16
|
+
origin_protocol: { type: 'string', enum: ['http', 'https', 'follow'] },
|
|
17
|
+
compression: { type: 'boolean' },
|
|
18
|
+
force_redirect_https: { type: 'boolean' },
|
|
19
|
+
},
|
|
20
|
+
additionalProperties: false,
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
};
|
|
5
24
|
exports.eventSchema = {
|
|
6
25
|
$id: 'https://serverlessinsight.geekfun.club/schemas/eventschema.json',
|
|
7
26
|
type: 'object',
|
|
@@ -41,6 +60,7 @@ exports.eventSchema = {
|
|
|
41
60
|
],
|
|
42
61
|
},
|
|
43
62
|
www_bind_apex: { type: 'boolean' },
|
|
63
|
+
cdn: cdnSchema,
|
|
44
64
|
},
|
|
45
65
|
oneOf: [
|
|
46
66
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["../src/index.ts","../src/commands/deploy.ts","../src/commands/destroy.ts","../src/commands/forceUnlock.ts","../src/commands/index.ts","../src/commands/local.ts","../src/commands/plan.ts","../src/commands/show.ts","../src/commands/validate.ts","../src/common/base64.ts","../src/common/certUtils.ts","../src/common/constants.ts","../src/common/context.ts","../src/common/credentials.ts","../src/common/domainUtils.ts","../src/common/fileUtils.ts","../src/common/getVersion.ts","../src/common/hashUtils.ts","../src/common/iacHelper.ts","../src/common/imsClient.ts","../src/common/index.ts","../src/common/lockManager.ts","../src/common/logger.ts","../src/common/planFormatter.ts","../src/common/providerEnum.ts","../src/common/requestHelper.ts","../src/common/retryUtils.ts","../src/common/runtimeMapper.ts","../src/common/scfClient.ts","../src/common/sidUtils.ts","../src/common/stateManager.ts","../src/common/aliyunClient/apigwOperations.ts","../src/common/aliyunClient/casOperations.ts","../src/common/aliyunClient/dnsOperations.ts","../src/common/aliyunClient/ecsOperations.ts","../src/common/aliyunClient/esOperations.ts","../src/common/aliyunClient/fc3Operations.ts","../src/common/aliyunClient/index.ts","../src/common/aliyunClient/nasOperations.ts","../src/common/aliyunClient/ossOperations.ts","../src/common/aliyunClient/ramOperations.ts","../src/common/aliyunClient/rdsOperations.ts","../src/common/aliyunClient/slsOperations.ts","../src/common/aliyunClient/tablestoreOperations.ts","../src/common/aliyunClient/types.ts","../src/common/dependencyGraph/graph.ts","../src/common/dependencyGraph/index.ts","../src/common/dependencyGraph/types.ts","../src/common/stateBackend/cosStateBackend.ts","../src/common/stateBackend/index.ts","../src/common/stateBackend/localStateBackend.ts","../src/common/stateBackend/lockUtils.ts","../src/common/stateBackend/ossStateBackend.ts","../src/common/stateBackend/remoteStateBackend.ts","../src/common/stateBackend/types.ts","../src/common/tencentClient/cosOperations.ts","../src/common/tencentClient/dnspodOperations.ts","../src/common/tencentClient/esOperations.ts","../src/common/tencentClient/index.ts","../src/common/tencentClient/scfOperations.ts","../src/common/tencentClient/sslOperations.ts","../src/common/tencentClient/tdsqlcOperations.ts","../src/common/tencentClient/types.ts","../src/common/volcengineClient/apigwOperations.ts","../src/common/volcengineClient/iamOperations.ts","../src/common/volcengineClient/index.ts","../src/common/volcengineClient/tlsOperations.ts","../src/common/volcengineClient/tosOperations.ts","../src/common/volcengineClient/types.ts","../src/common/volcengineClient/vefaasOperations.ts","../src/lang/en.ts","../src/lang/index.ts","../src/lang/zh-CN.ts","../src/parser/bucketParser.ts","../src/parser/databaseParser.ts","../src/parser/eventParser.ts","../src/parser/functionParser.ts","../src/parser/index.ts","../src/parser/parseUtils.ts","../src/parser/tableParser.ts","../src/parser/tagParser.ts","../src/stack/bucketTypes.ts","../src/stack/deploy.ts","../src/stack/index.ts","../src/stack/aliyunStack/apigwExecutor.ts","../src/stack/aliyunStack/apigwPlanner.ts","../src/stack/aliyunStack/apigwResource.ts","../src/stack/aliyunStack/apigwTypes.ts","../src/stack/aliyunStack/databaseExecutor.ts","../src/stack/aliyunStack/databasePlanner.ts","../src/stack/aliyunStack/databaseResource.ts","../src/stack/aliyunStack/deployer.ts","../src/stack/aliyunStack/destroyer.ts","../src/stack/aliyunStack/esServerlessTypes.ts","../src/stack/aliyunStack/fc3Executor.ts","../src/stack/aliyunStack/fc3Planner.ts","../src/stack/aliyunStack/fc3Resource.ts","../src/stack/aliyunStack/fc3Types.ts","../src/stack/aliyunStack/index.ts","../src/stack/aliyunStack/ossExecutor.ts","../src/stack/aliyunStack/ossPlanner.ts","../src/stack/aliyunStack/ossResource.ts","../src/stack/aliyunStack/ossTypes.ts","../src/stack/aliyunStack/planner.ts","../src/stack/aliyunStack/rdsTypes.ts","../src/stack/aliyunStack/tablestoreExecutor.ts","../src/stack/aliyunStack/tablestorePlanner.ts","../src/stack/aliyunStack/tablestoreResource.ts","../src/stack/aliyunStack/tablestoreTypes.ts","../src/stack/localStack/aliyunFc.ts","../src/stack/localStack/bucket.ts","../src/stack/localStack/event.ts","../src/stack/localStack/function.ts","../src/stack/localStack/functionRunner.ts","../src/stack/localStack/index.ts","../src/stack/localStack/localServer.ts","../src/stack/localStack/utils.ts","../src/stack/rfsStack/function.ts","../src/stack/rfsStack/index.ts","../src/stack/scfStack/cosExecutor.ts","../src/stack/scfStack/cosPlanner.ts","../src/stack/scfStack/cosResource.ts","../src/stack/scfStack/cosTypes.ts","../src/stack/scfStack/deployer.ts","../src/stack/scfStack/destroyer.ts","../src/stack/scfStack/esServerlessExecutor.ts","../src/stack/scfStack/esServerlessPlanner.ts","../src/stack/scfStack/esServerlessResource.ts","../src/stack/scfStack/esServerlessTypes.ts","../src/stack/scfStack/index.ts","../src/stack/scfStack/planner.ts","../src/stack/scfStack/scfExecutor.ts","../src/stack/scfStack/scfPlanner.ts","../src/stack/scfStack/scfResource.ts","../src/stack/scfStack/scfTypes.ts","../src/stack/scfStack/tdsqlcExecutor.ts","../src/stack/scfStack/tdsqlcPlanner.ts","../src/stack/scfStack/tdsqlcResource.ts","../src/stack/scfStack/tdsqlcTypes.ts","../src/stack/volcengineStack/apigwExecutor.ts","../src/stack/volcengineStack/apigwPlanner.ts","../src/stack/volcengineStack/apigwResource.ts","../src/stack/volcengineStack/apigwTypes.ts","../src/stack/volcengineStack/deployer.ts","../src/stack/volcengineStack/destroyer.ts","../src/stack/volcengineStack/index.ts","../src/stack/volcengineStack/planner.ts","../src/stack/volcengineStack/tosExecutor.ts","../src/stack/volcengineStack/tosPlanner.ts","../src/stack/volcengineStack/tosResource.ts","../src/stack/volcengineStack/tosTypes.ts","../src/stack/volcengineStack/vefaasExecutor.ts","../src/stack/volcengineStack/vefaasPlanner.ts","../src/stack/volcengineStack/vefaasResource.ts","../src/stack/volcengineStack/vefaasTypes.ts","../src/types/assets.ts","../src/types/index.ts","../src/types/tablestore.d.ts","../src/types/domains/backend.ts","../src/types/domains/bucket.ts","../src/types/domains/context.ts","../src/types/domains/database.ts","../src/types/domains/event.ts","../src/types/domains/function.ts","../src/types/domains/lock.ts","../src/types/domains/provider.ts","../src/types/domains/resolvable.ts","../src/types/domains/state.ts","../src/types/domains/table.ts","../src/types/domains/tag.ts","../src/types/domains/vars.ts","../src/types/localStack/index.ts","../src/validator/bucketSchema.ts","../src/validator/databaseSchema.ts","../src/validator/eventSchema.ts","../src/validator/functionSchema.ts","../src/validator/iacSchema.ts","../src/validator/index.ts","../src/validator/rootSchema.ts","../src/validator/tableschema.ts","../src/validator/templateRefSchema.ts"],"version":"
|
|
1
|
+
{"root":["../src/index.ts","../src/commands/deploy.ts","../src/commands/destroy.ts","../src/commands/forceUnlock.ts","../src/commands/index.ts","../src/commands/local.ts","../src/commands/plan.ts","../src/commands/show.ts","../src/commands/validate.ts","../src/common/base64.ts","../src/common/certUtils.ts","../src/common/constants.ts","../src/common/context.ts","../src/common/credentials.ts","../src/common/domainUtils.ts","../src/common/fileUtils.ts","../src/common/getVersion.ts","../src/common/hashUtils.ts","../src/common/iacHelper.ts","../src/common/imsClient.ts","../src/common/index.ts","../src/common/lockManager.ts","../src/common/logger.ts","../src/common/planFormatter.ts","../src/common/providerEnum.ts","../src/common/requestHelper.ts","../src/common/retryUtils.ts","../src/common/runtimeMapper.ts","../src/common/scfClient.ts","../src/common/sidUtils.ts","../src/common/stateManager.ts","../src/common/aliyunClient/apigwOperations.ts","../src/common/aliyunClient/casOperations.ts","../src/common/aliyunClient/cdnOperations.ts","../src/common/aliyunClient/dnsOperations.ts","../src/common/aliyunClient/ecsOperations.ts","../src/common/aliyunClient/esOperations.ts","../src/common/aliyunClient/fc3Operations.ts","../src/common/aliyunClient/index.ts","../src/common/aliyunClient/nasOperations.ts","../src/common/aliyunClient/ossOperations.ts","../src/common/aliyunClient/ramOperations.ts","../src/common/aliyunClient/rdsOperations.ts","../src/common/aliyunClient/slsOperations.ts","../src/common/aliyunClient/tablestoreOperations.ts","../src/common/aliyunClient/types.ts","../src/common/dependencyGraph/graph.ts","../src/common/dependencyGraph/index.ts","../src/common/dependencyGraph/types.ts","../src/common/stateBackend/cosStateBackend.ts","../src/common/stateBackend/index.ts","../src/common/stateBackend/localStateBackend.ts","../src/common/stateBackend/lockUtils.ts","../src/common/stateBackend/ossStateBackend.ts","../src/common/stateBackend/remoteStateBackend.ts","../src/common/stateBackend/types.ts","../src/common/tencentClient/cosOperations.ts","../src/common/tencentClient/dnspodOperations.ts","../src/common/tencentClient/esOperations.ts","../src/common/tencentClient/index.ts","../src/common/tencentClient/scfOperations.ts","../src/common/tencentClient/sslOperations.ts","../src/common/tencentClient/tdsqlcOperations.ts","../src/common/tencentClient/types.ts","../src/common/volcengineClient/apigwOperations.ts","../src/common/volcengineClient/iamOperations.ts","../src/common/volcengineClient/index.ts","../src/common/volcengineClient/tlsOperations.ts","../src/common/volcengineClient/tosOperations.ts","../src/common/volcengineClient/types.ts","../src/common/volcengineClient/vefaasOperations.ts","../src/lang/en.ts","../src/lang/index.ts","../src/lang/zh-CN.ts","../src/parser/bucketParser.ts","../src/parser/databaseParser.ts","../src/parser/eventParser.ts","../src/parser/functionParser.ts","../src/parser/index.ts","../src/parser/parseUtils.ts","../src/parser/tableParser.ts","../src/parser/tagParser.ts","../src/stack/bucketTypes.ts","../src/stack/deploy.ts","../src/stack/index.ts","../src/stack/aliyunStack/apigwExecutor.ts","../src/stack/aliyunStack/apigwPlanner.ts","../src/stack/aliyunStack/apigwResource.ts","../src/stack/aliyunStack/apigwTypes.ts","../src/stack/aliyunStack/databaseExecutor.ts","../src/stack/aliyunStack/databasePlanner.ts","../src/stack/aliyunStack/databaseResource.ts","../src/stack/aliyunStack/deployer.ts","../src/stack/aliyunStack/destroyer.ts","../src/stack/aliyunStack/esServerlessTypes.ts","../src/stack/aliyunStack/fc3Executor.ts","../src/stack/aliyunStack/fc3Planner.ts","../src/stack/aliyunStack/fc3Resource.ts","../src/stack/aliyunStack/fc3Types.ts","../src/stack/aliyunStack/index.ts","../src/stack/aliyunStack/ossExecutor.ts","../src/stack/aliyunStack/ossPlanner.ts","../src/stack/aliyunStack/ossResource.ts","../src/stack/aliyunStack/ossTypes.ts","../src/stack/aliyunStack/planner.ts","../src/stack/aliyunStack/rdsTypes.ts","../src/stack/aliyunStack/tablestoreExecutor.ts","../src/stack/aliyunStack/tablestorePlanner.ts","../src/stack/aliyunStack/tablestoreResource.ts","../src/stack/aliyunStack/tablestoreTypes.ts","../src/stack/localStack/aliyunFc.ts","../src/stack/localStack/bucket.ts","../src/stack/localStack/event.ts","../src/stack/localStack/function.ts","../src/stack/localStack/functionRunner.ts","../src/stack/localStack/index.ts","../src/stack/localStack/localServer.ts","../src/stack/localStack/utils.ts","../src/stack/rfsStack/function.ts","../src/stack/rfsStack/index.ts","../src/stack/scfStack/cosExecutor.ts","../src/stack/scfStack/cosPlanner.ts","../src/stack/scfStack/cosResource.ts","../src/stack/scfStack/cosTypes.ts","../src/stack/scfStack/deployer.ts","../src/stack/scfStack/destroyer.ts","../src/stack/scfStack/esServerlessExecutor.ts","../src/stack/scfStack/esServerlessPlanner.ts","../src/stack/scfStack/esServerlessResource.ts","../src/stack/scfStack/esServerlessTypes.ts","../src/stack/scfStack/index.ts","../src/stack/scfStack/planner.ts","../src/stack/scfStack/scfExecutor.ts","../src/stack/scfStack/scfPlanner.ts","../src/stack/scfStack/scfResource.ts","../src/stack/scfStack/scfTypes.ts","../src/stack/scfStack/tdsqlcExecutor.ts","../src/stack/scfStack/tdsqlcPlanner.ts","../src/stack/scfStack/tdsqlcResource.ts","../src/stack/scfStack/tdsqlcTypes.ts","../src/stack/volcengineStack/apigwExecutor.ts","../src/stack/volcengineStack/apigwPlanner.ts","../src/stack/volcengineStack/apigwResource.ts","../src/stack/volcengineStack/apigwTypes.ts","../src/stack/volcengineStack/deployer.ts","../src/stack/volcengineStack/destroyer.ts","../src/stack/volcengineStack/index.ts","../src/stack/volcengineStack/planner.ts","../src/stack/volcengineStack/tosExecutor.ts","../src/stack/volcengineStack/tosPlanner.ts","../src/stack/volcengineStack/tosResource.ts","../src/stack/volcengineStack/tosTypes.ts","../src/stack/volcengineStack/vefaasExecutor.ts","../src/stack/volcengineStack/vefaasPlanner.ts","../src/stack/volcengineStack/vefaasResource.ts","../src/stack/volcengineStack/vefaasTypes.ts","../src/types/assets.ts","../src/types/index.ts","../src/types/tablestore.d.ts","../src/types/domains/backend.ts","../src/types/domains/bucket.ts","../src/types/domains/context.ts","../src/types/domains/database.ts","../src/types/domains/event.ts","../src/types/domains/function.ts","../src/types/domains/lock.ts","../src/types/domains/provider.ts","../src/types/domains/resolvable.ts","../src/types/domains/state.ts","../src/types/domains/table.ts","../src/types/domains/tag.ts","../src/types/domains/vars.ts","../src/types/localStack/index.ts","../src/validator/bucketSchema.ts","../src/validator/databaseSchema.ts","../src/validator/eventSchema.ts","../src/validator/functionSchema.ts","../src/validator/iacSchema.ts","../src/validator/index.ts","../src/validator/rootSchema.ts","../src/validator/tableschema.ts","../src/validator/templateRefSchema.ts"],"version":"6.0.3"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geek-fun/serverlessinsight",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.4",
|
|
4
4
|
"description": "Full life cycle cross providers serverless application management for your fast-growing business.",
|
|
5
5
|
"homepage": "https://serverlessinsight.geekfun.club",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
@@ -53,61 +53,63 @@
|
|
|
53
53
|
"function"
|
|
54
54
|
],
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@alicloud/alidns20150109": "^4.
|
|
57
|
-
"@alicloud/cas20200407": "^3.2.
|
|
58
|
-
"@alicloud/
|
|
59
|
-
"@alicloud/
|
|
60
|
-
"@alicloud/
|
|
61
|
-
"@alicloud/
|
|
62
|
-
"@alicloud/
|
|
63
|
-
"@alicloud/
|
|
56
|
+
"@alicloud/alidns20150109": "^4.4.1",
|
|
57
|
+
"@alicloud/cas20200407": "^3.2.8",
|
|
58
|
+
"@alicloud/cdn20180510": "^9.2.0",
|
|
59
|
+
"@alicloud/cloudapi20160714": "^4.8.0",
|
|
60
|
+
"@alicloud/ecs20140526": "^7.8.6",
|
|
61
|
+
"@alicloud/es-serverless20230627": "^2.3.1",
|
|
62
|
+
"@alicloud/fc20230330": "^4.7.7",
|
|
63
|
+
"@alicloud/ims20190815": "^2.3.6",
|
|
64
|
+
"@alicloud/nas20170626": "^3.4.2",
|
|
64
65
|
"@alicloud/openapi-client": "^0.4.15",
|
|
65
|
-
"@alicloud/ram20150501": "^1.2.
|
|
66
|
-
"@alicloud/rds20140815": "^15.
|
|
67
|
-
"@alicloud/sls20201230": "^5.
|
|
68
|
-
"@volcengine/openapi": "^1.36.
|
|
69
|
-
"@volcengine/tos-sdk": "^2.
|
|
70
|
-
"ajv": "^8.
|
|
66
|
+
"@alicloud/ram20150501": "^1.2.1",
|
|
67
|
+
"@alicloud/rds20140815": "^15.9.0",
|
|
68
|
+
"@alicloud/sls20201230": "^5.10.1",
|
|
69
|
+
"@volcengine/openapi": "^1.36.2",
|
|
70
|
+
"@volcengine/tos-sdk": "^2.9.1",
|
|
71
|
+
"ajv": "^8.20.0",
|
|
71
72
|
"ali-oss": "^6.23.0",
|
|
72
|
-
"commander": "^
|
|
73
|
+
"commander": "^15.0.0",
|
|
73
74
|
"cos-nodejs-sdk-v5": "^2.16.0-beta.8",
|
|
74
75
|
"i18n": "^0.15.3",
|
|
75
76
|
"iconv-lite": "^0.7.2",
|
|
76
77
|
"jszip": "^3.10.1",
|
|
77
|
-
"lodash": "^4.
|
|
78
|
+
"lodash": "^4.18.1",
|
|
78
79
|
"pino": "^10.3.1",
|
|
79
80
|
"pino-pretty": "^13.1.3",
|
|
80
|
-
"tablestore": "^5.6.
|
|
81
|
-
"tencentcloud-sdk-nodejs-cynosdb": "^4.1.
|
|
82
|
-
"tencentcloud-sdk-nodejs-dnspod": "^4.1.
|
|
83
|
-
"tencentcloud-sdk-nodejs-es": "^4.1.
|
|
81
|
+
"tablestore": "^5.6.5",
|
|
82
|
+
"tencentcloud-sdk-nodejs-cynosdb": "^4.1.257",
|
|
83
|
+
"tencentcloud-sdk-nodejs-dnspod": "^4.1.257",
|
|
84
|
+
"tencentcloud-sdk-nodejs-es": "^4.1.257",
|
|
84
85
|
"tencentcloud-sdk-nodejs-scf": "^4.1.168",
|
|
85
|
-
"tencentcloud-sdk-nodejs-ssl": "^4.1.
|
|
86
|
-
"yaml": "^2.
|
|
86
|
+
"tencentcloud-sdk-nodejs-ssl": "^4.1.239",
|
|
87
|
+
"yaml": "^2.9.0"
|
|
87
88
|
},
|
|
88
89
|
"devDependencies": {
|
|
89
|
-
"@eslint/eslintrc": "^3.3.
|
|
90
|
+
"@eslint/eslintrc": "^3.3.5",
|
|
90
91
|
"@eslint/js": "^10.0.1",
|
|
91
92
|
"@types/ali-oss": "^6.23.3",
|
|
92
93
|
"@types/i18n": "^0.13.12",
|
|
93
94
|
"@types/jest": "^30.0.0",
|
|
94
95
|
"@types/lodash": "^4.17.24",
|
|
95
|
-
"@types/node": "^
|
|
96
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
97
|
-
"@typescript-eslint/parser": "^8.
|
|
96
|
+
"@types/node": "^26.0.1",
|
|
97
|
+
"@typescript-eslint/eslint-plugin": "^8.62.0",
|
|
98
|
+
"@typescript-eslint/parser": "^8.62.0",
|
|
98
99
|
"cross-env": "^10.1.0",
|
|
99
|
-
"eslint": "^10.0
|
|
100
|
+
"eslint": "^10.6.0",
|
|
100
101
|
"eslint-config-prettier": "^10.1.8",
|
|
101
|
-
"eslint-plugin-prettier": "^5.5.
|
|
102
|
-
"globals": "^17.
|
|
102
|
+
"eslint-plugin-prettier": "^5.5.6",
|
|
103
|
+
"globals": "^17.7.0",
|
|
103
104
|
"husky": "^9.1.7",
|
|
104
|
-
"jest": "^30.2
|
|
105
|
-
"prettier": "^3.8.
|
|
106
|
-
"ts-jest": "^29.4.
|
|
105
|
+
"jest": "^30.4.2",
|
|
106
|
+
"prettier": "^3.8.5",
|
|
107
|
+
"ts-jest": "^29.4.11",
|
|
107
108
|
"ts-node": "^10.9.2",
|
|
108
|
-
"typescript": "^
|
|
109
|
+
"typescript": "^6.0.3"
|
|
109
110
|
},
|
|
110
111
|
"overrides": {
|
|
111
|
-
"fast-xml-parser": ">=5.3.8"
|
|
112
|
+
"fast-xml-parser": ">=5.3.8",
|
|
113
|
+
"protobufjs": "^7.6.1"
|
|
112
114
|
}
|
|
113
115
|
}
|
|
@@ -9,7 +9,7 @@ The Tencent COS support provides full lifecycle management for cloud storage buc
|
|
|
9
9
|
- **State Management**: Local state tracking in `.serverlessinsight/state.json`
|
|
10
10
|
- **Plan & Apply Flow**: Preview changes before applying them
|
|
11
11
|
- **Drift Detection**: Detect manual changes made outside ServerlessInsight
|
|
12
|
-
- **Website Hosting**: Configure static website hosting
|
|
12
|
+
- **Website Hosting**: Configure static website hosting
|
|
13
13
|
- **Access Control**: Configure bucket ACL (private, public-read, public-read-write)
|
|
14
14
|
- **Idempotent Operations**: Safe to re-run deployments
|
|
15
15
|
|
|
@@ -39,8 +39,6 @@ buckets:
|
|
|
39
39
|
website: # Optional: Enable static website hosting
|
|
40
40
|
code: dist # Local directory to deploy (not implemented yet)
|
|
41
41
|
index: index.html
|
|
42
|
-
error_page: 404.html
|
|
43
|
-
error_code: 404
|
|
44
42
|
```
|
|
45
43
|
|
|
46
44
|
## Bucket Naming Requirements
|
|
@@ -187,9 +185,7 @@ buckets:
|
|
|
187
185
|
security:
|
|
188
186
|
acl: PUBLIC_READ # Website content must be publicly readable
|
|
189
187
|
website:
|
|
190
|
-
index: index.html # Default page
|
|
191
|
-
error_page: 404.html # Error page
|
|
192
|
-
error_code: 404 # HTTP error code
|
|
188
|
+
index: index.html # Default page (also used as error document for SPA routing)
|
|
193
189
|
```
|
|
194
190
|
|
|
195
191
|
After deployment, your website will be accessible at:
|
|
@@ -229,8 +225,6 @@ buckets:
|
|
|
229
225
|
acl: PUBLIC_READ
|
|
230
226
|
website:
|
|
231
227
|
index: index.html
|
|
232
|
-
error_page: 404.html
|
|
233
|
-
error_code: 404
|
|
234
228
|
```
|
|
235
229
|
|
|
236
230
|
## Idempotency
|
|
@@ -289,8 +283,6 @@ buckets:
|
|
|
289
283
|
acl: PUBLIC_READ
|
|
290
284
|
website: # Added website configuration
|
|
291
285
|
index: index.html
|
|
292
|
-
error_page: 404.html
|
|
293
|
-
error_code: 404
|
|
294
286
|
```
|
|
295
287
|
|
|
296
288
|
Run `si deploy` to apply the change.
|
|
@@ -349,8 +341,6 @@ buckets:
|
|
|
349
341
|
acl: PUBLIC_READ
|
|
350
342
|
website:
|
|
351
343
|
index: index.html
|
|
352
|
-
error_page: error.html
|
|
353
|
-
error_code: 404
|
|
354
344
|
```
|
|
355
345
|
|
|
356
346
|
### Multiple Buckets
|
|
@@ -380,8 +370,6 @@ buckets:
|
|
|
380
370
|
acl: PUBLIC_READ
|
|
381
371
|
website:
|
|
382
372
|
index: index.html
|
|
383
|
-
error_page: 404.html
|
|
384
|
-
error_code: 404
|
|
385
373
|
```
|
|
386
374
|
|
|
387
375
|
## Troubleshooting
|
|
@@ -425,7 +413,7 @@ coscmd delete -r -f /
|
|
|
425
413
|
If your website is not accessible after deployment:
|
|
426
414
|
|
|
427
415
|
1. Verify ACL is set to `PUBLIC_READ`
|
|
428
|
-
2. Check that `index`
|
|
416
|
+
2. Check that `index` file exists in the bucket
|
|
429
417
|
3. Access the website using the correct URL format:
|
|
430
418
|
```
|
|
431
419
|
http://{bucket-name}.cos-website.{region}.myqcloud.com
|