text: # coding=utf-8
  # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
  # *** Do not edit by hand unless you're certain you know what you are doing! ***
  
  import warnings
  import pulumi
  import pulumi.runtime
  from typing import Any, Mapping, Optional, Sequence, Union, overload
  from . import _utilities
  from . import outputs
  
  __all__ = [
      'GetConnectionResult',
      'AwaitableGetConnectionResult',
      'get_connection',
  ]
  
  @pulumi.output_type
  class GetConnectionResult:
      """
      A collection of values returned by getConnection.
      """
      def __init__(__self__, connection_id=None, description=None, facility=None, id=None, metro=None, mode=None, name=None, organization_id=None, ports=None, project_id=None, redundancy=None, speed=None, status=None, tags=None, token=None, type=None):
          if connection_id and not isinstance(connection_id, str):
              raise TypeError("Expected argument 'connection_id' to be a str")
          pulumi.set(__self__, "connection_id", connection_id)
          if description and not isinstance(description, str):
              raise TypeError("Expected argument 'description' to be a str")
          pulumi.set(__self__, "description", description)
          if facility and not isinstance(facility, str):
              raise TypeError("Expected argument 'facility' to be a str")
          pulumi.set(__self__, "facility", facility)
          if id and not isinstance(id, str):
              raise TypeError("Expected argument 'id' to be a str")
          pulumi.set(__self__, "id", id)
          if metro and not isinstance(metro, str):
              raise TypeError("Expected argument 'metro' to be a str")
          pulumi.set(__self__, "metro", metro)
          if mode and not isinstance(mode, str):
              raise TypeError("Expected argument 'mode' to be a str")
          pulumi.set(__self__, "mode", mode)
          if name and not isinstance(name, str):
              raise TypeError("Expected argument 'name' to be a str")
          pulumi.set(__self__, "name", name)
          if organization_id and not isinstance(organization_id, str):
              raise TypeError("Expected argument 'organization_id' to be a str")
          pulumi.set(__self__, "organization_id", organization_id)
          if ports and not isinstance(ports, list):
              raise TypeError("Expected argument 'ports' to be a list")
          pulumi.set(__self__, "ports", ports)
          if project_id and not isinstance(project_id, str):
              raise TypeError("Expected argument 'project_id' to be a str")
          pulumi.set(__self__, "project_id", project_id)
          if redundancy and not isinstance(redundancy, str):
              raise TypeError("Expected argument 'redundancy' to be a str")
          pulumi.set(__self__, "redundancy", redundancy)
          if speed and not isinstance(speed, int):
              raise TypeError("Expected argument 'speed' to be a int")
          pulumi.set(__self__, "speed", speed)
          if status and not isinstance(status, str):
              raise TypeError("Expected argument 'status' to be a str")
          pulumi.set(__self__, "status", status)
          if tags and not isinstance(tags, list):
              raise TypeError("Expected argument 'tags' to be a list")
          pulumi.set(__self__, "tags", tags)
          if token and not isinstance(token, str):
              raise TypeError("Expected argument 'token' to be a str")
          pulumi.set(__self__, "token", token)
          if type and not isinstance(type, str):
              raise TypeError("Expected argument 'type' to be a str")
          pulumi.set(__self__, "type", type)
  
      @property
      @pulumi.getter(name="connectionId")
      def connection_id(self) -> str:
          return pulumi.get(self, "connection_id")
  
      @property
      @pulumi.getter
      def description(self) -> str:
          """
          Description of the connection resource
          """
          return pulumi.get(self, "description")
  
      @property
      @pulumi.getter
      def facility(self) -> str:
          """
          Slug of a facility to which the connection belongs
          """
          return pulumi.get(self, "facility")
  
      @property
      @pulumi.getter
      def id(self) -> str:
          """
          The provider-assigned unique ID for this managed resource.
          """
          return pulumi.get(self, "id")
  
      @property
      @pulumi.getter
      def metro(self) -> str:
          """
          Slug of a metro to which the connection belongs
          """
          return pulumi.get(self, "metro")
  
      @property
      @pulumi.getter
      def mode(self) -> str:
          """
          Mode for connections in IBX facilities with the dedicated type - standard or tunnel
          """
          return pulumi.get(self, "mode")
  
      @property
      @pulumi.getter
      def name(self) -> str:
          """
          Port name
          """
          return pulumi.get(self, "name")
  
      @property
      @pulumi.getter(name="organizationId")
      def organization_id(self) -> str:
          """
          ID of organization to which the connection belongs
          """
          return pulumi.get(self, "organization_id")
  
      @property
      @pulumi.getter
      def ports(self) -> Sequence['outputs.GetConnectionPortResult']:
          """
          List of connection ports - primary (`ports[0]`) and secondary (`ports[1]`)
          """
          return pulumi.get(self, "ports")
  
      @property
      @pulumi.getter(name="projectId")
      def project_id(self) -> str:
          """
          ID of project to which the connection belongs
          """
          return pulumi.get(self, "project_id")
  
      @property
      @pulumi.getter
      def redundancy(self) -> str:
          """
          Connection redundancy, reduntant or primary
          """
          return pulumi.get(self, "redundancy")
  
      @property
      @pulumi.getter
      def speed(self) -> int:
          """
          Port speed in bits per second
          """
          return pulumi.get(self, "speed")
  
      @property
      @pulumi.getter
      def status(self) -> str:
          """
          Port status
          """
          return pulumi.get(self, "status")
  
      @property
      @pulumi.getter
      def tags(self) -> Sequence[str]:
          """
          String list of tags
          """
          return pulumi.get(self, "tags")
  
      @property
      @pulumi.getter
      def token(self) -> str:
          """
          Fabric Token for the [Equinix Fabric Portal](https://ecxfabric.equinix.com/dashboard)
          """
          return pulumi.get(self, "token")
  
      @property
      @pulumi.getter
      def type(self) -> str:
          """
          Connection type, dedicated or shared
          """
          return pulumi.get(self, "type")
  
  
  class AwaitableGetConnectionResult(GetConnectionResult):
      # pylint: disable=using-constant-test
      def __await__(self):
          if False:
              yield self
          return GetConnectionResult(
              connection_id=self.connection_id,
              description=self.description,
              facility=self.facility,
              id=self.id,
              metro=self.metro,
              mode=self.mode,
              name=self.name,
              organization_id=self.organization_id,
              ports=self.ports,
              project_id=self.project_id,
              redundancy=self.redundancy,
              speed=self.speed,
              status=self.status,
              tags=self.tags,
              token=self.token,
              type=self.type)
  
  
  def get_connection(connection_id: Optional[str] = None,
                     opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetConnectionResult:
      """
      Use this data source to retrieve a connection resource from [Equinix Fabric - software-defined interconnections](https://metal.equinix.com/developers/docs/networking/fabric/)
  
      ## Example Usage
  
      ```python
      import pulumi
      import pulumi_equinix_metal as equinix_metal
  
      example = equinix_metal.get_connection(connection_id="4347e805-eb46-4699-9eb9-5c116e6a017d")
      ```
  
  
      :param str connection_id: ID of the connection resource
      """
      __args__ = dict()
      __args__['connectionId'] = connection_id
      if opts is None:
          opts = pulumi.InvokeOptions()
      if opts.version is None:
          opts.version = _utilities.get_version()
      __ret__ = pulumi.runtime.invoke('equinix-metal:index/getConnection:getConnection', __args__, opts=opts, typ=GetConnectionResult).value
  
      return AwaitableGetConnectionResult(
          connection_id=__ret__.connection_id,
          description=__ret__.description,
          facility=__ret__.facility,
          id=__ret__.id,
          metro=__ret__.metro,
          mode=__ret__.mode,
          name=__ret__.name,
          organization_id=__ret__.organization_id,
          ports=__ret__.ports,
          project_id=__ret__.project_id,
          redundancy=__ret__.redundancy,
          speed=__ret__.speed,
          status=__ret__.status,
          tags=__ret__.tags,
          token=__ret__.token,
          type=__ret__.type)
  