github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/networkmanager/device.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 device in a global network. If you specify both a site ID and a location, 16 // the location of the site is used for visualization in the Network Manager console. 17 // 18 // ## Example Usage 19 // 20 // <!--Start PulumiCodeChooser --> 21 // ```go 22 // package main 23 // 24 // import ( 25 // 26 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/networkmanager" 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 := networkmanager.NewDevice(ctx, "example", &networkmanager.DeviceArgs{ 34 // GlobalNetworkId: pulumi.Any(exampleAwsNetworkmanagerGlobalNetwork.Id), 35 // SiteId: pulumi.Any(exampleAwsNetworkmanagerSite.Id), 36 // }) 37 // if err != nil { 38 // return err 39 // } 40 // return nil 41 // }) 42 // } 43 // 44 // ``` 45 // <!--End PulumiCodeChooser --> 46 // 47 // ## Import 48 // 49 // Using `pulumi import`, import `aws_networkmanager_device` using the device ARN. For example: 50 // 51 // ```sh 52 // $ pulumi import aws:networkmanager/device:Device example arn:aws:networkmanager::123456789012:device/global-network-0d47f6t230mz46dy4/device-07f6fd08867abc123 53 // ``` 54 type Device struct { 55 pulumi.CustomResourceState 56 57 // The Amazon Resource Name (ARN) of the device. 58 Arn pulumi.StringOutput `pulumi:"arn"` 59 // The AWS location of the device. Documented below. 60 AwsLocation DeviceAwsLocationPtrOutput `pulumi:"awsLocation"` 61 // A description of the device. 62 Description pulumi.StringPtrOutput `pulumi:"description"` 63 // The ID of the global network. 64 GlobalNetworkId pulumi.StringOutput `pulumi:"globalNetworkId"` 65 // The location of the device. Documented below. 66 Location DeviceLocationPtrOutput `pulumi:"location"` 67 // The model of device. 68 Model pulumi.StringPtrOutput `pulumi:"model"` 69 // The serial number of the device. 70 SerialNumber pulumi.StringPtrOutput `pulumi:"serialNumber"` 71 // The ID of the site. 72 SiteId pulumi.StringPtrOutput `pulumi:"siteId"` 73 // Key-value tags for the device. 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 device. 80 Type pulumi.StringPtrOutput `pulumi:"type"` 81 // The vendor of the device. 82 Vendor pulumi.StringPtrOutput `pulumi:"vendor"` 83 } 84 85 // NewDevice registers a new resource with the given unique name, arguments, and options. 86 func NewDevice(ctx *pulumi.Context, 87 name string, args *DeviceArgs, opts ...pulumi.ResourceOption) (*Device, error) { 88 if args == nil { 89 return nil, errors.New("missing one or more required arguments") 90 } 91 92 if args.GlobalNetworkId == nil { 93 return nil, errors.New("invalid value for required argument 'GlobalNetworkId'") 94 } 95 opts = internal.PkgResourceDefaultOpts(opts) 96 var resource Device 97 err := ctx.RegisterResource("aws:networkmanager/device:Device", name, args, &resource, opts...) 98 if err != nil { 99 return nil, err 100 } 101 return &resource, nil 102 } 103 104 // GetDevice gets an existing Device resource's state with the given name, ID, and optional 105 // state properties that are used to uniquely qualify the lookup (nil if not required). 106 func GetDevice(ctx *pulumi.Context, 107 name string, id pulumi.IDInput, state *DeviceState, opts ...pulumi.ResourceOption) (*Device, error) { 108 var resource Device 109 err := ctx.ReadResource("aws:networkmanager/device:Device", name, id, state, &resource, opts...) 110 if err != nil { 111 return nil, err 112 } 113 return &resource, nil 114 } 115 116 // Input properties used for looking up and filtering Device resources. 117 type deviceState struct { 118 // The Amazon Resource Name (ARN) of the device. 119 Arn *string `pulumi:"arn"` 120 // The AWS location of the device. Documented below. 121 AwsLocation *DeviceAwsLocation `pulumi:"awsLocation"` 122 // A description of the device. 123 Description *string `pulumi:"description"` 124 // The ID of the global network. 125 GlobalNetworkId *string `pulumi:"globalNetworkId"` 126 // The location of the device. Documented below. 127 Location *DeviceLocation `pulumi:"location"` 128 // The model of device. 129 Model *string `pulumi:"model"` 130 // The serial number of the device. 131 SerialNumber *string `pulumi:"serialNumber"` 132 // The ID of the site. 133 SiteId *string `pulumi:"siteId"` 134 // Key-value tags for the device. 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 device. 141 Type *string `pulumi:"type"` 142 // The vendor of the device. 143 Vendor *string `pulumi:"vendor"` 144 } 145 146 type DeviceState struct { 147 // The Amazon Resource Name (ARN) of the device. 148 Arn pulumi.StringPtrInput 149 // The AWS location of the device. Documented below. 150 AwsLocation DeviceAwsLocationPtrInput 151 // A description of the device. 152 Description pulumi.StringPtrInput 153 // The ID of the global network. 154 GlobalNetworkId pulumi.StringPtrInput 155 // The location of the device. Documented below. 156 Location DeviceLocationPtrInput 157 // The model of device. 158 Model pulumi.StringPtrInput 159 // The serial number of the device. 160 SerialNumber pulumi.StringPtrInput 161 // The ID of the site. 162 SiteId pulumi.StringPtrInput 163 // Key-value tags for the device. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 164 Tags pulumi.StringMapInput 165 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 166 // 167 // Deprecated: Please use `tags` instead. 168 TagsAll pulumi.StringMapInput 169 // The type of device. 170 Type pulumi.StringPtrInput 171 // The vendor of the device. 172 Vendor pulumi.StringPtrInput 173 } 174 175 func (DeviceState) ElementType() reflect.Type { 176 return reflect.TypeOf((*deviceState)(nil)).Elem() 177 } 178 179 type deviceArgs struct { 180 // The AWS location of the device. Documented below. 181 AwsLocation *DeviceAwsLocation `pulumi:"awsLocation"` 182 // A description of the device. 183 Description *string `pulumi:"description"` 184 // The ID of the global network. 185 GlobalNetworkId string `pulumi:"globalNetworkId"` 186 // The location of the device. Documented below. 187 Location *DeviceLocation `pulumi:"location"` 188 // The model of device. 189 Model *string `pulumi:"model"` 190 // The serial number of the device. 191 SerialNumber *string `pulumi:"serialNumber"` 192 // The ID of the site. 193 SiteId *string `pulumi:"siteId"` 194 // Key-value tags for the device. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 195 Tags map[string]string `pulumi:"tags"` 196 // The type of device. 197 Type *string `pulumi:"type"` 198 // The vendor of the device. 199 Vendor *string `pulumi:"vendor"` 200 } 201 202 // The set of arguments for constructing a Device resource. 203 type DeviceArgs struct { 204 // The AWS location of the device. Documented below. 205 AwsLocation DeviceAwsLocationPtrInput 206 // A description of the device. 207 Description pulumi.StringPtrInput 208 // The ID of the global network. 209 GlobalNetworkId pulumi.StringInput 210 // The location of the device. Documented below. 211 Location DeviceLocationPtrInput 212 // The model of device. 213 Model pulumi.StringPtrInput 214 // The serial number of the device. 215 SerialNumber pulumi.StringPtrInput 216 // The ID of the site. 217 SiteId pulumi.StringPtrInput 218 // Key-value tags for the device. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 219 Tags pulumi.StringMapInput 220 // The type of device. 221 Type pulumi.StringPtrInput 222 // The vendor of the device. 223 Vendor pulumi.StringPtrInput 224 } 225 226 func (DeviceArgs) ElementType() reflect.Type { 227 return reflect.TypeOf((*deviceArgs)(nil)).Elem() 228 } 229 230 type DeviceInput interface { 231 pulumi.Input 232 233 ToDeviceOutput() DeviceOutput 234 ToDeviceOutputWithContext(ctx context.Context) DeviceOutput 235 } 236 237 func (*Device) ElementType() reflect.Type { 238 return reflect.TypeOf((**Device)(nil)).Elem() 239 } 240 241 func (i *Device) ToDeviceOutput() DeviceOutput { 242 return i.ToDeviceOutputWithContext(context.Background()) 243 } 244 245 func (i *Device) ToDeviceOutputWithContext(ctx context.Context) DeviceOutput { 246 return pulumi.ToOutputWithContext(ctx, i).(DeviceOutput) 247 } 248 249 // DeviceArrayInput is an input type that accepts DeviceArray and DeviceArrayOutput values. 250 // You can construct a concrete instance of `DeviceArrayInput` via: 251 // 252 // DeviceArray{ DeviceArgs{...} } 253 type DeviceArrayInput interface { 254 pulumi.Input 255 256 ToDeviceArrayOutput() DeviceArrayOutput 257 ToDeviceArrayOutputWithContext(context.Context) DeviceArrayOutput 258 } 259 260 type DeviceArray []DeviceInput 261 262 func (DeviceArray) ElementType() reflect.Type { 263 return reflect.TypeOf((*[]*Device)(nil)).Elem() 264 } 265 266 func (i DeviceArray) ToDeviceArrayOutput() DeviceArrayOutput { 267 return i.ToDeviceArrayOutputWithContext(context.Background()) 268 } 269 270 func (i DeviceArray) ToDeviceArrayOutputWithContext(ctx context.Context) DeviceArrayOutput { 271 return pulumi.ToOutputWithContext(ctx, i).(DeviceArrayOutput) 272 } 273 274 // DeviceMapInput is an input type that accepts DeviceMap and DeviceMapOutput values. 275 // You can construct a concrete instance of `DeviceMapInput` via: 276 // 277 // DeviceMap{ "key": DeviceArgs{...} } 278 type DeviceMapInput interface { 279 pulumi.Input 280 281 ToDeviceMapOutput() DeviceMapOutput 282 ToDeviceMapOutputWithContext(context.Context) DeviceMapOutput 283 } 284 285 type DeviceMap map[string]DeviceInput 286 287 func (DeviceMap) ElementType() reflect.Type { 288 return reflect.TypeOf((*map[string]*Device)(nil)).Elem() 289 } 290 291 func (i DeviceMap) ToDeviceMapOutput() DeviceMapOutput { 292 return i.ToDeviceMapOutputWithContext(context.Background()) 293 } 294 295 func (i DeviceMap) ToDeviceMapOutputWithContext(ctx context.Context) DeviceMapOutput { 296 return pulumi.ToOutputWithContext(ctx, i).(DeviceMapOutput) 297 } 298 299 type DeviceOutput struct{ *pulumi.OutputState } 300 301 func (DeviceOutput) ElementType() reflect.Type { 302 return reflect.TypeOf((**Device)(nil)).Elem() 303 } 304 305 func (o DeviceOutput) ToDeviceOutput() DeviceOutput { 306 return o 307 } 308 309 func (o DeviceOutput) ToDeviceOutputWithContext(ctx context.Context) DeviceOutput { 310 return o 311 } 312 313 // The Amazon Resource Name (ARN) of the device. 314 func (o DeviceOutput) Arn() pulumi.StringOutput { 315 return o.ApplyT(func(v *Device) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 316 } 317 318 // The AWS location of the device. Documented below. 319 func (o DeviceOutput) AwsLocation() DeviceAwsLocationPtrOutput { 320 return o.ApplyT(func(v *Device) DeviceAwsLocationPtrOutput { return v.AwsLocation }).(DeviceAwsLocationPtrOutput) 321 } 322 323 // A description of the device. 324 func (o DeviceOutput) Description() pulumi.StringPtrOutput { 325 return o.ApplyT(func(v *Device) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput) 326 } 327 328 // The ID of the global network. 329 func (o DeviceOutput) GlobalNetworkId() pulumi.StringOutput { 330 return o.ApplyT(func(v *Device) pulumi.StringOutput { return v.GlobalNetworkId }).(pulumi.StringOutput) 331 } 332 333 // The location of the device. Documented below. 334 func (o DeviceOutput) Location() DeviceLocationPtrOutput { 335 return o.ApplyT(func(v *Device) DeviceLocationPtrOutput { return v.Location }).(DeviceLocationPtrOutput) 336 } 337 338 // The model of device. 339 func (o DeviceOutput) Model() pulumi.StringPtrOutput { 340 return o.ApplyT(func(v *Device) pulumi.StringPtrOutput { return v.Model }).(pulumi.StringPtrOutput) 341 } 342 343 // The serial number of the device. 344 func (o DeviceOutput) SerialNumber() pulumi.StringPtrOutput { 345 return o.ApplyT(func(v *Device) pulumi.StringPtrOutput { return v.SerialNumber }).(pulumi.StringPtrOutput) 346 } 347 348 // The ID of the site. 349 func (o DeviceOutput) SiteId() pulumi.StringPtrOutput { 350 return o.ApplyT(func(v *Device) pulumi.StringPtrOutput { return v.SiteId }).(pulumi.StringPtrOutput) 351 } 352 353 // Key-value tags for the device. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 354 func (o DeviceOutput) Tags() pulumi.StringMapOutput { 355 return o.ApplyT(func(v *Device) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput) 356 } 357 358 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 359 // 360 // Deprecated: Please use `tags` instead. 361 func (o DeviceOutput) TagsAll() pulumi.StringMapOutput { 362 return o.ApplyT(func(v *Device) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput) 363 } 364 365 // The type of device. 366 func (o DeviceOutput) Type() pulumi.StringPtrOutput { 367 return o.ApplyT(func(v *Device) pulumi.StringPtrOutput { return v.Type }).(pulumi.StringPtrOutput) 368 } 369 370 // The vendor of the device. 371 func (o DeviceOutput) Vendor() pulumi.StringPtrOutput { 372 return o.ApplyT(func(v *Device) pulumi.StringPtrOutput { return v.Vendor }).(pulumi.StringPtrOutput) 373 } 374 375 type DeviceArrayOutput struct{ *pulumi.OutputState } 376 377 func (DeviceArrayOutput) ElementType() reflect.Type { 378 return reflect.TypeOf((*[]*Device)(nil)).Elem() 379 } 380 381 func (o DeviceArrayOutput) ToDeviceArrayOutput() DeviceArrayOutput { 382 return o 383 } 384 385 func (o DeviceArrayOutput) ToDeviceArrayOutputWithContext(ctx context.Context) DeviceArrayOutput { 386 return o 387 } 388 389 func (o DeviceArrayOutput) Index(i pulumi.IntInput) DeviceOutput { 390 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Device { 391 return vs[0].([]*Device)[vs[1].(int)] 392 }).(DeviceOutput) 393 } 394 395 type DeviceMapOutput struct{ *pulumi.OutputState } 396 397 func (DeviceMapOutput) ElementType() reflect.Type { 398 return reflect.TypeOf((*map[string]*Device)(nil)).Elem() 399 } 400 401 func (o DeviceMapOutput) ToDeviceMapOutput() DeviceMapOutput { 402 return o 403 } 404 405 func (o DeviceMapOutput) ToDeviceMapOutputWithContext(ctx context.Context) DeviceMapOutput { 406 return o 407 } 408 409 func (o DeviceMapOutput) MapIndex(k pulumi.StringInput) DeviceOutput { 410 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Device { 411 return vs[0].(map[string]*Device)[vs[1].(string)] 412 }).(DeviceOutput) 413 } 414 415 func init() { 416 pulumi.RegisterInputType(reflect.TypeOf((*DeviceInput)(nil)).Elem(), &Device{}) 417 pulumi.RegisterInputType(reflect.TypeOf((*DeviceArrayInput)(nil)).Elem(), DeviceArray{}) 418 pulumi.RegisterInputType(reflect.TypeOf((*DeviceMapInput)(nil)).Elem(), DeviceMap{}) 419 pulumi.RegisterOutputType(DeviceOutput{}) 420 pulumi.RegisterOutputType(DeviceArrayOutput{}) 421 pulumi.RegisterOutputType(DeviceMapOutput{}) 422 }