/
constraints.ts
113 lines (99 loc) · 2.55 KB
/
constraints.ts
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
import { MessageLanguage } from './common';
import * as iam from '../../aws-iam';
import * as cdk from '../../core';
/**
* Properties for governance mechanisms and constraints.
*/
export interface CommonConstraintOptions {
/**
* The language code.
* Configures the language for error messages from service catalog.
*
* @default - English
*/
readonly messageLanguage?: MessageLanguage;
/**
* The description of the constraint.
*
* @default - No description provided
*/
readonly description?: string;
}
/**
* Properties for deploying with Stackset, which creates a StackSet constraint.
*/
export interface StackSetsConstraintOptions extends CommonConstraintOptions {
/**
* List of accounts to deploy stacks to.
*/
readonly accounts: string[];
/**
* List of regions to deploy stacks to.
*/
readonly regions: string[];
/**
* IAM role used to administer the StackSets configuration.
*/
readonly adminRole: iam.IRole;
/**
* IAM role used to provision the products in the Stacks.
*/
readonly executionRoleName: string;
/**
* Wether to allow end users to create, update, and delete stacks.
*
* @default false
*/
readonly allowStackSetInstanceOperations?: boolean;
}
/**
* Properties for ResourceUpdateConstraint.
*/
export interface TagUpdateConstraintOptions extends CommonConstraintOptions {
/**
* Toggle for if users should be allowed to change/update tags on provisioned products.
* @default true
*/
readonly allow?: boolean;
}
/**
* An assertion within a template rule, defined by intrinsic functions.
*/
export interface TemplateRuleAssertion {
/**
* The assertion condition.
*/
readonly assert: cdk.ICfnRuleConditionExpression;
/**
* The description for the asssertion.
* @default - no description provided for the assertion.
*/
readonly description?: string;
}
/**
* Defines the provisioning template constraints.
*/
export interface TemplateRule {
/**
* Name of the rule.
*/
readonly ruleName: string;
/**
* Specify when to apply rule with a rule-specific intrinsic function.
* @default - no rule condition provided
*/
readonly condition?: cdk.ICfnRuleConditionExpression;
/**
* A list of assertions that make up the rule.
*/
readonly assertions: TemplateRuleAssertion[];
}
/**
* Properties for provisoning rule constraint.
*/
export interface CloudFormationRuleConstraintOptions extends CommonConstraintOptions {
/**
* The rule with condition and assertions to apply to template.
*/
readonly rule: TemplateRule;
}