Validate aws-cli CloudFormation commands - #310
Merged
Merged
Conversation
aws-cli API calls
aws-cli API callsaws-cli CloudFormation commands
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of changes:
Adds offline validation of AWS CLI (botocore) API calls by modeling them as CloudFormation resource state, exposed as
validate_aws_cli_commandinvalidation-engineand asvalidateAwsCliCommand/validate_aws_cli_command/ValidateAwsCliCommandin the JVM, Node.js (WASM), Python, and Go bindings.What it does
Given a botocore service name, operation name, and the request parameters the CLI is about to send, the engine returns an
AwsCliCommandValidationwith an operation kind, aVALIDATEDorSKIPPEDstatus, the template source, the CloudFormation resource type(s) involved, a human-readable reason, the exact template bytes that were validated, and — when validated — aSTANDARD-levelValidationReport.TemplateBody(CreateStack,UpdateStack,CreateChangeSet,ValidateTemplate, …) validate the caller's template bytes unchanged.TemplateURLis skipped (offline).CreateResourcewraps the exactDesiredStateas a single resource ofTypeName.(service, operation)to one CloudFormation resource type with explicit parameter → property pairs. A one-resource template is synthesized and validated through the normal pipeline; diagnostics are scoped to the properties the call actually set, and template-authoring advice (use a parameter /Ref/ dynamic reference) is dropped because there is no template author.READ_ONLY,DATA_PLANE_MUTATION,UNMAPPED_MUTATION) and skipped. Delete adapters classify but never synthesize.Deterministic, no false positives
Modeling is never guessed. A command is validated only when every supplied parameter is accounted for, and any doubt results in
SKIPPEDwith a reason naming the parameter:(service, operation)keys resolve; there is no name-based inference of resource types.DryRun, the primary identifier on updates). Only scalars, arrays of scalars, and string-mapTags→Key/Valuearrays are mapped; nested structures are never rewritten.unrepresentable: enum members, numeric bounds, string lengths, list sizes, tag key/value lengths, and — when the botocore and CloudFormation regexes differ — the pattern pair, settled per value: a value the API pattern accepts and the CloudFormation pattern rejects skips synthesis). Same-named inputs whose meaning differs from the property (an API resource ID where CloudFormation wants the ARN) are excluded by a reviewed denylist.