code: def create_agent_iam_policy(args, *, client):
      policy_stack_name = "buildkite-agent-iam-policy"
      print(
          f"Creating stack {policy_stack_name} for agent IAM policy..."
      )
      with open(
          os.path.join(current_dir, "agent-iam-policy-template.yml"),
          encoding="utf-8",
      ) as f:
          policy_template = f.read()
      promise = create_or_update_stack(
          args,
          client=client,
          stack_name=policy_stack_name,
          template_body=policy_template,
      )
      wait(promise, client=client)
  
      cf = boto3.resource("cloudformation", region_name=args.aws_region)
      policy = cf.StackResource(
          policy_stack_name, "BuildkiteAgentManagedPolicy"
      )
      return policy.physical_resource_id
  
file_path: xgboost/tests/buildkite/infrastructure/aws-stack-creator/create_stack.py
imports: import argparse
  import copy
  import os
  import re
  import sys
  import boto3
  import botocore
  from metadata import AMI_ID, COMMON_STACK_PARAMS, STACK_PARAMS
  from common_blocks.utils import create_or_update_stack, wait
label_desc: Use image node_id 5 for calling a global function with example usage: create_agent_iam_policy(args) and returns: policy