1 | import { Construct } from 'constructs';
|
2 | import { CfnElement } from './cfn-element';
|
3 | import { IResolvable, IResolveContext } from './resolvable';
|
4 | export interface CfnConditionProps {
|
5 | |
6 |
|
7 |
|
8 |
|
9 |
|
10 | readonly expression?: ICfnConditionExpression;
|
11 | }
|
12 |
|
13 |
|
14 |
|
15 |
|
16 | export declare class CfnCondition extends CfnElement implements ICfnConditionExpression, IResolvable {
|
17 | |
18 |
|
19 |
|
20 | expression?: ICfnConditionExpression;
|
21 | |
22 |
|
23 |
|
24 |
|
25 | constructor(scope: Construct, id: string, props?: CfnConditionProps);
|
26 | /**
|
27 | * @internal
|
28 | */
|
29 | _toCloudFormation(): object;
|
30 | /**
|
31 | * Synthesizes the condition.
|
32 | */
|
33 | resolve(_context: IResolveContext): any;
|
34 | }
|
35 | /**
|
36 | * Represents a CloudFormation element that can be used within a Condition.
|
37 | *
|
38 | * You can use intrinsic functions, such as ``Fn.conditionIf``,
|
39 | * ``Fn.conditionEquals``, and ``Fn.conditionNot``, to conditionally create
|
40 | * stack resources. These conditions are evaluated based on input parameters
|
41 | * that you declare when you create or update a stack. After you define all your
|
42 | * conditions, you can associate them with resources or resource properties in
|
43 | * the Resources and Outputs sections of a template.
|
44 | *
|
45 | * You define all conditions in the Conditions section of a template except for
|
46 | * ``Fn.conditionIf`` conditions. You can use the ``Fn.conditionIf`` condition
|
47 | * in the metadata attribute, update policy attribute, and property values in
|
48 | * the Resources section and Outputs sections of a template.
|
49 | *
|
50 | * You might use conditions when you want to reuse a template that can create
|
51 | * resources in different contexts, such as a test environment versus a
|
52 | * production environment. In your template, you can add an EnvironmentType
|
53 | * input parameter, which accepts either prod or test as inputs. For the
|
54 | * production environment, you might include Amazon EC2 instances with certain
|
55 | * capabilities; however, for the test environment, you want to use less
|
56 | * capabilities to save costs. With conditions, you can define which resources
|
57 | * are created and how they're configured for each environment type.
|
58 | *
|
59 | * You can use `toString` when you wish to embed a condition expression
|
60 | * in a property value that accepts a `string`. For example:
|
61 | *
|
62 | * ```ts
|
63 | * new sqs.Queue(this, 'MyQueue', {
|
64 | * queueName: Fn.conditionIf('Condition', 'Hello', 'World').toString()
|
65 | * });
|
66 | * ```
|
67 | */
|
68 | export interface ICfnConditionExpression extends IResolvable {
|
69 | }
|
70 |
|
71 |
|
72 |
|
73 |
|
74 | export interface ICfnRuleConditionExpression extends ICfnConditionExpression {
|
75 | |
76 |
|
77 |
|
78 |
|
79 | readonly disambiguator: boolean;
|
80 | }
|