aws-cdk-lib.aws_servicecatalog.TemplateRule

interface TemplateRule

LanguageType name
.NETAmazon.CDK.AWS.Servicecatalog.TemplateRule
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsservicecatalog#TemplateRule
Javasoftware.amazon.awscdk.services.servicecatalog.TemplateRule
Pythonaws_cdk.aws_servicecatalog.TemplateRule
TypeScript (source)aws-cdk-lib » aws_servicecatalog » TemplateRule

Defines the provisioning template constraints.

Example

import * as cdk from 'aws-cdk-lib';

declare const portfolio: servicecatalog.Portfolio;
declare const product: servicecatalog.CloudFormationProduct;

portfolio.constrainCloudFormationParameters(product, {
  rule: {
    ruleName: 'testInstanceType',
    condition: Fn.conditionEquals(Fn.ref('Environment'), 'test'),
    assertions: [{
      assert: Fn.conditionContains(['t2.micro', 't2.small'], Fn.ref('InstanceType')),
      description: 'For test environment, the instance type should be small',
    }],
  },
});

Properties

NameTypeDescription
assertionsTemplateRuleAssertion[]A list of assertions that make up the rule.
ruleNamestringName of the rule.
condition?ICfnRuleConditionExpressionSpecify when to apply rule with a rule-specific intrinsic function.

assertions

Type: TemplateRuleAssertion[]

A list of assertions that make up the rule.


ruleName

Type: string

Name of the rule.


condition?

Type: ICfnRuleConditionExpression (optional, default: no rule condition provided)

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