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