-
Notifications
You must be signed in to change notification settings - Fork 218
Expand file tree
/
Copy pathcompileStateMachines.schema.js
More file actions
99 lines (87 loc) · 2.22 KB
/
compileStateMachines.schema.js
File metadata and controls
99 lines (87 loc) · 2.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
const Joi = require('joi');
const arn = Joi.alternatives().try(
Joi.string().regex(/^arn:aws/, 'ARN'),
Joi.object().keys({
Ref: Joi.string(),
}),
Joi.object().keys({
'Fn::GetAtt': Joi.array().items(Joi.string()),
}),
Joi.object().keys({
'Fn::ImportValue': Joi.alternatives().try(
Joi.string(),
Joi.object(),
),
}),
Joi.object().keys({
'Fn::Join': Joi.array().items(
Joi.string(),
Joi.array().items(
Joi.string(),
Joi.object().keys({
Ref: Joi.string(),
}),
),
),
}),
);
const definition = Joi.alternatives().try(
Joi.string(),
Joi.object(),
);
const inheritGlobalTags = Joi.boolean();
const dependsOn = Joi.alternatives().try(
Joi.string(),
Joi.array().items(Joi.string()),
);
const loggingConfig = Joi.object().keys({
level: Joi.string().valid('ALL', 'ERROR', 'FATAL', 'OFF').default('OFF'),
includeExecutionData: Joi.boolean().default(false),
destinations: Joi.array().items(arn),
});
const tracingConfig = Joi.object().keys({
enabled: Joi.boolean().default(false),
});
const encryptionConfig = Joi.object().keys({
KmsDataKeyReusePeriodSeconds: Joi.number().default(900),
KmsKeyId: Joi.string().default(''),
Type: Joi.string().default('AWS_OWNED_KEY'),
});
const kmsKeyArns = Joi.array().items(arn);
const iamRoleStatements = Joi.array().items(
Joi.object({
Effect: Joi.string().valid('Allow', 'Deny'),
Action: [Joi.string(), Joi.array().items(Joi.string())],
Resource: [Joi.string(), Joi.array()],
}),
);
const id = Joi.string();
const tags = Joi.object();
const name = Joi.string();
const events = Joi.array();
const alarms = Joi.object();
const notifications = Joi.object();
const useExactVersion = Joi.boolean().default(false);
const type = Joi.string().valid('STANDARD', 'EXPRESS').default('STANDARD');
const retain = Joi.boolean().default(false);
const schema = Joi.object().keys({
id,
events,
name,
role: arn,
useExactVersion,
definition: definition.required(),
dependsOn,
tags,
alarms,
notifications,
type,
retain,
loggingConfig,
tracingConfig,
encryptionConfig,
inheritGlobalTags,
iamRoleStatements,
kmsKeyArns,
}).oxor('role', 'iamRoleStatements');
module.exports = schema;