UNPKG

7.1 kBTypeScriptView Raw
1import { Construct } from 'constructs';
2import { CfnElement } from './cfn-element';
3import { IResolvable, IResolveContext } from './resolvable';
4export interface CfnParameterProps {
5 /**
6 * The data type for the parameter (DataType).
7 *
8 * @default String
9 */
10 readonly type?: string;
11 /**
12 * A value of the appropriate type for the template to use if no value is specified
13 * when a stack is created. If you define constraints for the parameter, you must specify
14 * a value that adheres to those constraints.
15 *
16 * @default - No default value for parameter.
17 */
18 readonly default?: any;
19 /**
20 * A regular expression that represents the patterns to allow for String types.
21 *
22 * @default - No constraints on patterns allowed for parameter.
23 */
24 readonly allowedPattern?: string;
25 /**
26 * An array containing the list of values allowed for the parameter.
27 *
28 * @default - No constraints on values allowed for parameter.
29 */
30 readonly allowedValues?: string[];
31 /**
32 * A string that explains a constraint when the constraint is violated.
33 * For example, without a constraint description, a parameter that has an allowed
34 * pattern of [A-Za-z0-9]+ displays the following error message when the user specifies
35 * an invalid value:
36 *
37 * @default - No description with customized error message when user specifies invalid values.
38 */
39 readonly constraintDescription?: string;
40 /**
41 * A string of up to 4000 characters that describes the parameter.
42 *
43 * @default - No description for the parameter.
44 */
45 readonly description?: string;
46 /**
47 * An integer value that determines the largest number of characters you want to allow for String types.
48 *
49 * @default - None.
50 */
51 readonly maxLength?: number;
52 /**
53 * A numeric value that determines the largest numeric value you want to allow for Number types.
54 *
55 * @default - None.
56 */
57 readonly maxValue?: number;
58 /**
59 * An integer value that determines the smallest number of characters you want to allow for String types.
60 *
61 * @default - None.
62 */
63 readonly minLength?: number;
64 /**
65 * A numeric value that determines the smallest numeric value you want to allow for Number types.
66 *
67 * @default - None.
68 */
69 readonly minValue?: number;
70 /**
71 * Whether to mask the parameter value when anyone makes a call that describes the stack.
72 * If you set the value to ``true``, the parameter value is masked with asterisks (``*****``).
73 *
74 * @default - Parameter values are not masked.
75 */
76 readonly noEcho?: boolean;
77}
78/**
79 * A CloudFormation parameter.
80 *
81 * Use the optional Parameters section to customize your templates.
82 * Parameters enable you to input custom values to your template each time you create or
83 * update a stack.
84 */
85export declare class CfnParameter extends CfnElement {
86 private _type;
87 private _default?;
88 private _allowedPattern?;
89 private _allowedValues?;
90 private _constraintDescription?;
91 private _description?;
92 private _maxLength?;
93 private _maxValue?;
94 private _minLength?;
95 private _minValue?;
96 private _noEcho?;
97 /**
98 * Creates a parameter construct.
99 * Note that the name (logical ID) of the parameter will derive from it's `coname` and location
100 * within the stack. Therefore, it is recommended that parameters are defined at the stack level.
101 *
102 * @param scope The parent construct.
103 * @param props The parameter properties.
104 */
105 constructor(scope: Construct, id: string, props?: CfnParameterProps);
106 /**
107 * The data type for the parameter (DataType).
108 *
109 * @default String
110 */
111 get type(): string;
112 set type(type: string);
113 /**
114 * A value of the appropriate type for the template to use if no value is specified
115 * when a stack is created. If you define constraints for the parameter, you must specify
116 * a value that adheres to those constraints.
117 *
118 * @default - No default value for parameter.
119 */
120 get default(): any;
121 set default(value: any);
122 /**
123 * A regular expression that represents the patterns to allow for String types.
124 *
125 * @default - No constraints on patterns allowed for parameter.
126 */
127 get allowedPattern(): string | undefined;
128 set allowedPattern(pattern: string | undefined);
129 /**
130 * An array containing the list of values allowed for the parameter.
131 *
132 * @default - No constraints on values allowed for parameter.
133 */
134 get allowedValues(): string[] | undefined;
135 set allowedValues(values: string[] | undefined);
136 /**
137 * A string that explains a constraint when the constraint is violated.
138 * For example, without a constraint description, a parameter that has an allowed
139 * pattern of [A-Za-z0-9]+ displays the following error message when the user specifies
140 * an invalid value:
141 *
142 * @default - No description with customized error message when user specifies invalid values.
143 */
144 get constraintDescription(): string | undefined;
145 set constraintDescription(desc: string | undefined);
146 /**
147 * A string of up to 4000 characters that describes the parameter.
148 *
149 * @default - No description for the parameter.
150 */
151 get description(): string | undefined;
152 set description(desc: string | undefined);
153 /**
154 * An integer value that determines the largest number of characters you want to allow for String types.
155 *
156 * @default - None.
157 */
158 get maxLength(): number | undefined;
159 set maxLength(len: number | undefined);
160 /**
161 * An integer value that determines the smallest number of characters you want to allow for String types.
162 *
163 * @default - None.
164 */
165 get minLength(): number | undefined;
166 set minLength(len: number | undefined);
167 /**
168 * A numeric value that determines the largest numeric value you want to allow for Number types.
169 *
170 * @default - None.
171 */
172 get maxValue(): number | undefined;
173 set maxValue(len: number | undefined);
174 /**
175 * A numeric value that determines the smallest numeric value you want to allow for Number types.
176 *
177 * @default - None.
178 */
179 get minValue(): number | undefined;
180 set minValue(len: number | undefined);
181 /**
182 * Indicates if this parameter is configured with "NoEcho" enabled.
183 */
184 get noEcho(): boolean;
185 set noEcho(echo: boolean);
186 /**
187 * The parameter value as a Token
188 */
189 get value(): IResolvable;
190 /**
191 * The parameter value, if it represents a string.
192 */
193 get valueAsString(): string;
194 /**
195 * The parameter value, if it represents a string list.
196 */
197 get valueAsList(): string[];
198 /**
199 * The parameter value, if it represents a number.
200 */
201 get valueAsNumber(): number;
202 /**
203 * @internal
204 */
205 _toCloudFormation(): object;
206 resolve(_context: IResolveContext): any;
207}