Show / Hide Table of Contents

Class TemplateRule

Defines the provisioning template constraints.

Inheritance
object
TemplateRule
Implements
ITemplateRule
Inherited Members
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: Amazon.CDK.AWS.Servicecatalog
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class TemplateRule : ITemplateRule
Syntax (vb)
Public Class TemplateRule Implements ITemplateRule
Remarks

ExampleMetadata: infused

Examples
using Amazon.CDK;

            Portfolio portfolio;
            CloudFormationProduct product;


            portfolio.ConstrainCloudFormationParameters(product, new CloudFormationRuleConstraintOptions {
                Rule = new TemplateRule {
                    RuleName = "testInstanceType",
                    Condition = Fn.ConditionEquals(Fn.Ref("Environment"), "test"),
                    Assertions = new [] { new TemplateRuleAssertion {
                        Assert = Fn.ConditionContains(new [] { "t2.micro", "t2.small" }, Fn.Ref("InstanceType")),
                        Description = "For test environment, the instance type should be small"
                    } }
                }
            });

Synopsis

Constructors

TemplateRule()

Defines the provisioning template constraints.

Properties

Assertions

A list of assertions that make up the rule.

Condition

Specify when to apply rule with a rule-specific intrinsic function.

RuleName

Name of the rule.

Constructors

TemplateRule()

Defines the provisioning template constraints.

public TemplateRule()
Remarks

ExampleMetadata: infused

Examples
using Amazon.CDK;

            Portfolio portfolio;
            CloudFormationProduct product;


            portfolio.ConstrainCloudFormationParameters(product, new CloudFormationRuleConstraintOptions {
                Rule = new TemplateRule {
                    RuleName = "testInstanceType",
                    Condition = Fn.ConditionEquals(Fn.Ref("Environment"), "test"),
                    Assertions = new [] { new TemplateRuleAssertion {
                        Assert = Fn.ConditionContains(new [] { "t2.micro", "t2.small" }, Fn.Ref("InstanceType")),
                        Description = "For test environment, the instance type should be small"
                    } }
                }
            });

Properties

Assertions

A list of assertions that make up the rule.

public ITemplateRuleAssertion[] Assertions { get; set; }
Property Value

ITemplateRuleAssertion[]

Remarks

ExampleMetadata: infused

Condition

Specify when to apply rule with a rule-specific intrinsic function.

public ICfnRuleConditionExpression? Condition { get; set; }
Property Value

ICfnRuleConditionExpression

Remarks

Default: - no rule condition provided

RuleName

Name of the rule.

public string RuleName { get; set; }
Property Value

string

Remarks

ExampleMetadata: infused

Implements

ITemplateRule
Back to top Generated by DocFX