CloudFormationRuleConstraintOptions

class aws_cdk.aws_servicecatalog.CloudFormationRuleConstraintOptions(*, description=None, message_language=None, rule)

Bases: CommonConstraintOptions

Properties for provisoning rule constraint.

Parameters:
  • description (Optional[str]) – The description of the constraint. Default: - No description provided

  • message_language (Optional[MessageLanguage]) – The language code. Configures the language for error messages from service catalog. Default: - English

  • rule (Union[TemplateRule, Dict[str, Any]]) – The rule with condition and assertions to apply to template.

ExampleMetadata:

infused

Example:

import aws_cdk as cdk

# portfolio: servicecatalog.Portfolio
# product: servicecatalog.CloudFormationProduct


portfolio.constrain_cloud_formation_parameters(product,
    rule=servicecatalog.TemplateRule(
        rule_name="testInstanceType",
        condition=Fn.condition_equals(Fn.ref("Environment"), "test"),
        assertions=[servicecatalog.TemplateRuleAssertion(
            assert=Fn.condition_contains(["t2.micro", "t2.small"], Fn.ref("InstanceType")),
            description="For test environment, the instance type should be small"
        )]
    )
)

Attributes

description

The description of the constraint.

Default:
  • No description provided

message_language

The language code.

Configures the language for error messages from service catalog.

Default:
  • English

rule

The rule with condition and assertions to apply to template.