code: def _create_vpc_resources(ec2_client, name):
      vpc_id = ec2_client.create_vpc(CidrBlock="10.0.0.0/16")["Vpc"][
          "VpcId"
      ]
      ec2_client.create_tags(
          Resources=[vpc_id], Tags=[{"Key": "Name", "Value": name}]
      )
  
      availability_zone_name = ec2_client.describe_availability_zones()[
          "AvailabilityZones"
      ][0]["ZoneName"]
  
      subnet_id_a = ec2_client.create_subnet(
          CidrBlock="10.0.0.0/24",
          VpcId=vpc_id,
          AvailabilityZone=availability_zone_name,
      )["Subnet"]["SubnetId"]
      print("created subnet: {}".format(subnet_id_a))
      subnet_id_b = ec2_client.create_subnet(
          CidrBlock="10.0.1.0/24",
          VpcId=vpc_id,
          AvailabilityZone=availability_zone_name,
      )["Subnet"]["SubnetId"]
      print("created subnet: {}".format(subnet_id_b))
  
      s3_service = [
          s
          for s in ec2_client.describe_vpc_endpoint_services()[
              "ServiceNames"
          ]
          if s.endswith("s3")
      ][0]
      ec2_client.create_vpc_endpoint(
          VpcId=vpc_id,
          ServiceName=s3_service,
          RouteTableIds=[_route_table_id(ec2_client, vpc_id)],
      )
      print("created s3 vpc endpoint")
  
      security_group_id = ec2_client.create_security_group(
          VpcId=vpc_id, GroupName=name, Description=name
      )["GroupId"]
      print("created security group: {}".format(security_group_id))
  
      # multi-host vpc jobs require communication among hosts
      ec2_client.authorize_security_group_ingress(
          GroupId=security_group_id,
          IpPermissions=[
              {
                  "IpProtocol": "tcp",
                  "FromPort": 0,
                  "ToPort": 65535,
                  "UserIdGroupPairs": [{"GroupId": security_group_id}],
              }
          ],
      )
  
      ec2_client.create_tags(
          Resources=[subnet_id_a, subnet_id_b, security_group_id],
          Tags=[{"Key": "Name", "Value": name}],
      )
      return vpc_id, [subnet_id_a, subnet_id_b], security_group_id
  
file_path: sagemaker-python-sdk/tests/integ/vpc_test_utils.py
imports: from __future__ import absolute_import
  import os
  import tempfile
  import tests.integ.lock
label_desc: Use image node_id 9 for calling a global function with example usage: _create_vpc_resources(ec2_client, name) and returns: vpc_id,  list,  security_group_id