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.core as cdk

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


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

Attributes

description

The description of the constraint.

Default
  • No description provided

Return type

Optional[str]

message_language

The language code.

Configures the language for error messages from service catalog.

Default
  • English

Return type

Optional[MessageLanguage]

rule

The rule with condition and assertions to apply to template.

Return type

TemplateRule