diff --git a/README.md b/README.md index 865cea6d..58877a71 100644 --- a/README.md +++ b/README.md @@ -128,11 +128,11 @@ Construct an engine and a schema validator once, then validate many templates: ```rust use cloudformation_validate::{ - EngineConfig, RegoEngine, SchemaValidator, ValidateConfig, validate_bytes_with_path, + CompositeEngine, CompositeEngineConfig, SchemaValidator, ValidateConfig, validate_bytes_with_path, }; let schema_validator = SchemaValidator::default(); -let engine = RegoEngine::new(EngineConfig::default())?; +let engine = CompositeEngine::new(CompositeEngineConfig::default())?; let bytes = std::fs::read("template.yaml")?; let report = validate_bytes_with_path( @@ -179,9 +179,9 @@ the content in `TemplateContent`, Python accepts `bytes` or a `TemplateContent`, ### Node.js [(bindings-wasm)](src/bindings-wasm/README.md) ```typescript -import {RegoEngine, TemplateFile} from "@aws/cloudformation-validate"; +import {CompositeEngine, TemplateFile} from "@aws/cloudformation-validate"; -const engine = new RegoEngine(); +const engine = new CompositeEngine(); const report = engine.validateTemplate(new TemplateFile("template.yaml")); for (const d of report.diagnostics) { console.log(`[${d.severity}] ${d.ruleId}: ${d.message}`); @@ -192,9 +192,9 @@ engine.free(); ### Python [(bindings-python)](src/bindings-python/README.md) ```python -from cloudformation_validate import RegoEngine +from cloudformation_validate import CompositeEngine -engine = RegoEngine() +engine = CompositeEngine() report = engine.validate_template("template.yaml") for d in report.diagnostics: print(f"[{d.severity.name}] {d.rule_id}: {d.message}") @@ -205,7 +205,7 @@ for d in report.diagnostics: ```go import cfnvalidate "github.com/aws-cloudformation/cloudformation-validate/src/bindings-go/go" -engine, err := cfnvalidate.NewRegoEngine(nil) +engine, err := cfnvalidate.NewCompositeEngine(nil) if err != nil { log.Fatal(err) } @@ -223,7 +223,7 @@ for _, d := range report.Diagnostics { import software.amazon.cloudformation.validate.* import java.io.File -val engine = RegoEngine() +val engine = CompositeEngine() val report = engine.validateTemplate(File("template.yaml")) for (d in report.diagnostics) { println("[${d.severity}] ${d.ruleId}: ${d.message}") diff --git a/src/bindings-go/README.md b/src/bindings-go/README.md index 1c0181d3..373b9b4f 100644 --- a/src/bindings-go/README.md +++ b/src/bindings-go/README.md @@ -35,7 +35,7 @@ MSVC. Engines, models, and validators hold off-heap memory - call `Destroy()` when done with each object: ```go -engine, err := cfnvalidate.NewRegoEngine(nil) +engine, err := cfnvalidate.NewCompositeEngine(nil) if err != nil { log.Fatal(err) } diff --git a/src/bindings-jvm/README.md b/src/bindings-jvm/README.md index 365bb638..9c7b6cfa 100644 --- a/src/bindings-jvm/README.md +++ b/src/bindings-jvm/README.md @@ -47,10 +47,10 @@ library). ## Quick start ```kotlin -import software.amazon.cloudformation.validate.RegoEngine +import software.amazon.cloudformation.validate.CompositeEngine import java.io.File -val engine = RegoEngine() +val engine = CompositeEngine() val report = engine.validateTemplate(File("template.yaml")) for (d in report.diagnostics) { println("[${d.severity}] ${d.ruleId}: ${d.message}") @@ -352,10 +352,10 @@ constraint the API itself does not enforce - is skipped with a reason, never gue ```kotlin import software.amazon.cloudformation.validate.AwsCliCommand -import software.amazon.cloudformation.validate.RegoEngine +import software.amazon.cloudformation.validate.CompositeEngine import software.amazon.cloudformation.validate.engine.AwsCliCommandValidationStatus -val engine = RegoEngine() +val engine = CompositeEngine() val request = AwsCliCommand("s3", "CreateBucket", mapOf("Bucket" to "example-bucket")) val validation = engine.validateAwsCliCommand(request) if (validation.status == AwsCliCommandValidationStatus.VALIDATED) { diff --git a/src/bindings-python/README.md b/src/bindings-python/README.md index d225a9a2..1cc81607 100644 --- a/src/bindings-python/README.md +++ b/src/bindings-python/README.md @@ -26,9 +26,9 @@ only the artifact compatible with the installing host. ## Quick start ```python -from cloudformation_validate import RegoEngine +from cloudformation_validate import CompositeEngine -engine = RegoEngine() +engine = CompositeEngine() report = engine.validate_template("template.yaml") for d in report.diagnostics: print(f"[{d.severity.name}] {d.rule_id}: {d.message}") @@ -329,9 +329,9 @@ exactly - an unregistered operation, a parameter without a lossless property map CloudFormation constraint the API itself does not enforce - is skipped with a reason, never guessed. ```python -from cloudformation_validate import AwsCliCommand, AwsCliCommandValidationStatus, RegoEngine +from cloudformation_validate import AwsCliCommand, AwsCliCommandValidationStatus, CompositeEngine -engine = RegoEngine() +engine = CompositeEngine() request = AwsCliCommand("s3", "CreateBucket", {"Bucket": "example-bucket"}) validation = engine.validate_aws_cli_command(request) if validation.status == AwsCliCommandValidationStatus.VALIDATED: diff --git a/src/bindings-rust/README.md b/src/bindings-rust/README.md index eae0d077..a65fcc18 100644 --- a/src/bindings-rust/README.md +++ b/src/bindings-rust/README.md @@ -31,10 +31,12 @@ Requires Rust 1.96 or later (the repository pins that toolchain in [`rust-toolch ## Quick start ```rust -use cloudformation_validate::{EngineConfig, RegoEngine, SchemaValidator, ValidateConfig, validate_bytes_with_path}; +use cloudformation_validate::{ + CompositeEngine, CompositeEngineConfig, SchemaValidator, ValidateConfig, validate_bytes_with_path, +}; let schema_validator = SchemaValidator::default(); -let engine = RegoEngine::new(EngineConfig::default())?; +let engine = CompositeEngine::new(CompositeEngineConfig::default())?; let template = std::fs::read("template.yaml").unwrap_or_else(|_| b"Resources: {}\n".to_vec()); let report = validate_bytes_with_path( @@ -231,11 +233,11 @@ defaults - `ValidateConfig::default()` uses them. ```rust,no_run use cloudformation_validate::{ - EngineConfig, FilterConfig, RegoEngine, RuleFilterConfig, SchemaValidator, Severity, ValidateConfig, + CompositeEngine, CompositeEngineConfig, FilterConfig, RuleFilterConfig, SchemaValidator, Severity, ValidateConfig, validate_bytes_with_path, }; -let engine = RegoEngine::new(EngineConfig::default())?; +let engine = CompositeEngine::new(CompositeEngineConfig::default())?; let schema_validator = SchemaValidator::default(); let template = std::fs::read("template.yaml")?; let report = validate_bytes_with_path( @@ -391,9 +393,9 @@ result types live in the `validation_engine` module. use cloudformation_validate::validation_engine::{ AwsCliCommand, AwsCliCommandValidationStatus, AwsCliValue, validate_aws_cli_command, }; -use cloudformation_validate::{EngineConfig, RegoEngine, SchemaValidator}; +use cloudformation_validate::{CompositeEngine, CompositeEngineConfig, SchemaValidator}; -let engine = RegoEngine::new(EngineConfig::default())?; +let engine = CompositeEngine::new(CompositeEngineConfig::default())?; let schema_validator = SchemaValidator::default(); let request = AwsCliCommand::new( "s3", diff --git a/src/bindings-wasm/README.md b/src/bindings-wasm/README.md index bd2acfbc..245d5e2a 100644 --- a/src/bindings-wasm/README.md +++ b/src/bindings-wasm/README.md @@ -26,9 +26,9 @@ Requires Node.js 20 or later. The package has no runtime dependencies. Engines, models, and validators hold off-heap memory - call `.free()` when done with each object: ```typescript -import { RegoEngine, TemplateFile } from "@aws/cloudformation-validate"; +import { CompositeEngine, TemplateFile } from "@aws/cloudformation-validate"; -const engine = new RegoEngine(); +const engine = new CompositeEngine(); try { const report = engine.validateTemplate(new TemplateFile("template.yaml")); for (const d of report.diagnostics) { @@ -346,9 +346,9 @@ an unregistered operation, a parameter without a lossless property mapping, or a constraint the API itself does not enforce - is skipped with a reason, never guessed. ```typescript -import { AwsCliCommand, RegoEngine } from "@aws/cloudformation-validate"; +import { AwsCliCommand, CompositeEngine } from "@aws/cloudformation-validate"; -const engine = new RegoEngine(); +const engine = new CompositeEngine(); try { const request = new AwsCliCommand("s3", "CreateBucket", { Bucket: "example-bucket" }); const validation = engine.validateAwsCliCommand(request);