| 797 | return cls(s3control_client, sts_client) |
| 798 | |
| 799 | def resolve_underlying_s3_paths(self, path): |
| 800 | bucket, key = split_s3_bucket_key(path) |
| 801 | match = self._S3_ACCESSPOINT_ARN_TO_ACCOUNT_NAME_REGEX.match(bucket) |
| 802 | if match: |
| 803 | return self._resolve_accesspoint_arn( |
| 804 | match.group('account'), match.group('name'), key |
| 805 | ) |
| 806 | match = self._S3_OUTPOST_ACCESSPOINT_ARN_TO_ACCOUNT_REGEX.match(bucket) |
| 807 | if match: |
| 808 | return self._resolve_accesspoint_arn( |
| 809 | match.group('account'), bucket, key |
| 810 | ) |
| 811 | match = self._S3_MRAP_ARN_TO_ACCOUNT_ALIAS_REGEX.match(bucket) |
| 812 | if match: |
| 813 | return self._resolve_mrap_alias( |
| 814 | match.group('account'), match.group('alias'), key |
| 815 | ) |
| 816 | if bucket.endswith('-s3alias'): |
| 817 | return self._resolve_accesspoint_alias(bucket, key) |
| 818 | if bucket.endswith('--op-s3'): |
| 819 | raise ParamValidationError( |
| 820 | "Can't resolve underlying bucket name of s3 outposts " |
| 821 | "access point alias. Use arn instead to resolve the " |
| 822 | "bucket name and validate the mv command." |
| 823 | ) |
| 824 | return [path] |
| 825 | |
| 826 | def _resolve_accesspoint_arn(self, account, name, key): |
| 827 | bucket = self._get_access_point_bucket(account, name) |