github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/vpclattice/getServiceNetwork.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 vpclattice
     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  // Data source for managing an AWS VPC Lattice Service Network.
    15  //
    16  // ## Example Usage
    17  //
    18  // ### Basic Usage
    19  //
    20  // <!--Start PulumiCodeChooser -->
    21  // ```go
    22  // package main
    23  //
    24  // import (
    25  //
    26  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/vpclattice"
    27  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    28  //
    29  // )
    30  //
    31  //	func main() {
    32  //		pulumi.Run(func(ctx *pulumi.Context) error {
    33  //			_, err := vpclattice.LookupServiceNetwork(ctx, &vpclattice.LookupServiceNetworkArgs{
    34  //				ServiceNetworkIdentifier: "snsa-01112223334445556",
    35  //			}, nil)
    36  //			if err != nil {
    37  //				return err
    38  //			}
    39  //			return nil
    40  //		})
    41  //	}
    42  //
    43  // ```
    44  // <!--End PulumiCodeChooser -->
    45  func LookupServiceNetwork(ctx *pulumi.Context, args *LookupServiceNetworkArgs, opts ...pulumi.InvokeOption) (*LookupServiceNetworkResult, error) {
    46  	opts = internal.PkgInvokeDefaultOpts(opts)
    47  	var rv LookupServiceNetworkResult
    48  	err := ctx.Invoke("aws:vpclattice/getServiceNetwork:getServiceNetwork", args, &rv, opts...)
    49  	if err != nil {
    50  		return nil, err
    51  	}
    52  	return &rv, nil
    53  }
    54  
    55  // A collection of arguments for invoking getServiceNetwork.
    56  type LookupServiceNetworkArgs struct {
    57  	// Identifier of the service network.
    58  	ServiceNetworkIdentifier string            `pulumi:"serviceNetworkIdentifier"`
    59  	Tags                     map[string]string `pulumi:"tags"`
    60  }
    61  
    62  // A collection of values returned by getServiceNetwork.
    63  type LookupServiceNetworkResult struct {
    64  	// ARN of the Service Network.
    65  	Arn string `pulumi:"arn"`
    66  	// Authentication type for the service network. Either `NONE` or `AWS_IAM`.
    67  	AuthType string `pulumi:"authType"`
    68  	// Date and time the service network was created.
    69  	CreatedAt string `pulumi:"createdAt"`
    70  	// The provider-assigned unique ID for this managed resource.
    71  	Id string `pulumi:"id"`
    72  	// Date and time the service network was last updated.
    73  	LastUpdatedAt string `pulumi:"lastUpdatedAt"`
    74  	// Name of the service network.
    75  	Name string `pulumi:"name"`
    76  	// Number of services associated with this service network.
    77  	NumberOfAssociatedServices int `pulumi:"numberOfAssociatedServices"`
    78  	// Number of VPCs associated with this service network.
    79  	NumberOfAssociatedVpcs   int               `pulumi:"numberOfAssociatedVpcs"`
    80  	ServiceNetworkIdentifier string            `pulumi:"serviceNetworkIdentifier"`
    81  	Tags                     map[string]string `pulumi:"tags"`
    82  }
    83  
    84  func LookupServiceNetworkOutput(ctx *pulumi.Context, args LookupServiceNetworkOutputArgs, opts ...pulumi.InvokeOption) LookupServiceNetworkResultOutput {
    85  	return pulumi.ToOutputWithContext(context.Background(), args).
    86  		ApplyT(func(v interface{}) (LookupServiceNetworkResult, error) {
    87  			args := v.(LookupServiceNetworkArgs)
    88  			r, err := LookupServiceNetwork(ctx, &args, opts...)
    89  			var s LookupServiceNetworkResult
    90  			if r != nil {
    91  				s = *r
    92  			}
    93  			return s, err
    94  		}).(LookupServiceNetworkResultOutput)
    95  }
    96  
    97  // A collection of arguments for invoking getServiceNetwork.
    98  type LookupServiceNetworkOutputArgs struct {
    99  	// Identifier of the service network.
   100  	ServiceNetworkIdentifier pulumi.StringInput    `pulumi:"serviceNetworkIdentifier"`
   101  	Tags                     pulumi.StringMapInput `pulumi:"tags"`
   102  }
   103  
   104  func (LookupServiceNetworkOutputArgs) ElementType() reflect.Type {
   105  	return reflect.TypeOf((*LookupServiceNetworkArgs)(nil)).Elem()
   106  }
   107  
   108  // A collection of values returned by getServiceNetwork.
   109  type LookupServiceNetworkResultOutput struct{ *pulumi.OutputState }
   110  
   111  func (LookupServiceNetworkResultOutput) ElementType() reflect.Type {
   112  	return reflect.TypeOf((*LookupServiceNetworkResult)(nil)).Elem()
   113  }
   114  
   115  func (o LookupServiceNetworkResultOutput) ToLookupServiceNetworkResultOutput() LookupServiceNetworkResultOutput {
   116  	return o
   117  }
   118  
   119  func (o LookupServiceNetworkResultOutput) ToLookupServiceNetworkResultOutputWithContext(ctx context.Context) LookupServiceNetworkResultOutput {
   120  	return o
   121  }
   122  
   123  // ARN of the Service Network.
   124  func (o LookupServiceNetworkResultOutput) Arn() pulumi.StringOutput {
   125  	return o.ApplyT(func(v LookupServiceNetworkResult) string { return v.Arn }).(pulumi.StringOutput)
   126  }
   127  
   128  // Authentication type for the service network. Either `NONE` or `AWS_IAM`.
   129  func (o LookupServiceNetworkResultOutput) AuthType() pulumi.StringOutput {
   130  	return o.ApplyT(func(v LookupServiceNetworkResult) string { return v.AuthType }).(pulumi.StringOutput)
   131  }
   132  
   133  // Date and time the service network was created.
   134  func (o LookupServiceNetworkResultOutput) CreatedAt() pulumi.StringOutput {
   135  	return o.ApplyT(func(v LookupServiceNetworkResult) string { return v.CreatedAt }).(pulumi.StringOutput)
   136  }
   137  
   138  // The provider-assigned unique ID for this managed resource.
   139  func (o LookupServiceNetworkResultOutput) Id() pulumi.StringOutput {
   140  	return o.ApplyT(func(v LookupServiceNetworkResult) string { return v.Id }).(pulumi.StringOutput)
   141  }
   142  
   143  // Date and time the service network was last updated.
   144  func (o LookupServiceNetworkResultOutput) LastUpdatedAt() pulumi.StringOutput {
   145  	return o.ApplyT(func(v LookupServiceNetworkResult) string { return v.LastUpdatedAt }).(pulumi.StringOutput)
   146  }
   147  
   148  // Name of the service network.
   149  func (o LookupServiceNetworkResultOutput) Name() pulumi.StringOutput {
   150  	return o.ApplyT(func(v LookupServiceNetworkResult) string { return v.Name }).(pulumi.StringOutput)
   151  }
   152  
   153  // Number of services associated with this service network.
   154  func (o LookupServiceNetworkResultOutput) NumberOfAssociatedServices() pulumi.IntOutput {
   155  	return o.ApplyT(func(v LookupServiceNetworkResult) int { return v.NumberOfAssociatedServices }).(pulumi.IntOutput)
   156  }
   157  
   158  // Number of VPCs associated with this service network.
   159  func (o LookupServiceNetworkResultOutput) NumberOfAssociatedVpcs() pulumi.IntOutput {
   160  	return o.ApplyT(func(v LookupServiceNetworkResult) int { return v.NumberOfAssociatedVpcs }).(pulumi.IntOutput)
   161  }
   162  
   163  func (o LookupServiceNetworkResultOutput) ServiceNetworkIdentifier() pulumi.StringOutput {
   164  	return o.ApplyT(func(v LookupServiceNetworkResult) string { return v.ServiceNetworkIdentifier }).(pulumi.StringOutput)
   165  }
   166  
   167  func (o LookupServiceNetworkResultOutput) Tags() pulumi.StringMapOutput {
   168  	return o.ApplyT(func(v LookupServiceNetworkResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput)
   169  }
   170  
   171  func init() {
   172  	pulumi.RegisterOutputType(LookupServiceNetworkResultOutput{})
   173  }