def CopyEBSSnapshotToS3SetUp(
    aws_account: account.AWSAccount,
    instance_profile_name: str) -> Dict[str, Dict[str, Any]]:
  """Set up for CopyEBSSnapshotToS3. Creates the IAM components required, or
  returns the existing ones if they exist already.

  Args:
    aws_account (account.AWSAccount): An AWS account object.
    instance_profile_name (str): name of the instance profile to create.

  Returns: A Dict containing:
    'profile':
      'arn': The ARN of the profile.
      'created': True if the profile was created; False if it existed already.
    'policy':
      'arn': The ARN of the policy.
      'created': True if the policy was created; False if it existed already.
    'role':
      'name': The name of the role.
      'created': True if the role was created; False if it existed already.

  Raises:
    ResourceCreationError: If any IAM resource could not be created.
  """

  # Create the IAM pieces
  ebs_copy_policy_doc = iam.ReadPolicyDoc(iam.EBS_COPY_POLICY_DOC)
  ec2_assume_role_doc = iam.ReadPolicyDoc(iam.EC2_ASSUME_ROLE_POLICY_DOC)

  policy_name = '{0:s}-policy'.format(instance_profile_name)
  role_name = '{0:s}-role'.format(instance_profile_name)

  instance_profile_arn, prof_created = aws_account.iam.CreateInstanceProfile(
    instance_profile_name)
  policy_arn, pol_created = aws_account.iam.CreatePolicy(
    policy_name, ebs_copy_policy_doc)
  _, role_created = aws_account.iam.CreateRole(
    role_name, ec2_assume_role_doc)
  aws_account.iam.AttachPolicyToRole(
    policy_arn, role_name)
  aws_account.iam.AttachInstanceProfileToRole(
    instance_profile_name, role_name)

  return {
    'profile': {'arn': instance_profile_arn, 'created': prof_created},
    'policy': {'arn': policy_arn, 'created': pol_created},
    'role': {'name': role_name, 'created': role_created}
  }
Set up for CopyEBSSnapshotToS3. Creates the IAM components required, or
returns the existing ones if they exist already.

Args:
aws_account (account.AWSAccount): An AWS account object.
instance_profile_name (str): name of the instance profile to create.

Returns: A Dict containing:
'profile':
'arn': The ARN of the profile.
'created': True if the profile was created; False if it existed already.
'policy':
'arn': The ARN of the policy.
'created': True if the policy was created; False if it existed already.
'role':
'name': The name of the role.
'created': True if the role was created; False if it existed already.

Raises:
ResourceCreationError: If any IAM resource could not be created.
libcloudforensics/providers/aws/forensics.py