mirror of
https://github.com/floci-io/floci.git
synced 2026-11-23 22:11:36 -05:00
Move AWS::IAM::ManagedPolicy, the last IAM type in the monolith, into a new IamManagedPolicyCfnProvisioner over IamService. Ref and Fn::GetAtt PolicyArn return the policy ARN. On UpdateStack with an unchanged name PolicyDocument is applied as a new default version in place, pruning the oldest versions under IAM's five-version cap and detaching roles no longer listed, and a mid-update failure restores the version and attachment state this pass changed. Delete detaches the roles before DeletePolicy, tolerating an already-gone attachment. Stacked on #3971 (inline Policy); merge that first. The move resolves PolicyArn and DefaultVersionId as Fn::GetAtt keys and records the five other read-only attributes (AttachmentCount, CreateDate, UpdateDate, IsAttachable, PermissionsBoundaryUsageCount) as gaps, since leaving LEGACY_SWITCH subjects the type to CfnSchemaCoverageTest. The small managed-policy delete helpers are duplicated with IamPolicyCfnProvisioner's legacy path for now, to be collapsed into a shared helper once both land.