@Generated(value="jsii-pacmak/1.30.0 (build adae23f)", date="2021-06-30T10:00:42.435Z") @Stability(value=Experimental) public class CfnRule extends CfnRefElement
Rules are useful for preventing end users from inadvertently specifying an incorrect value. For example, you can add a rule to verify whether end users specified a valid subnet in a given VPC or used m1.small instance types for test environments. AWS CloudFormation uses rules to validate parameter values before it creates the resources for the product.
A rule can include a RuleCondition property and must include an Assertions property. For each rule, you can define only one rule condition; you can define one or more asserts within the Assertions property. You define a rule condition and assertions by using rule-specific intrinsic functions.
| Modifier and Type | Class and Description |
|---|---|
static class |
CfnRule.Builder
(experimental) A fluent builder for
CfnRule. |
| Modifier | Constructor and Description |
|---|---|
|
CfnRule(software.constructs.Construct scope,
String id)
(experimental) Creates and adds a rule.
|
|
CfnRule(software.constructs.Construct scope,
String id,
CfnRuleProps props)
(experimental) Creates and adds a rule.
|
protected |
CfnRule(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnRule(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
void |
addAssertion(ICfnConditionExpression condition,
String description)
(experimental) Adds an assertion to the rule.
|
getRefgetCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdjsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetprotected CfnRule(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnRule(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Experimental)
public CfnRule(@NotNull
software.constructs.Construct scope,
@NotNull
String id,
@Nullable
CfnRuleProps props)
scope - The parent construct. This parameter is required.id - This parameter is required.props - The rule props.@Stability(value=Experimental)
public CfnRule(@NotNull
software.constructs.Construct scope,
@NotNull
String id)
scope - The parent construct. This parameter is required.id - This parameter is required.@Stability(value=Experimental)
public void addAssertion(@NotNull
ICfnConditionExpression condition,
@NotNull
String description)
condition - The expression to evaluation. This parameter is required.description - The description of the assertion. This parameter is required.Copyright © 2021. All rights reserved.