- Python CLI tool for rolling updates of CL-AppPipe-* and CL-SvcPipe-* stacks - Async update engine with configurable concurrency (asyncio.Semaphore) - Exponential backoff retry for API throttling - Dry-run mode for safe preview - IAM permission pre-validation - Comprehensive test suite (80 tests: 11 property-based + 69 unit) - Full spec documentation (requirements, design, tasks)
40 lines
895 B
Python
40 lines
895 B
Python
"""Data models for the CloudFormation Stack Updater."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from dataclasses import dataclass, field
|
|
from datetime import datetime
|
|
from typing import Literal
|
|
|
|
|
|
@dataclass
|
|
class DiscoveredStack:
|
|
"""Represents a CloudFormation stack found during discovery."""
|
|
|
|
name: str
|
|
status: str
|
|
updatable: bool
|
|
|
|
|
|
@dataclass
|
|
class StackUpdateResult:
|
|
"""Result of a single stack update attempt."""
|
|
|
|
stack_name: str
|
|
status: Literal["succeeded", "failed", "skipped", "no-update-needed"]
|
|
error: str | None = None
|
|
duration_seconds: float = 0.0
|
|
|
|
|
|
@dataclass
|
|
class UpdateRunReport:
|
|
"""Summary report for an entire update run."""
|
|
|
|
start_time: datetime
|
|
end_time: datetime
|
|
total_found: int
|
|
succeeded: int
|
|
failed: int
|
|
skipped: int
|
|
no_update_needed: int
|
|
results: list[StackUpdateResult] = field(default_factory=list)
|