software.amazon.awscdk.CfnRule Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cdk Show documentation
Show all versions of cdk Show documentation
AWS Cloud Development Kit Core Library
package software.amazon.awscdk;
/**
* The Rules that define template constraints in an AWS Service Catalog portfolio describe when end users can use the template and which values they can specify for parameters that are declared in the AWS CloudFormation template used to create the product they are attempting to use.
*
* 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.
*/
@javax.annotation.Generated(value = "jsii-pacmak/0.10.5 (build 46bc9b0)", date = "2019-05-06T20:49:40.941Z")
@software.amazon.jsii.Jsii(module = software.amazon.awscdk.$Module.class, fqn = "@aws-cdk/cdk.CfnRule")
public class CfnRule extends software.amazon.awscdk.CfnRefElement {
protected CfnRule(final software.amazon.jsii.JsiiObject.InitializationMode mode) {
super(mode);
}
/**
* Creates and adds a rule.
*
* @param scope The parent construct.
* @param props The rule props.
*/
public CfnRule(final software.amazon.awscdk.Construct scope, final java.lang.String id, @javax.annotation.Nullable final software.amazon.awscdk.CfnRuleProps props) {
super(software.amazon.jsii.JsiiObject.InitializationMode.Jsii);
software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(scope, "scope is required"), java.util.Objects.requireNonNull(id, "id is required"), props });
}
/**
* Creates and adds a rule.
*
* @param scope The parent construct.
*/
public CfnRule(final software.amazon.awscdk.Construct scope, final java.lang.String id) {
super(software.amazon.jsii.JsiiObject.InitializationMode.Jsii);
software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(scope, "scope is required"), java.util.Objects.requireNonNull(id, "id is required") });
}
/**
* Adds an assertion to the rule.
*
* @param condition The expression to evaluation.
* @param description The description of the assertion.
*/
public void addAssertion(final software.amazon.awscdk.ICfnConditionExpression condition, final java.lang.String description) {
this.jsiiCall("addAssertion", Void.class, new Object[] { java.util.Objects.requireNonNull(condition, "condition is required"), java.util.Objects.requireNonNull(description, "description is required") });
}
/**
* Assertions which define the rule.
*/
@javax.annotation.Nullable
public java.util.List getAssertions() {
return this.jsiiGet("assertions", java.util.List.class);
}
/**
* Assertions which define the rule.
*/
public void setAssertions(@javax.annotation.Nullable final java.util.List value) {
this.jsiiSet("assertions", value);
}
/**
* If the rule condition evaluates to false, the rule doesn't take effect. If the function in the rule condition evaluates to true, expressions in each assert are evaluated and applied.
*/
@javax.annotation.Nullable
public software.amazon.awscdk.ICfnConditionExpression getRuleCondition() {
return this.jsiiGet("ruleCondition", software.amazon.awscdk.ICfnConditionExpression.class);
}
/**
* If the rule condition evaluates to false, the rule doesn't take effect. If the function in the rule condition evaluates to true, expressions in each assert are evaluated and applied.
*/
public void setRuleCondition(@javax.annotation.Nullable final software.amazon.awscdk.ICfnConditionExpression value) {
this.jsiiSet("ruleCondition", value);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy