github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/glue/getConnection.go (about)

     1  // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
     2  // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
     3  
     4  package glue
     5  
     6  import (
     7  	"context"
     8  	"reflect"
     9  
    10  	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
    11  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    12  )
    13  
    14  // This data source can be used to fetch information about a specific Glue Connection.
    15  //
    16  // ## Example Usage
    17  //
    18  // <!--Start PulumiCodeChooser -->
    19  // ```go
    20  // package main
    21  //
    22  // import (
    23  //
    24  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/glue"
    25  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    26  //
    27  // )
    28  //
    29  //	func main() {
    30  //		pulumi.Run(func(ctx *pulumi.Context) error {
    31  //			_, err := glue.LookupConnection(ctx, &glue.LookupConnectionArgs{
    32  //				Id: "123456789123:connection",
    33  //			}, nil)
    34  //			if err != nil {
    35  //				return err
    36  //			}
    37  //			return nil
    38  //		})
    39  //	}
    40  //
    41  // ```
    42  // <!--End PulumiCodeChooser -->
    43  func LookupConnection(ctx *pulumi.Context, args *LookupConnectionArgs, opts ...pulumi.InvokeOption) (*LookupConnectionResult, error) {
    44  	opts = internal.PkgInvokeDefaultOpts(opts)
    45  	var rv LookupConnectionResult
    46  	err := ctx.Invoke("aws:glue/getConnection:getConnection", args, &rv, opts...)
    47  	if err != nil {
    48  		return nil, err
    49  	}
    50  	return &rv, nil
    51  }
    52  
    53  // A collection of arguments for invoking getConnection.
    54  type LookupConnectionArgs struct {
    55  	// Concatenation of the catalog ID and connection name. For example, if your account ID is
    56  	// `123456789123` and the connection name is `conn` then the ID is `123456789123:conn`.
    57  	Id string `pulumi:"id"`
    58  	// Tags assigned to the resource
    59  	Tags map[string]string `pulumi:"tags"`
    60  }
    61  
    62  // A collection of values returned by getConnection.
    63  type LookupConnectionResult struct {
    64  	// ARN of the Glue Connection.
    65  	Arn string `pulumi:"arn"`
    66  	// Catalog ID of the Glue Connection.
    67  	CatalogId            string            `pulumi:"catalogId"`
    68  	ConnectionProperties map[string]string `pulumi:"connectionProperties"`
    69  	// Type of Glue Connection.
    70  	ConnectionType string `pulumi:"connectionType"`
    71  	// Description of the connection.
    72  	Description string `pulumi:"description"`
    73  	Id          string `pulumi:"id"`
    74  	// A list of criteria that can be used in selecting this connection.
    75  	MatchCriterias []string `pulumi:"matchCriterias"`
    76  	// Name of the Glue Connection.
    77  	Name string `pulumi:"name"`
    78  	// A map of physical connection requirements, such as VPC and SecurityGroup.
    79  	PhysicalConnectionRequirements []GetConnectionPhysicalConnectionRequirement `pulumi:"physicalConnectionRequirements"`
    80  	// Tags assigned to the resource
    81  	Tags map[string]string `pulumi:"tags"`
    82  }
    83  
    84  func LookupConnectionOutput(ctx *pulumi.Context, args LookupConnectionOutputArgs, opts ...pulumi.InvokeOption) LookupConnectionResultOutput {
    85  	return pulumi.ToOutputWithContext(context.Background(), args).
    86  		ApplyT(func(v interface{}) (LookupConnectionResult, error) {
    87  			args := v.(LookupConnectionArgs)
    88  			r, err := LookupConnection(ctx, &args, opts...)
    89  			var s LookupConnectionResult
    90  			if r != nil {
    91  				s = *r
    92  			}
    93  			return s, err
    94  		}).(LookupConnectionResultOutput)
    95  }
    96  
    97  // A collection of arguments for invoking getConnection.
    98  type LookupConnectionOutputArgs struct {
    99  	// Concatenation of the catalog ID and connection name. For example, if your account ID is
   100  	// `123456789123` and the connection name is `conn` then the ID is `123456789123:conn`.
   101  	Id pulumi.StringInput `pulumi:"id"`
   102  	// Tags assigned to the resource
   103  	Tags pulumi.StringMapInput `pulumi:"tags"`
   104  }
   105  
   106  func (LookupConnectionOutputArgs) ElementType() reflect.Type {
   107  	return reflect.TypeOf((*LookupConnectionArgs)(nil)).Elem()
   108  }
   109  
   110  // A collection of values returned by getConnection.
   111  type LookupConnectionResultOutput struct{ *pulumi.OutputState }
   112  
   113  func (LookupConnectionResultOutput) ElementType() reflect.Type {
   114  	return reflect.TypeOf((*LookupConnectionResult)(nil)).Elem()
   115  }
   116  
   117  func (o LookupConnectionResultOutput) ToLookupConnectionResultOutput() LookupConnectionResultOutput {
   118  	return o
   119  }
   120  
   121  func (o LookupConnectionResultOutput) ToLookupConnectionResultOutputWithContext(ctx context.Context) LookupConnectionResultOutput {
   122  	return o
   123  }
   124  
   125  // ARN of the Glue Connection.
   126  func (o LookupConnectionResultOutput) Arn() pulumi.StringOutput {
   127  	return o.ApplyT(func(v LookupConnectionResult) string { return v.Arn }).(pulumi.StringOutput)
   128  }
   129  
   130  // Catalog ID of the Glue Connection.
   131  func (o LookupConnectionResultOutput) CatalogId() pulumi.StringOutput {
   132  	return o.ApplyT(func(v LookupConnectionResult) string { return v.CatalogId }).(pulumi.StringOutput)
   133  }
   134  
   135  func (o LookupConnectionResultOutput) ConnectionProperties() pulumi.StringMapOutput {
   136  	return o.ApplyT(func(v LookupConnectionResult) map[string]string { return v.ConnectionProperties }).(pulumi.StringMapOutput)
   137  }
   138  
   139  // Type of Glue Connection.
   140  func (o LookupConnectionResultOutput) ConnectionType() pulumi.StringOutput {
   141  	return o.ApplyT(func(v LookupConnectionResult) string { return v.ConnectionType }).(pulumi.StringOutput)
   142  }
   143  
   144  // Description of the connection.
   145  func (o LookupConnectionResultOutput) Description() pulumi.StringOutput {
   146  	return o.ApplyT(func(v LookupConnectionResult) string { return v.Description }).(pulumi.StringOutput)
   147  }
   148  
   149  func (o LookupConnectionResultOutput) Id() pulumi.StringOutput {
   150  	return o.ApplyT(func(v LookupConnectionResult) string { return v.Id }).(pulumi.StringOutput)
   151  }
   152  
   153  // A list of criteria that can be used in selecting this connection.
   154  func (o LookupConnectionResultOutput) MatchCriterias() pulumi.StringArrayOutput {
   155  	return o.ApplyT(func(v LookupConnectionResult) []string { return v.MatchCriterias }).(pulumi.StringArrayOutput)
   156  }
   157  
   158  // Name of the Glue Connection.
   159  func (o LookupConnectionResultOutput) Name() pulumi.StringOutput {
   160  	return o.ApplyT(func(v LookupConnectionResult) string { return v.Name }).(pulumi.StringOutput)
   161  }
   162  
   163  // A map of physical connection requirements, such as VPC and SecurityGroup.
   164  func (o LookupConnectionResultOutput) PhysicalConnectionRequirements() GetConnectionPhysicalConnectionRequirementArrayOutput {
   165  	return o.ApplyT(func(v LookupConnectionResult) []GetConnectionPhysicalConnectionRequirement {
   166  		return v.PhysicalConnectionRequirements
   167  	}).(GetConnectionPhysicalConnectionRequirementArrayOutput)
   168  }
   169  
   170  // Tags assigned to the resource
   171  func (o LookupConnectionResultOutput) Tags() pulumi.StringMapOutput {
   172  	return o.ApplyT(func(v LookupConnectionResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput)
   173  }
   174  
   175  func init() {
   176  	pulumi.RegisterOutputType(LookupConnectionResultOutput{})
   177  }