github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/directconnect/hostedPrivateVirtualInterfaceAccepter.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 directconnect 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 // Provides a resource to manage the accepter's side of a Direct Connect hosted private virtual interface. 16 // This resource accepts ownership of a private virtual interface created by another AWS account. 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" 27 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/directconnect" 28 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2" 29 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 30 // 31 // ) 32 // 33 // func main() { 34 // pulumi.Run(func(ctx *pulumi.Context) error { 35 // accepter, err := aws.GetCallerIdentity(ctx, nil, nil) 36 // if err != nil { 37 // return err 38 // } 39 // // Accepter's side of the VIF. 40 // vpnGw, err := ec2.NewVpnGateway(ctx, "vpn_gw", nil) 41 // if err != nil { 42 // return err 43 // } 44 // // Creator's side of the VIF 45 // creator, err := directconnect.NewHostedPrivateVirtualInterface(ctx, "creator", &directconnect.HostedPrivateVirtualInterfaceArgs{ 46 // ConnectionId: pulumi.String("dxcon-zzzzzzzz"), 47 // OwnerAccountId: pulumi.String(accepter.AccountId), 48 // Name: pulumi.String("vif-foo"), 49 // Vlan: pulumi.Int(4094), 50 // AddressFamily: pulumi.String("ipv4"), 51 // BgpAsn: pulumi.Int(65352), 52 // }, pulumi.DependsOn([]pulumi.Resource{ 53 // vpnGw, 54 // })) 55 // if err != nil { 56 // return err 57 // } 58 // _, err = directconnect.NewHostedPrivateVirtualInterfaceAccepter(ctx, "accepter", &directconnect.HostedPrivateVirtualInterfaceAccepterArgs{ 59 // VirtualInterfaceId: creator.ID(), 60 // VpnGatewayId: vpnGw.ID(), 61 // Tags: pulumi.StringMap{ 62 // "Side": pulumi.String("Accepter"), 63 // }, 64 // }) 65 // if err != nil { 66 // return err 67 // } 68 // return nil 69 // }) 70 // } 71 // 72 // ``` 73 // <!--End PulumiCodeChooser --> 74 // 75 // ## Import 76 // 77 // Using `pulumi import`, import Direct Connect hosted private virtual interfaces using the VIF `id`. For example: 78 // 79 // ```sh 80 // $ pulumi import aws:directconnect/hostedPrivateVirtualInterfaceAccepter:HostedPrivateVirtualInterfaceAccepter test dxvif-33cc44dd 81 // ``` 82 type HostedPrivateVirtualInterfaceAccepter struct { 83 pulumi.CustomResourceState 84 85 // The ARN of the virtual interface. 86 Arn pulumi.StringOutput `pulumi:"arn"` 87 // The ID of the Direct Connect gateway to which to connect the virtual interface. 88 DxGatewayId pulumi.StringPtrOutput `pulumi:"dxGatewayId"` 89 // A map of tags to assign to the resource. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 90 Tags pulumi.StringMapOutput `pulumi:"tags"` 91 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 92 // 93 // Deprecated: Please use `tags` instead. 94 TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"` 95 // The ID of the Direct Connect virtual interface to accept. 96 VirtualInterfaceId pulumi.StringOutput `pulumi:"virtualInterfaceId"` 97 // The ID of the virtual private gateway to which to connect the virtual interface. 98 VpnGatewayId pulumi.StringPtrOutput `pulumi:"vpnGatewayId"` 99 } 100 101 // NewHostedPrivateVirtualInterfaceAccepter registers a new resource with the given unique name, arguments, and options. 102 func NewHostedPrivateVirtualInterfaceAccepter(ctx *pulumi.Context, 103 name string, args *HostedPrivateVirtualInterfaceAccepterArgs, opts ...pulumi.ResourceOption) (*HostedPrivateVirtualInterfaceAccepter, error) { 104 if args == nil { 105 return nil, errors.New("missing one or more required arguments") 106 } 107 108 if args.VirtualInterfaceId == nil { 109 return nil, errors.New("invalid value for required argument 'VirtualInterfaceId'") 110 } 111 opts = internal.PkgResourceDefaultOpts(opts) 112 var resource HostedPrivateVirtualInterfaceAccepter 113 err := ctx.RegisterResource("aws:directconnect/hostedPrivateVirtualInterfaceAccepter:HostedPrivateVirtualInterfaceAccepter", name, args, &resource, opts...) 114 if err != nil { 115 return nil, err 116 } 117 return &resource, nil 118 } 119 120 // GetHostedPrivateVirtualInterfaceAccepter gets an existing HostedPrivateVirtualInterfaceAccepter resource's state with the given name, ID, and optional 121 // state properties that are used to uniquely qualify the lookup (nil if not required). 122 func GetHostedPrivateVirtualInterfaceAccepter(ctx *pulumi.Context, 123 name string, id pulumi.IDInput, state *HostedPrivateVirtualInterfaceAccepterState, opts ...pulumi.ResourceOption) (*HostedPrivateVirtualInterfaceAccepter, error) { 124 var resource HostedPrivateVirtualInterfaceAccepter 125 err := ctx.ReadResource("aws:directconnect/hostedPrivateVirtualInterfaceAccepter:HostedPrivateVirtualInterfaceAccepter", name, id, state, &resource, opts...) 126 if err != nil { 127 return nil, err 128 } 129 return &resource, nil 130 } 131 132 // Input properties used for looking up and filtering HostedPrivateVirtualInterfaceAccepter resources. 133 type hostedPrivateVirtualInterfaceAccepterState struct { 134 // The ARN of the virtual interface. 135 Arn *string `pulumi:"arn"` 136 // The ID of the Direct Connect gateway to which to connect the virtual interface. 137 DxGatewayId *string `pulumi:"dxGatewayId"` 138 // A map of tags to assign to the resource. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 139 Tags map[string]string `pulumi:"tags"` 140 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 141 // 142 // Deprecated: Please use `tags` instead. 143 TagsAll map[string]string `pulumi:"tagsAll"` 144 // The ID of the Direct Connect virtual interface to accept. 145 VirtualInterfaceId *string `pulumi:"virtualInterfaceId"` 146 // The ID of the virtual private gateway to which to connect the virtual interface. 147 VpnGatewayId *string `pulumi:"vpnGatewayId"` 148 } 149 150 type HostedPrivateVirtualInterfaceAccepterState struct { 151 // The ARN of the virtual interface. 152 Arn pulumi.StringPtrInput 153 // The ID of the Direct Connect gateway to which to connect the virtual interface. 154 DxGatewayId pulumi.StringPtrInput 155 // A map of tags to assign to the resource. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 156 Tags pulumi.StringMapInput 157 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 158 // 159 // Deprecated: Please use `tags` instead. 160 TagsAll pulumi.StringMapInput 161 // The ID of the Direct Connect virtual interface to accept. 162 VirtualInterfaceId pulumi.StringPtrInput 163 // The ID of the virtual private gateway to which to connect the virtual interface. 164 VpnGatewayId pulumi.StringPtrInput 165 } 166 167 func (HostedPrivateVirtualInterfaceAccepterState) ElementType() reflect.Type { 168 return reflect.TypeOf((*hostedPrivateVirtualInterfaceAccepterState)(nil)).Elem() 169 } 170 171 type hostedPrivateVirtualInterfaceAccepterArgs struct { 172 // The ID of the Direct Connect gateway to which to connect the virtual interface. 173 DxGatewayId *string `pulumi:"dxGatewayId"` 174 // A map of tags to assign to the resource. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 175 Tags map[string]string `pulumi:"tags"` 176 // The ID of the Direct Connect virtual interface to accept. 177 VirtualInterfaceId string `pulumi:"virtualInterfaceId"` 178 // The ID of the virtual private gateway to which to connect the virtual interface. 179 VpnGatewayId *string `pulumi:"vpnGatewayId"` 180 } 181 182 // The set of arguments for constructing a HostedPrivateVirtualInterfaceAccepter resource. 183 type HostedPrivateVirtualInterfaceAccepterArgs struct { 184 // The ID of the Direct Connect gateway to which to connect the virtual interface. 185 DxGatewayId pulumi.StringPtrInput 186 // A map of tags to assign to the resource. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 187 Tags pulumi.StringMapInput 188 // The ID of the Direct Connect virtual interface to accept. 189 VirtualInterfaceId pulumi.StringInput 190 // The ID of the virtual private gateway to which to connect the virtual interface. 191 VpnGatewayId pulumi.StringPtrInput 192 } 193 194 func (HostedPrivateVirtualInterfaceAccepterArgs) ElementType() reflect.Type { 195 return reflect.TypeOf((*hostedPrivateVirtualInterfaceAccepterArgs)(nil)).Elem() 196 } 197 198 type HostedPrivateVirtualInterfaceAccepterInput interface { 199 pulumi.Input 200 201 ToHostedPrivateVirtualInterfaceAccepterOutput() HostedPrivateVirtualInterfaceAccepterOutput 202 ToHostedPrivateVirtualInterfaceAccepterOutputWithContext(ctx context.Context) HostedPrivateVirtualInterfaceAccepterOutput 203 } 204 205 func (*HostedPrivateVirtualInterfaceAccepter) ElementType() reflect.Type { 206 return reflect.TypeOf((**HostedPrivateVirtualInterfaceAccepter)(nil)).Elem() 207 } 208 209 func (i *HostedPrivateVirtualInterfaceAccepter) ToHostedPrivateVirtualInterfaceAccepterOutput() HostedPrivateVirtualInterfaceAccepterOutput { 210 return i.ToHostedPrivateVirtualInterfaceAccepterOutputWithContext(context.Background()) 211 } 212 213 func (i *HostedPrivateVirtualInterfaceAccepter) ToHostedPrivateVirtualInterfaceAccepterOutputWithContext(ctx context.Context) HostedPrivateVirtualInterfaceAccepterOutput { 214 return pulumi.ToOutputWithContext(ctx, i).(HostedPrivateVirtualInterfaceAccepterOutput) 215 } 216 217 // HostedPrivateVirtualInterfaceAccepterArrayInput is an input type that accepts HostedPrivateVirtualInterfaceAccepterArray and HostedPrivateVirtualInterfaceAccepterArrayOutput values. 218 // You can construct a concrete instance of `HostedPrivateVirtualInterfaceAccepterArrayInput` via: 219 // 220 // HostedPrivateVirtualInterfaceAccepterArray{ HostedPrivateVirtualInterfaceAccepterArgs{...} } 221 type HostedPrivateVirtualInterfaceAccepterArrayInput interface { 222 pulumi.Input 223 224 ToHostedPrivateVirtualInterfaceAccepterArrayOutput() HostedPrivateVirtualInterfaceAccepterArrayOutput 225 ToHostedPrivateVirtualInterfaceAccepterArrayOutputWithContext(context.Context) HostedPrivateVirtualInterfaceAccepterArrayOutput 226 } 227 228 type HostedPrivateVirtualInterfaceAccepterArray []HostedPrivateVirtualInterfaceAccepterInput 229 230 func (HostedPrivateVirtualInterfaceAccepterArray) ElementType() reflect.Type { 231 return reflect.TypeOf((*[]*HostedPrivateVirtualInterfaceAccepter)(nil)).Elem() 232 } 233 234 func (i HostedPrivateVirtualInterfaceAccepterArray) ToHostedPrivateVirtualInterfaceAccepterArrayOutput() HostedPrivateVirtualInterfaceAccepterArrayOutput { 235 return i.ToHostedPrivateVirtualInterfaceAccepterArrayOutputWithContext(context.Background()) 236 } 237 238 func (i HostedPrivateVirtualInterfaceAccepterArray) ToHostedPrivateVirtualInterfaceAccepterArrayOutputWithContext(ctx context.Context) HostedPrivateVirtualInterfaceAccepterArrayOutput { 239 return pulumi.ToOutputWithContext(ctx, i).(HostedPrivateVirtualInterfaceAccepterArrayOutput) 240 } 241 242 // HostedPrivateVirtualInterfaceAccepterMapInput is an input type that accepts HostedPrivateVirtualInterfaceAccepterMap and HostedPrivateVirtualInterfaceAccepterMapOutput values. 243 // You can construct a concrete instance of `HostedPrivateVirtualInterfaceAccepterMapInput` via: 244 // 245 // HostedPrivateVirtualInterfaceAccepterMap{ "key": HostedPrivateVirtualInterfaceAccepterArgs{...} } 246 type HostedPrivateVirtualInterfaceAccepterMapInput interface { 247 pulumi.Input 248 249 ToHostedPrivateVirtualInterfaceAccepterMapOutput() HostedPrivateVirtualInterfaceAccepterMapOutput 250 ToHostedPrivateVirtualInterfaceAccepterMapOutputWithContext(context.Context) HostedPrivateVirtualInterfaceAccepterMapOutput 251 } 252 253 type HostedPrivateVirtualInterfaceAccepterMap map[string]HostedPrivateVirtualInterfaceAccepterInput 254 255 func (HostedPrivateVirtualInterfaceAccepterMap) ElementType() reflect.Type { 256 return reflect.TypeOf((*map[string]*HostedPrivateVirtualInterfaceAccepter)(nil)).Elem() 257 } 258 259 func (i HostedPrivateVirtualInterfaceAccepterMap) ToHostedPrivateVirtualInterfaceAccepterMapOutput() HostedPrivateVirtualInterfaceAccepterMapOutput { 260 return i.ToHostedPrivateVirtualInterfaceAccepterMapOutputWithContext(context.Background()) 261 } 262 263 func (i HostedPrivateVirtualInterfaceAccepterMap) ToHostedPrivateVirtualInterfaceAccepterMapOutputWithContext(ctx context.Context) HostedPrivateVirtualInterfaceAccepterMapOutput { 264 return pulumi.ToOutputWithContext(ctx, i).(HostedPrivateVirtualInterfaceAccepterMapOutput) 265 } 266 267 type HostedPrivateVirtualInterfaceAccepterOutput struct{ *pulumi.OutputState } 268 269 func (HostedPrivateVirtualInterfaceAccepterOutput) ElementType() reflect.Type { 270 return reflect.TypeOf((**HostedPrivateVirtualInterfaceAccepter)(nil)).Elem() 271 } 272 273 func (o HostedPrivateVirtualInterfaceAccepterOutput) ToHostedPrivateVirtualInterfaceAccepterOutput() HostedPrivateVirtualInterfaceAccepterOutput { 274 return o 275 } 276 277 func (o HostedPrivateVirtualInterfaceAccepterOutput) ToHostedPrivateVirtualInterfaceAccepterOutputWithContext(ctx context.Context) HostedPrivateVirtualInterfaceAccepterOutput { 278 return o 279 } 280 281 // The ARN of the virtual interface. 282 func (o HostedPrivateVirtualInterfaceAccepterOutput) Arn() pulumi.StringOutput { 283 return o.ApplyT(func(v *HostedPrivateVirtualInterfaceAccepter) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 284 } 285 286 // The ID of the Direct Connect gateway to which to connect the virtual interface. 287 func (o HostedPrivateVirtualInterfaceAccepterOutput) DxGatewayId() pulumi.StringPtrOutput { 288 return o.ApplyT(func(v *HostedPrivateVirtualInterfaceAccepter) pulumi.StringPtrOutput { return v.DxGatewayId }).(pulumi.StringPtrOutput) 289 } 290 291 // A map of tags to assign to the resource. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 292 func (o HostedPrivateVirtualInterfaceAccepterOutput) Tags() pulumi.StringMapOutput { 293 return o.ApplyT(func(v *HostedPrivateVirtualInterfaceAccepter) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput) 294 } 295 296 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 297 // 298 // Deprecated: Please use `tags` instead. 299 func (o HostedPrivateVirtualInterfaceAccepterOutput) TagsAll() pulumi.StringMapOutput { 300 return o.ApplyT(func(v *HostedPrivateVirtualInterfaceAccepter) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput) 301 } 302 303 // The ID of the Direct Connect virtual interface to accept. 304 func (o HostedPrivateVirtualInterfaceAccepterOutput) VirtualInterfaceId() pulumi.StringOutput { 305 return o.ApplyT(func(v *HostedPrivateVirtualInterfaceAccepter) pulumi.StringOutput { return v.VirtualInterfaceId }).(pulumi.StringOutput) 306 } 307 308 // The ID of the virtual private gateway to which to connect the virtual interface. 309 func (o HostedPrivateVirtualInterfaceAccepterOutput) VpnGatewayId() pulumi.StringPtrOutput { 310 return o.ApplyT(func(v *HostedPrivateVirtualInterfaceAccepter) pulumi.StringPtrOutput { return v.VpnGatewayId }).(pulumi.StringPtrOutput) 311 } 312 313 type HostedPrivateVirtualInterfaceAccepterArrayOutput struct{ *pulumi.OutputState } 314 315 func (HostedPrivateVirtualInterfaceAccepterArrayOutput) ElementType() reflect.Type { 316 return reflect.TypeOf((*[]*HostedPrivateVirtualInterfaceAccepter)(nil)).Elem() 317 } 318 319 func (o HostedPrivateVirtualInterfaceAccepterArrayOutput) ToHostedPrivateVirtualInterfaceAccepterArrayOutput() HostedPrivateVirtualInterfaceAccepterArrayOutput { 320 return o 321 } 322 323 func (o HostedPrivateVirtualInterfaceAccepterArrayOutput) ToHostedPrivateVirtualInterfaceAccepterArrayOutputWithContext(ctx context.Context) HostedPrivateVirtualInterfaceAccepterArrayOutput { 324 return o 325 } 326 327 func (o HostedPrivateVirtualInterfaceAccepterArrayOutput) Index(i pulumi.IntInput) HostedPrivateVirtualInterfaceAccepterOutput { 328 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *HostedPrivateVirtualInterfaceAccepter { 329 return vs[0].([]*HostedPrivateVirtualInterfaceAccepter)[vs[1].(int)] 330 }).(HostedPrivateVirtualInterfaceAccepterOutput) 331 } 332 333 type HostedPrivateVirtualInterfaceAccepterMapOutput struct{ *pulumi.OutputState } 334 335 func (HostedPrivateVirtualInterfaceAccepterMapOutput) ElementType() reflect.Type { 336 return reflect.TypeOf((*map[string]*HostedPrivateVirtualInterfaceAccepter)(nil)).Elem() 337 } 338 339 func (o HostedPrivateVirtualInterfaceAccepterMapOutput) ToHostedPrivateVirtualInterfaceAccepterMapOutput() HostedPrivateVirtualInterfaceAccepterMapOutput { 340 return o 341 } 342 343 func (o HostedPrivateVirtualInterfaceAccepterMapOutput) ToHostedPrivateVirtualInterfaceAccepterMapOutputWithContext(ctx context.Context) HostedPrivateVirtualInterfaceAccepterMapOutput { 344 return o 345 } 346 347 func (o HostedPrivateVirtualInterfaceAccepterMapOutput) MapIndex(k pulumi.StringInput) HostedPrivateVirtualInterfaceAccepterOutput { 348 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *HostedPrivateVirtualInterfaceAccepter { 349 return vs[0].(map[string]*HostedPrivateVirtualInterfaceAccepter)[vs[1].(string)] 350 }).(HostedPrivateVirtualInterfaceAccepterOutput) 351 } 352 353 func init() { 354 pulumi.RegisterInputType(reflect.TypeOf((*HostedPrivateVirtualInterfaceAccepterInput)(nil)).Elem(), &HostedPrivateVirtualInterfaceAccepter{}) 355 pulumi.RegisterInputType(reflect.TypeOf((*HostedPrivateVirtualInterfaceAccepterArrayInput)(nil)).Elem(), HostedPrivateVirtualInterfaceAccepterArray{}) 356 pulumi.RegisterInputType(reflect.TypeOf((*HostedPrivateVirtualInterfaceAccepterMapInput)(nil)).Elem(), HostedPrivateVirtualInterfaceAccepterMap{}) 357 pulumi.RegisterOutputType(HostedPrivateVirtualInterfaceAccepterOutput{}) 358 pulumi.RegisterOutputType(HostedPrivateVirtualInterfaceAccepterArrayOutput{}) 359 pulumi.RegisterOutputType(HostedPrivateVirtualInterfaceAccepterMapOutput{}) 360 }