Skip to content

ec2: render CreateLaunchTemplate's warning/ValidationWarning element #693

Closed

Description

@scttfrdmn

Noted as the hook point in #671, which decided that CreateLaunchTemplate does not refuse an invalid block device mapping.

CreateLaunchTemplate's response carries a warning member — element name warning, not validationWarnings — of type ValidationWarning, holding a list of ValidationError (code plus message). AWS documents it as existing precisely for "parameters or parameter combinations that are not valid", and CreateLaunchTemplate's Errors section lists none for an invalid mapping. Substrate never renders the element, so a template carrying a mapping RunInstances will refuse is accepted silently, and the caller learns of it only at launch.

That an invalid block device mapping lands in warning rather than a 400 is substrate's reading, recorded as such in #671 and in docs/services.md; rendering the element is what makes the reading useful rather than merely stated.

Acceptance criteria

  • The response renders warning with AWS's exact element and member names, verified against the API reference, and the element is absent when there is nothing to warn about.
  • CreateLaunchTemplateVersion is covered too if AWS documents the member there.
  • The warnings are produced by the same ec2CheckBlockDeviceMappings ec2: an invalid block device mapping is accepted instead of refused with InvalidBlockDeviceMapping #671 added, so a template warns about exactly what a launch refuses — the parse at emulator/ec2_plugin.go:4463 is already followed by ec2CheckTemplateTags, which is the placement precedent.
  • A test asserts that the template is still created and that RunInstances from it is still refused.
  • The code values are stated as substrate's own if AWS documents none.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: ec2type: feature

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions