mirror of
https://github.com/floci-io/floci.git
synced 2026-11-24 22:37:55 -05:00
AuthorizeSnapshotAccess and RevokeSnapshotAccess record the accounts that may restore a manual, available snapshot. The snapshot reports OwnerAccount and AccountsWithRestoreAccess, DescribeClusterSnapshots takes an OwnerAccount filter that lists only what the owner shared with the caller, and RestoreFromClusterSnapshot takes an OwnerAccount (or a SnapshotArn of another account) and restores a shared snapshot from the owner's dump. A snapshot that is not shared is refused with AccessToSnapshotDenied, and the grant does not outlive the snapshot. IAM takes generated data only, so the RestoreFromClusterSnapshot correction is replaced by two rules in regen_iam_request_resources.py. A top-level request member whose name ends in Account gives the account of each type whose botocore structure has that same member: Snapshot has OwnerAccount and Cluster does not, so the snapshot moves to the owner's account and the restored cluster stays the caller's. Of several members that could fill a variable, one naming the type before the variable wins over a bare one, so the snapshot's ClusterName comes from SnapshotClusterIdentifier rather than ClusterIdentifier. Across every operation the rules change only that entry, which also gains DefaultIamRoleArn and RedshiftIdcApplicationArn as ARN rows that never match a cluster or snapshot, and CloudFront's GetInvalidationForDistributionTenant, whose tenant is now filled from DistributionTenantId rather than the invalidation's Id. The handler's SnapshotArn check now resolves the partition through RegionResolver, as the service's Region check does, so a Region outside the known partitions cannot make the two disagree.