class CloudFormationValidatePlugin
| Language | Type name |
|---|---|
.NET | Amazon.CDK.CloudFormationValidatePlugin |
Go | github.com/aws/aws-cdk-go/awscdk/v2#CloudFormationValidatePlugin |
Java | software.amazon.awscdk.CloudFormationValidatePlugin |
Python | aws_cdk.CloudFormationValidatePlugin |
TypeScript (source) | aws-cdk-lib » CloudFormationValidatePlugin |
Implements
IPolicy
Validation plugin that uses the CloudFormation validation engine to evaluate templates against built-in rules.
Example
const app = new App();
// Rules text, read from disk perhaps
declare const myRules: string;
Validations.of(app).addPlugins(new CloudFormationValidatePlugin({
guardRules: [{
name: 'My rules',
content: myRules,
}],
}));
Initializer
new CloudFormationValidatePlugin(props?: CloudFormationValidatePluginProps)
Parameters
Properties
| Name | Type | Description |
|---|---|---|
| name | string | The name of the plugin that will be displayed in the validation report. |
| rule | string[] | The list of rule IDs that the plugin will evaluate. |
| version? | string | The version of the plugin, following the Semantic Versioning specification (see https://semver.org/). This version is used for analytics purposes, to measure the usage of different plugins and different versions. The value of this property should be kept in sync with the actual version of the software package. If the version is not provided or is not a valid semantic version, it will be reported as 0.0.0. |
| static PLUGIN_NAME | string | The default name of this plugin. |
name
Type:
string
The name of the plugin that will be displayed in the validation report.
ruleIds?
Type:
string[]
(optional)
The list of rule IDs that the plugin will evaluate.
Used for analytics purposes.
version?
Type:
string
(optional)
The version of the plugin, following the Semantic Versioning specification (see https://semver.org/). This version is used for analytics purposes, to measure the usage of different plugins and different versions. The value of this property should be kept in sync with the actual version of the software package. If the version is not provided or is not a valid semantic version, it will be reported as 0.0.0.
static PLUGIN_NAME
Type:
string
The default name of this plugin.
Methods
| Name | Description |
|---|---|
| validate(context) | The method that will be called by the CDK framework to perform validations. |
validate(context)
public validate(context: IPolicyValidationContext): PolicyValidationPluginReport
Parameters
- context
IPolicyValidation Context
Returns
The method that will be called by the CDK framework to perform validations.
This is where the plugin will evaluate the CloudFormation templates for compliance and report and violations

.NET
Go
Java
Python
TypeScript (