feat(azure): Chaos Studio experiments (Microsoft.Chaos) - #1256
Merged
Conversation
Add ARM control-plane emulation of Azure Chaos Studio experiments (azurerm_chaos_studio_experiment): CreateOrUpdate/Get/Delete/List/PATCH, explicit top-level identity with stable minted principalId/tenantId, provisioningState=Succeeded, and verbatim raw-JSON round-trip of the nested selectors/steps blocks so IaC sees no drift. Wires resource-graph and discovery (forward + inverse type maps). Control plane only; no fault injection (unrelated to features/chaos); targets/capabilities deferred.
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.
Summary
Adds a greenfield ARM control-plane emulation of Azure Chaos Studio experiments (
Microsoft.Chaos/experiments), the primary parity target for Terraform'sazurerm_chaos_studio_experiment. Control plane only — no faults are injected (this is unrelated to CloudEmu'sfeatures/chaosfault-injection engine).Operations:
CreateOrUpdate(PUT),Get,Delete,List by RG,List by subscription,Update(PATCH). Synchronous completion withprovisioningState=Succeeded. Status codes 201/200/200-then-204/404.Design
typeplus service-mintedprincipalId/tenantIdfor SystemAssigned, and mintedprincipalId/clientIdper UserAssigned id. Minted once from a deterministic seed (idgen.SyntheticGUID), stored, and stable across every GET/PATCH and snapshot/restore.json.RawMessagepassthrough) so the deeply-nestedbranch/actionsblocks — including thetype:"List"andtype:"continuous"discriminators Terraform's typed unmarshal requires — round-trip byte-for-byte and cannot drift. Bare creates default both to a valid[].ServiceChaosStudio/TypeChaosExperiment, plus BOTH forward (microsoft.chaos/experiments->{chaosstudio, Experiment}) and inverse (chaosstudio/Experiment->microsoft.chaos/experiments) type-map entries.E2E (raw ARM against
cloudemu serve, api-version 2023-11-01)provisioningState=Succeeded, identity ids minted, selectors/steps echoed verbatim.where type =~ "microsoft.chaos/experiments"-> 1 row, inverse type emitted correctly.Gates
go build ./..., fullgo vet ./..., gofmt clean, golangci-lint on new packages = 0 issues,go test -raceon new packages, fullgo testofserver/azure/...+providers/azure/...+services/resourcediscovery/...+server/azure/resourcegraph/...(128 pkgs),persist/...incl. completeness, root., andgo generateidempotency — all green.Deferred
The nested
targets/capabilitiesresource types (Microsoft.Chaos/targets, under other resources) are separate resource types and out of scope for this experiments-focused build.