github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/networkmanager/link.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 networkmanager 5 6 import ( 7 "context" 8 "reflect" 9 10 "errors" 11 "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" 12 "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 13 ) 14 15 // Creates a link for a site. 16 // 17 // ## Example Usage 18 // 19 // <!--Start PulumiCodeChooser --> 20 // ```go 21 // package main 22 // 23 // import ( 24 // 25 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/networkmanager" 26 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 27 // 28 // ) 29 // 30 // func main() { 31 // pulumi.Run(func(ctx *pulumi.Context) error { 32 // _, err := networkmanager.NewLink(ctx, "example", &networkmanager.LinkArgs{ 33 // GlobalNetworkId: pulumi.Any(exampleAwsNetworkmanagerGlobalNetwork.Id), 34 // SiteId: pulumi.Any(exampleAwsNetworkmanagerSite.Id), 35 // Bandwidth: &networkmanager.LinkBandwidthArgs{ 36 // UploadSpeed: pulumi.Int(10), 37 // DownloadSpeed: pulumi.Int(50), 38 // }, 39 // ProviderName: pulumi.String("MegaCorp"), 40 // }) 41 // if err != nil { 42 // return err 43 // } 44 // return nil 45 // }) 46 // } 47 // 48 // ``` 49 // <!--End PulumiCodeChooser --> 50 // 51 // ## Import 52 // 53 // Using `pulumi import`, import `aws_networkmanager_link` using the link ARN. For example: 54 // 55 // ```sh 56 // $ pulumi import aws:networkmanager/link:Link example arn:aws:networkmanager::123456789012:link/global-network-0d47f6t230mz46dy4/link-444555aaabbb11223 57 // ``` 58 type Link struct { 59 pulumi.CustomResourceState 60 61 // Link Amazon Resource Name (ARN). 62 Arn pulumi.StringOutput `pulumi:"arn"` 63 // The upload speed and download speed in Mbps. Documented below. 64 Bandwidth LinkBandwidthOutput `pulumi:"bandwidth"` 65 // A description of the link. 66 Description pulumi.StringPtrOutput `pulumi:"description"` 67 // The ID of the global network. 68 GlobalNetworkId pulumi.StringOutput `pulumi:"globalNetworkId"` 69 // The provider of the link. 70 ProviderName pulumi.StringPtrOutput `pulumi:"providerName"` 71 // The ID of the site. 72 SiteId pulumi.StringOutput `pulumi:"siteId"` 73 // Key-value tags for the link. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 74 Tags pulumi.StringMapOutput `pulumi:"tags"` 75 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 76 // 77 // Deprecated: Please use `tags` instead. 78 TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"` 79 // The type of the link. 80 Type pulumi.StringPtrOutput `pulumi:"type"` 81 } 82 83 // NewLink registers a new resource with the given unique name, arguments, and options. 84 func NewLink(ctx *pulumi.Context, 85 name string, args *LinkArgs, opts ...pulumi.ResourceOption) (*Link, error) { 86 if args == nil { 87 return nil, errors.New("missing one or more required arguments") 88 } 89 90 if args.Bandwidth == nil { 91 return nil, errors.New("invalid value for required argument 'Bandwidth'") 92 } 93 if args.GlobalNetworkId == nil { 94 return nil, errors.New("invalid value for required argument 'GlobalNetworkId'") 95 } 96 if args.SiteId == nil { 97 return nil, errors.New("invalid value for required argument 'SiteId'") 98 } 99 opts = internal.PkgResourceDefaultOpts(opts) 100 var resource Link 101 err := ctx.RegisterResource("aws:networkmanager/link:Link", name, args, &resource, opts...) 102 if err != nil { 103 return nil, err 104 } 105 return &resource, nil 106 } 107 108 // GetLink gets an existing Link resource's state with the given name, ID, and optional 109 // state properties that are used to uniquely qualify the lookup (nil if not required). 110 func GetLink(ctx *pulumi.Context, 111 name string, id pulumi.IDInput, state *LinkState, opts ...pulumi.ResourceOption) (*Link, error) { 112 var resource Link 113 err := ctx.ReadResource("aws:networkmanager/link:Link", name, id, state, &resource, opts...) 114 if err != nil { 115 return nil, err 116 } 117 return &resource, nil 118 } 119 120 // Input properties used for looking up and filtering Link resources. 121 type linkState struct { 122 // Link Amazon Resource Name (ARN). 123 Arn *string `pulumi:"arn"` 124 // The upload speed and download speed in Mbps. Documented below. 125 Bandwidth *LinkBandwidth `pulumi:"bandwidth"` 126 // A description of the link. 127 Description *string `pulumi:"description"` 128 // The ID of the global network. 129 GlobalNetworkId *string `pulumi:"globalNetworkId"` 130 // The provider of the link. 131 ProviderName *string `pulumi:"providerName"` 132 // The ID of the site. 133 SiteId *string `pulumi:"siteId"` 134 // Key-value tags for the link. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 135 Tags map[string]string `pulumi:"tags"` 136 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 137 // 138 // Deprecated: Please use `tags` instead. 139 TagsAll map[string]string `pulumi:"tagsAll"` 140 // The type of the link. 141 Type *string `pulumi:"type"` 142 } 143 144 type LinkState struct { 145 // Link Amazon Resource Name (ARN). 146 Arn pulumi.StringPtrInput 147 // The upload speed and download speed in Mbps. Documented below. 148 Bandwidth LinkBandwidthPtrInput 149 // A description of the link. 150 Description pulumi.StringPtrInput 151 // The ID of the global network. 152 GlobalNetworkId pulumi.StringPtrInput 153 // The provider of the link. 154 ProviderName pulumi.StringPtrInput 155 // The ID of the site. 156 SiteId pulumi.StringPtrInput 157 // Key-value tags for the link. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 158 Tags pulumi.StringMapInput 159 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 160 // 161 // Deprecated: Please use `tags` instead. 162 TagsAll pulumi.StringMapInput 163 // The type of the link. 164 Type pulumi.StringPtrInput 165 } 166 167 func (LinkState) ElementType() reflect.Type { 168 return reflect.TypeOf((*linkState)(nil)).Elem() 169 } 170 171 type linkArgs struct { 172 // The upload speed and download speed in Mbps. Documented below. 173 Bandwidth LinkBandwidth `pulumi:"bandwidth"` 174 // A description of the link. 175 Description *string `pulumi:"description"` 176 // The ID of the global network. 177 GlobalNetworkId string `pulumi:"globalNetworkId"` 178 // The provider of the link. 179 ProviderName *string `pulumi:"providerName"` 180 // The ID of the site. 181 SiteId string `pulumi:"siteId"` 182 // Key-value tags for the link. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 183 Tags map[string]string `pulumi:"tags"` 184 // The type of the link. 185 Type *string `pulumi:"type"` 186 } 187 188 // The set of arguments for constructing a Link resource. 189 type LinkArgs struct { 190 // The upload speed and download speed in Mbps. Documented below. 191 Bandwidth LinkBandwidthInput 192 // A description of the link. 193 Description pulumi.StringPtrInput 194 // The ID of the global network. 195 GlobalNetworkId pulumi.StringInput 196 // The provider of the link. 197 ProviderName pulumi.StringPtrInput 198 // The ID of the site. 199 SiteId pulumi.StringInput 200 // Key-value tags for the link. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 201 Tags pulumi.StringMapInput 202 // The type of the link. 203 Type pulumi.StringPtrInput 204 } 205 206 func (LinkArgs) ElementType() reflect.Type { 207 return reflect.TypeOf((*linkArgs)(nil)).Elem() 208 } 209 210 type LinkInput interface { 211 pulumi.Input 212 213 ToLinkOutput() LinkOutput 214 ToLinkOutputWithContext(ctx context.Context) LinkOutput 215 } 216 217 func (*Link) ElementType() reflect.Type { 218 return reflect.TypeOf((**Link)(nil)).Elem() 219 } 220 221 func (i *Link) ToLinkOutput() LinkOutput { 222 return i.ToLinkOutputWithContext(context.Background()) 223 } 224 225 func (i *Link) ToLinkOutputWithContext(ctx context.Context) LinkOutput { 226 return pulumi.ToOutputWithContext(ctx, i).(LinkOutput) 227 } 228 229 // LinkArrayInput is an input type that accepts LinkArray and LinkArrayOutput values. 230 // You can construct a concrete instance of `LinkArrayInput` via: 231 // 232 // LinkArray{ LinkArgs{...} } 233 type LinkArrayInput interface { 234 pulumi.Input 235 236 ToLinkArrayOutput() LinkArrayOutput 237 ToLinkArrayOutputWithContext(context.Context) LinkArrayOutput 238 } 239 240 type LinkArray []LinkInput 241 242 func (LinkArray) ElementType() reflect.Type { 243 return reflect.TypeOf((*[]*Link)(nil)).Elem() 244 } 245 246 func (i LinkArray) ToLinkArrayOutput() LinkArrayOutput { 247 return i.ToLinkArrayOutputWithContext(context.Background()) 248 } 249 250 func (i LinkArray) ToLinkArrayOutputWithContext(ctx context.Context) LinkArrayOutput { 251 return pulumi.ToOutputWithContext(ctx, i).(LinkArrayOutput) 252 } 253 254 // LinkMapInput is an input type that accepts LinkMap and LinkMapOutput values. 255 // You can construct a concrete instance of `LinkMapInput` via: 256 // 257 // LinkMap{ "key": LinkArgs{...} } 258 type LinkMapInput interface { 259 pulumi.Input 260 261 ToLinkMapOutput() LinkMapOutput 262 ToLinkMapOutputWithContext(context.Context) LinkMapOutput 263 } 264 265 type LinkMap map[string]LinkInput 266 267 func (LinkMap) ElementType() reflect.Type { 268 return reflect.TypeOf((*map[string]*Link)(nil)).Elem() 269 } 270 271 func (i LinkMap) ToLinkMapOutput() LinkMapOutput { 272 return i.ToLinkMapOutputWithContext(context.Background()) 273 } 274 275 func (i LinkMap) ToLinkMapOutputWithContext(ctx context.Context) LinkMapOutput { 276 return pulumi.ToOutputWithContext(ctx, i).(LinkMapOutput) 277 } 278 279 type LinkOutput struct{ *pulumi.OutputState } 280 281 func (LinkOutput) ElementType() reflect.Type { 282 return reflect.TypeOf((**Link)(nil)).Elem() 283 } 284 285 func (o LinkOutput) ToLinkOutput() LinkOutput { 286 return o 287 } 288 289 func (o LinkOutput) ToLinkOutputWithContext(ctx context.Context) LinkOutput { 290 return o 291 } 292 293 // Link Amazon Resource Name (ARN). 294 func (o LinkOutput) Arn() pulumi.StringOutput { 295 return o.ApplyT(func(v *Link) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 296 } 297 298 // The upload speed and download speed in Mbps. Documented below. 299 func (o LinkOutput) Bandwidth() LinkBandwidthOutput { 300 return o.ApplyT(func(v *Link) LinkBandwidthOutput { return v.Bandwidth }).(LinkBandwidthOutput) 301 } 302 303 // A description of the link. 304 func (o LinkOutput) Description() pulumi.StringPtrOutput { 305 return o.ApplyT(func(v *Link) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput) 306 } 307 308 // The ID of the global network. 309 func (o LinkOutput) GlobalNetworkId() pulumi.StringOutput { 310 return o.ApplyT(func(v *Link) pulumi.StringOutput { return v.GlobalNetworkId }).(pulumi.StringOutput) 311 } 312 313 // The provider of the link. 314 func (o LinkOutput) ProviderName() pulumi.StringPtrOutput { 315 return o.ApplyT(func(v *Link) pulumi.StringPtrOutput { return v.ProviderName }).(pulumi.StringPtrOutput) 316 } 317 318 // The ID of the site. 319 func (o LinkOutput) SiteId() pulumi.StringOutput { 320 return o.ApplyT(func(v *Link) pulumi.StringOutput { return v.SiteId }).(pulumi.StringOutput) 321 } 322 323 // Key-value tags for the link. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 324 func (o LinkOutput) Tags() pulumi.StringMapOutput { 325 return o.ApplyT(func(v *Link) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput) 326 } 327 328 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 329 // 330 // Deprecated: Please use `tags` instead. 331 func (o LinkOutput) TagsAll() pulumi.StringMapOutput { 332 return o.ApplyT(func(v *Link) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput) 333 } 334 335 // The type of the link. 336 func (o LinkOutput) Type() pulumi.StringPtrOutput { 337 return o.ApplyT(func(v *Link) pulumi.StringPtrOutput { return v.Type }).(pulumi.StringPtrOutput) 338 } 339 340 type LinkArrayOutput struct{ *pulumi.OutputState } 341 342 func (LinkArrayOutput) ElementType() reflect.Type { 343 return reflect.TypeOf((*[]*Link)(nil)).Elem() 344 } 345 346 func (o LinkArrayOutput) ToLinkArrayOutput() LinkArrayOutput { 347 return o 348 } 349 350 func (o LinkArrayOutput) ToLinkArrayOutputWithContext(ctx context.Context) LinkArrayOutput { 351 return o 352 } 353 354 func (o LinkArrayOutput) Index(i pulumi.IntInput) LinkOutput { 355 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Link { 356 return vs[0].([]*Link)[vs[1].(int)] 357 }).(LinkOutput) 358 } 359 360 type LinkMapOutput struct{ *pulumi.OutputState } 361 362 func (LinkMapOutput) ElementType() reflect.Type { 363 return reflect.TypeOf((*map[string]*Link)(nil)).Elem() 364 } 365 366 func (o LinkMapOutput) ToLinkMapOutput() LinkMapOutput { 367 return o 368 } 369 370 func (o LinkMapOutput) ToLinkMapOutputWithContext(ctx context.Context) LinkMapOutput { 371 return o 372 } 373 374 func (o LinkMapOutput) MapIndex(k pulumi.StringInput) LinkOutput { 375 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Link { 376 return vs[0].(map[string]*Link)[vs[1].(string)] 377 }).(LinkOutput) 378 } 379 380 func init() { 381 pulumi.RegisterInputType(reflect.TypeOf((*LinkInput)(nil)).Elem(), &Link{}) 382 pulumi.RegisterInputType(reflect.TypeOf((*LinkArrayInput)(nil)).Elem(), LinkArray{}) 383 pulumi.RegisterInputType(reflect.TypeOf((*LinkMapInput)(nil)).Elem(), LinkMap{}) 384 pulumi.RegisterOutputType(LinkOutput{}) 385 pulumi.RegisterOutputType(LinkArrayOutput{}) 386 pulumi.RegisterOutputType(LinkMapOutput{}) 387 }