/
getLocation.go
128 lines (109 loc) · 4.72 KB
/
getLocation.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
// *** 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! ***
package directconnect
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Retrieve information about a specific AWS Direct Connect location in the current AWS Region.
// These are the locations that can be specified when configuring [`directconnect.Connection`](https://www.terraform.io/docs/providers/aws/r/dx_connection.html) or [`directconnect.LinkAggregationGroup`](https://www.terraform.io/docs/providers/aws/r/dx_lag.html) resources.
//
// > **Note:** This data source is different from the [`directconnect.getLocations`](https://www.terraform.io/docs/providers/aws/d/dx_locations.html) data source which retrieves information about all the AWS Direct Connect locations in the current AWS Region.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-aws/sdk/v4/go/aws/directconnect"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := directconnect.GetLocation(ctx, &directconnect.GetLocationArgs{
// LocationCode: "CS32A-24FL",
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
func GetLocation(ctx *pulumi.Context, args *GetLocationArgs, opts ...pulumi.InvokeOption) (*GetLocationResult, error) {
var rv GetLocationResult
err := ctx.Invoke("aws:directconnect/getLocation:getLocation", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getLocation.
type GetLocationArgs struct {
// The code for the location to retrieve.
LocationCode string `pulumi:"locationCode"`
}
// A collection of values returned by getLocation.
type GetLocationResult struct {
// The available port speeds for the location.
AvailablePortSpeeds []string `pulumi:"availablePortSpeeds"`
// The names of the service providers for the location.
AvailableProviders []string `pulumi:"availableProviders"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
LocationCode string `pulumi:"locationCode"`
// The name of the location. This includes the name of the colocation partner and the physical site of the building.
LocationName string `pulumi:"locationName"`
}
func GetLocationOutput(ctx *pulumi.Context, args GetLocationOutputArgs, opts ...pulumi.InvokeOption) GetLocationResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (GetLocationResult, error) {
args := v.(GetLocationArgs)
r, err := GetLocation(ctx, &args, opts...)
return *r, err
}).(GetLocationResultOutput)
}
// A collection of arguments for invoking getLocation.
type GetLocationOutputArgs struct {
// The code for the location to retrieve.
LocationCode pulumi.StringInput `pulumi:"locationCode"`
}
func (GetLocationOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*GetLocationArgs)(nil)).Elem()
}
// A collection of values returned by getLocation.
type GetLocationResultOutput struct{ *pulumi.OutputState }
func (GetLocationResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*GetLocationResult)(nil)).Elem()
}
func (o GetLocationResultOutput) ToGetLocationResultOutput() GetLocationResultOutput {
return o
}
func (o GetLocationResultOutput) ToGetLocationResultOutputWithContext(ctx context.Context) GetLocationResultOutput {
return o
}
// The available port speeds for the location.
func (o GetLocationResultOutput) AvailablePortSpeeds() pulumi.StringArrayOutput {
return o.ApplyT(func(v GetLocationResult) []string { return v.AvailablePortSpeeds }).(pulumi.StringArrayOutput)
}
// The names of the service providers for the location.
func (o GetLocationResultOutput) AvailableProviders() pulumi.StringArrayOutput {
return o.ApplyT(func(v GetLocationResult) []string { return v.AvailableProviders }).(pulumi.StringArrayOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o GetLocationResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v GetLocationResult) string { return v.Id }).(pulumi.StringOutput)
}
func (o GetLocationResultOutput) LocationCode() pulumi.StringOutput {
return o.ApplyT(func(v GetLocationResult) string { return v.LocationCode }).(pulumi.StringOutput)
}
// The name of the location. This includes the name of the colocation partner and the physical site of the building.
func (o GetLocationResultOutput) LocationName() pulumi.StringOutput {
return o.ApplyT(func(v GetLocationResult) string { return v.LocationName }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(GetLocationResultOutput{})
}