github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/directconnect/gatewayAssociationProposal.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  // Manages a Direct Connect Gateway Association Proposal, typically for enabling cross-account associations. For single account associations, see the `directconnect.GatewayAssociation` resource.
    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/directconnect"
    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 := directconnect.NewGatewayAssociationProposal(ctx, "example", &directconnect.GatewayAssociationProposalArgs{
    33  //				DxGatewayId:             pulumi.Any(exampleAwsDxGateway.Id),
    34  //				DxGatewayOwnerAccountId: pulumi.Any(exampleAwsDxGateway.OwnerAccountId),
    35  //				AssociatedGatewayId:     pulumi.Any(exampleAwsVpnGateway.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 a proposal ID, Direct Connect Gateway ID and associated gateway ID separated by `/`:
    50  //
    51  // __With `pulumi import`__, import Direct Connect Gateway Association Proposals using either a proposal ID or proposal ID, Direct Connect Gateway ID and associated gateway ID separated by `/`. For example:
    52  //
    53  // Using a proposal ID:
    54  //
    55  // ```sh
    56  // $ pulumi import aws:directconnect/gatewayAssociationProposal:GatewayAssociationProposal example ac90e981-b718-4364-872d-65478c84fafe
    57  // ```
    58  // Using a proposal ID, Direct Connect Gateway ID and associated gateway ID separated by `/`:
    59  //
    60  // ```sh
    61  // $ pulumi import aws:directconnect/gatewayAssociationProposal:GatewayAssociationProposal example ac90e981-b718-4364-872d-65478c84fafe/abcd1234-dcba-5678-be23-cdef9876ab45/vgw-12345678
    62  // ```
    63  // The latter case is useful when a previous proposal has been accepted and deleted by AWS.
    64  // The `aws_dx_gateway_association_proposal` resource will then represent a pseudo-proposal for the same Direct Connect Gateway and associated gateway. If no previous proposal is available, use a tool like [`uuidgen`](http://manpages.ubuntu.com/manpages/bionic/man1/uuidgen.1.html) to generate a new random pseudo-proposal ID.
    65  type GatewayAssociationProposal struct {
    66  	pulumi.CustomResourceState
    67  
    68  	// VPC prefixes (CIDRs) to advertise to the Direct Connect gateway. Defaults to the CIDR block of the VPC associated with the Virtual Gateway. To enable drift detection, must be configured.
    69  	AllowedPrefixes pulumi.StringArrayOutput `pulumi:"allowedPrefixes"`
    70  	// The ID of the VGW or transit gateway with which to associate the Direct Connect gateway.
    71  	AssociatedGatewayId pulumi.StringOutput `pulumi:"associatedGatewayId"`
    72  	// The ID of the AWS account that owns the VGW or transit gateway with which to associate the Direct Connect gateway.
    73  	AssociatedGatewayOwnerAccountId pulumi.StringOutput `pulumi:"associatedGatewayOwnerAccountId"`
    74  	// The type of the associated gateway, `transitGateway` or `virtualPrivateGateway`.
    75  	AssociatedGatewayType pulumi.StringOutput `pulumi:"associatedGatewayType"`
    76  	// Direct Connect Gateway identifier.
    77  	DxGatewayId pulumi.StringOutput `pulumi:"dxGatewayId"`
    78  	// AWS Account identifier of the Direct Connect Gateway's owner.
    79  	DxGatewayOwnerAccountId pulumi.StringOutput `pulumi:"dxGatewayOwnerAccountId"`
    80  }
    81  
    82  // NewGatewayAssociationProposal registers a new resource with the given unique name, arguments, and options.
    83  func NewGatewayAssociationProposal(ctx *pulumi.Context,
    84  	name string, args *GatewayAssociationProposalArgs, opts ...pulumi.ResourceOption) (*GatewayAssociationProposal, error) {
    85  	if args == nil {
    86  		return nil, errors.New("missing one or more required arguments")
    87  	}
    88  
    89  	if args.AssociatedGatewayId == nil {
    90  		return nil, errors.New("invalid value for required argument 'AssociatedGatewayId'")
    91  	}
    92  	if args.DxGatewayId == nil {
    93  		return nil, errors.New("invalid value for required argument 'DxGatewayId'")
    94  	}
    95  	if args.DxGatewayOwnerAccountId == nil {
    96  		return nil, errors.New("invalid value for required argument 'DxGatewayOwnerAccountId'")
    97  	}
    98  	opts = internal.PkgResourceDefaultOpts(opts)
    99  	var resource GatewayAssociationProposal
   100  	err := ctx.RegisterResource("aws:directconnect/gatewayAssociationProposal:GatewayAssociationProposal", name, args, &resource, opts...)
   101  	if err != nil {
   102  		return nil, err
   103  	}
   104  	return &resource, nil
   105  }
   106  
   107  // GetGatewayAssociationProposal gets an existing GatewayAssociationProposal resource's state with the given name, ID, and optional
   108  // state properties that are used to uniquely qualify the lookup (nil if not required).
   109  func GetGatewayAssociationProposal(ctx *pulumi.Context,
   110  	name string, id pulumi.IDInput, state *GatewayAssociationProposalState, opts ...pulumi.ResourceOption) (*GatewayAssociationProposal, error) {
   111  	var resource GatewayAssociationProposal
   112  	err := ctx.ReadResource("aws:directconnect/gatewayAssociationProposal:GatewayAssociationProposal", name, id, state, &resource, opts...)
   113  	if err != nil {
   114  		return nil, err
   115  	}
   116  	return &resource, nil
   117  }
   118  
   119  // Input properties used for looking up and filtering GatewayAssociationProposal resources.
   120  type gatewayAssociationProposalState struct {
   121  	// VPC prefixes (CIDRs) to advertise to the Direct Connect gateway. Defaults to the CIDR block of the VPC associated with the Virtual Gateway. To enable drift detection, must be configured.
   122  	AllowedPrefixes []string `pulumi:"allowedPrefixes"`
   123  	// The ID of the VGW or transit gateway with which to associate the Direct Connect gateway.
   124  	AssociatedGatewayId *string `pulumi:"associatedGatewayId"`
   125  	// The ID of the AWS account that owns the VGW or transit gateway with which to associate the Direct Connect gateway.
   126  	AssociatedGatewayOwnerAccountId *string `pulumi:"associatedGatewayOwnerAccountId"`
   127  	// The type of the associated gateway, `transitGateway` or `virtualPrivateGateway`.
   128  	AssociatedGatewayType *string `pulumi:"associatedGatewayType"`
   129  	// Direct Connect Gateway identifier.
   130  	DxGatewayId *string `pulumi:"dxGatewayId"`
   131  	// AWS Account identifier of the Direct Connect Gateway's owner.
   132  	DxGatewayOwnerAccountId *string `pulumi:"dxGatewayOwnerAccountId"`
   133  }
   134  
   135  type GatewayAssociationProposalState struct {
   136  	// VPC prefixes (CIDRs) to advertise to the Direct Connect gateway. Defaults to the CIDR block of the VPC associated with the Virtual Gateway. To enable drift detection, must be configured.
   137  	AllowedPrefixes pulumi.StringArrayInput
   138  	// The ID of the VGW or transit gateway with which to associate the Direct Connect gateway.
   139  	AssociatedGatewayId pulumi.StringPtrInput
   140  	// The ID of the AWS account that owns the VGW or transit gateway with which to associate the Direct Connect gateway.
   141  	AssociatedGatewayOwnerAccountId pulumi.StringPtrInput
   142  	// The type of the associated gateway, `transitGateway` or `virtualPrivateGateway`.
   143  	AssociatedGatewayType pulumi.StringPtrInput
   144  	// Direct Connect Gateway identifier.
   145  	DxGatewayId pulumi.StringPtrInput
   146  	// AWS Account identifier of the Direct Connect Gateway's owner.
   147  	DxGatewayOwnerAccountId pulumi.StringPtrInput
   148  }
   149  
   150  func (GatewayAssociationProposalState) ElementType() reflect.Type {
   151  	return reflect.TypeOf((*gatewayAssociationProposalState)(nil)).Elem()
   152  }
   153  
   154  type gatewayAssociationProposalArgs struct {
   155  	// VPC prefixes (CIDRs) to advertise to the Direct Connect gateway. Defaults to the CIDR block of the VPC associated with the Virtual Gateway. To enable drift detection, must be configured.
   156  	AllowedPrefixes []string `pulumi:"allowedPrefixes"`
   157  	// The ID of the VGW or transit gateway with which to associate the Direct Connect gateway.
   158  	AssociatedGatewayId string `pulumi:"associatedGatewayId"`
   159  	// Direct Connect Gateway identifier.
   160  	DxGatewayId string `pulumi:"dxGatewayId"`
   161  	// AWS Account identifier of the Direct Connect Gateway's owner.
   162  	DxGatewayOwnerAccountId string `pulumi:"dxGatewayOwnerAccountId"`
   163  }
   164  
   165  // The set of arguments for constructing a GatewayAssociationProposal resource.
   166  type GatewayAssociationProposalArgs struct {
   167  	// VPC prefixes (CIDRs) to advertise to the Direct Connect gateway. Defaults to the CIDR block of the VPC associated with the Virtual Gateway. To enable drift detection, must be configured.
   168  	AllowedPrefixes pulumi.StringArrayInput
   169  	// The ID of the VGW or transit gateway with which to associate the Direct Connect gateway.
   170  	AssociatedGatewayId pulumi.StringInput
   171  	// Direct Connect Gateway identifier.
   172  	DxGatewayId pulumi.StringInput
   173  	// AWS Account identifier of the Direct Connect Gateway's owner.
   174  	DxGatewayOwnerAccountId pulumi.StringInput
   175  }
   176  
   177  func (GatewayAssociationProposalArgs) ElementType() reflect.Type {
   178  	return reflect.TypeOf((*gatewayAssociationProposalArgs)(nil)).Elem()
   179  }
   180  
   181  type GatewayAssociationProposalInput interface {
   182  	pulumi.Input
   183  
   184  	ToGatewayAssociationProposalOutput() GatewayAssociationProposalOutput
   185  	ToGatewayAssociationProposalOutputWithContext(ctx context.Context) GatewayAssociationProposalOutput
   186  }
   187  
   188  func (*GatewayAssociationProposal) ElementType() reflect.Type {
   189  	return reflect.TypeOf((**GatewayAssociationProposal)(nil)).Elem()
   190  }
   191  
   192  func (i *GatewayAssociationProposal) ToGatewayAssociationProposalOutput() GatewayAssociationProposalOutput {
   193  	return i.ToGatewayAssociationProposalOutputWithContext(context.Background())
   194  }
   195  
   196  func (i *GatewayAssociationProposal) ToGatewayAssociationProposalOutputWithContext(ctx context.Context) GatewayAssociationProposalOutput {
   197  	return pulumi.ToOutputWithContext(ctx, i).(GatewayAssociationProposalOutput)
   198  }
   199  
   200  // GatewayAssociationProposalArrayInput is an input type that accepts GatewayAssociationProposalArray and GatewayAssociationProposalArrayOutput values.
   201  // You can construct a concrete instance of `GatewayAssociationProposalArrayInput` via:
   202  //
   203  //	GatewayAssociationProposalArray{ GatewayAssociationProposalArgs{...} }
   204  type GatewayAssociationProposalArrayInput interface {
   205  	pulumi.Input
   206  
   207  	ToGatewayAssociationProposalArrayOutput() GatewayAssociationProposalArrayOutput
   208  	ToGatewayAssociationProposalArrayOutputWithContext(context.Context) GatewayAssociationProposalArrayOutput
   209  }
   210  
   211  type GatewayAssociationProposalArray []GatewayAssociationProposalInput
   212  
   213  func (GatewayAssociationProposalArray) ElementType() reflect.Type {
   214  	return reflect.TypeOf((*[]*GatewayAssociationProposal)(nil)).Elem()
   215  }
   216  
   217  func (i GatewayAssociationProposalArray) ToGatewayAssociationProposalArrayOutput() GatewayAssociationProposalArrayOutput {
   218  	return i.ToGatewayAssociationProposalArrayOutputWithContext(context.Background())
   219  }
   220  
   221  func (i GatewayAssociationProposalArray) ToGatewayAssociationProposalArrayOutputWithContext(ctx context.Context) GatewayAssociationProposalArrayOutput {
   222  	return pulumi.ToOutputWithContext(ctx, i).(GatewayAssociationProposalArrayOutput)
   223  }
   224  
   225  // GatewayAssociationProposalMapInput is an input type that accepts GatewayAssociationProposalMap and GatewayAssociationProposalMapOutput values.
   226  // You can construct a concrete instance of `GatewayAssociationProposalMapInput` via:
   227  //
   228  //	GatewayAssociationProposalMap{ "key": GatewayAssociationProposalArgs{...} }
   229  type GatewayAssociationProposalMapInput interface {
   230  	pulumi.Input
   231  
   232  	ToGatewayAssociationProposalMapOutput() GatewayAssociationProposalMapOutput
   233  	ToGatewayAssociationProposalMapOutputWithContext(context.Context) GatewayAssociationProposalMapOutput
   234  }
   235  
   236  type GatewayAssociationProposalMap map[string]GatewayAssociationProposalInput
   237  
   238  func (GatewayAssociationProposalMap) ElementType() reflect.Type {
   239  	return reflect.TypeOf((*map[string]*GatewayAssociationProposal)(nil)).Elem()
   240  }
   241  
   242  func (i GatewayAssociationProposalMap) ToGatewayAssociationProposalMapOutput() GatewayAssociationProposalMapOutput {
   243  	return i.ToGatewayAssociationProposalMapOutputWithContext(context.Background())
   244  }
   245  
   246  func (i GatewayAssociationProposalMap) ToGatewayAssociationProposalMapOutputWithContext(ctx context.Context) GatewayAssociationProposalMapOutput {
   247  	return pulumi.ToOutputWithContext(ctx, i).(GatewayAssociationProposalMapOutput)
   248  }
   249  
   250  type GatewayAssociationProposalOutput struct{ *pulumi.OutputState }
   251  
   252  func (GatewayAssociationProposalOutput) ElementType() reflect.Type {
   253  	return reflect.TypeOf((**GatewayAssociationProposal)(nil)).Elem()
   254  }
   255  
   256  func (o GatewayAssociationProposalOutput) ToGatewayAssociationProposalOutput() GatewayAssociationProposalOutput {
   257  	return o
   258  }
   259  
   260  func (o GatewayAssociationProposalOutput) ToGatewayAssociationProposalOutputWithContext(ctx context.Context) GatewayAssociationProposalOutput {
   261  	return o
   262  }
   263  
   264  // VPC prefixes (CIDRs) to advertise to the Direct Connect gateway. Defaults to the CIDR block of the VPC associated with the Virtual Gateway. To enable drift detection, must be configured.
   265  func (o GatewayAssociationProposalOutput) AllowedPrefixes() pulumi.StringArrayOutput {
   266  	return o.ApplyT(func(v *GatewayAssociationProposal) pulumi.StringArrayOutput { return v.AllowedPrefixes }).(pulumi.StringArrayOutput)
   267  }
   268  
   269  // The ID of the VGW or transit gateway with which to associate the Direct Connect gateway.
   270  func (o GatewayAssociationProposalOutput) AssociatedGatewayId() pulumi.StringOutput {
   271  	return o.ApplyT(func(v *GatewayAssociationProposal) pulumi.StringOutput { return v.AssociatedGatewayId }).(pulumi.StringOutput)
   272  }
   273  
   274  // The ID of the AWS account that owns the VGW or transit gateway with which to associate the Direct Connect gateway.
   275  func (o GatewayAssociationProposalOutput) AssociatedGatewayOwnerAccountId() pulumi.StringOutput {
   276  	return o.ApplyT(func(v *GatewayAssociationProposal) pulumi.StringOutput { return v.AssociatedGatewayOwnerAccountId }).(pulumi.StringOutput)
   277  }
   278  
   279  // The type of the associated gateway, `transitGateway` or `virtualPrivateGateway`.
   280  func (o GatewayAssociationProposalOutput) AssociatedGatewayType() pulumi.StringOutput {
   281  	return o.ApplyT(func(v *GatewayAssociationProposal) pulumi.StringOutput { return v.AssociatedGatewayType }).(pulumi.StringOutput)
   282  }
   283  
   284  // Direct Connect Gateway identifier.
   285  func (o GatewayAssociationProposalOutput) DxGatewayId() pulumi.StringOutput {
   286  	return o.ApplyT(func(v *GatewayAssociationProposal) pulumi.StringOutput { return v.DxGatewayId }).(pulumi.StringOutput)
   287  }
   288  
   289  // AWS Account identifier of the Direct Connect Gateway's owner.
   290  func (o GatewayAssociationProposalOutput) DxGatewayOwnerAccountId() pulumi.StringOutput {
   291  	return o.ApplyT(func(v *GatewayAssociationProposal) pulumi.StringOutput { return v.DxGatewayOwnerAccountId }).(pulumi.StringOutput)
   292  }
   293  
   294  type GatewayAssociationProposalArrayOutput struct{ *pulumi.OutputState }
   295  
   296  func (GatewayAssociationProposalArrayOutput) ElementType() reflect.Type {
   297  	return reflect.TypeOf((*[]*GatewayAssociationProposal)(nil)).Elem()
   298  }
   299  
   300  func (o GatewayAssociationProposalArrayOutput) ToGatewayAssociationProposalArrayOutput() GatewayAssociationProposalArrayOutput {
   301  	return o
   302  }
   303  
   304  func (o GatewayAssociationProposalArrayOutput) ToGatewayAssociationProposalArrayOutputWithContext(ctx context.Context) GatewayAssociationProposalArrayOutput {
   305  	return o
   306  }
   307  
   308  func (o GatewayAssociationProposalArrayOutput) Index(i pulumi.IntInput) GatewayAssociationProposalOutput {
   309  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *GatewayAssociationProposal {
   310  		return vs[0].([]*GatewayAssociationProposal)[vs[1].(int)]
   311  	}).(GatewayAssociationProposalOutput)
   312  }
   313  
   314  type GatewayAssociationProposalMapOutput struct{ *pulumi.OutputState }
   315  
   316  func (GatewayAssociationProposalMapOutput) ElementType() reflect.Type {
   317  	return reflect.TypeOf((*map[string]*GatewayAssociationProposal)(nil)).Elem()
   318  }
   319  
   320  func (o GatewayAssociationProposalMapOutput) ToGatewayAssociationProposalMapOutput() GatewayAssociationProposalMapOutput {
   321  	return o
   322  }
   323  
   324  func (o GatewayAssociationProposalMapOutput) ToGatewayAssociationProposalMapOutputWithContext(ctx context.Context) GatewayAssociationProposalMapOutput {
   325  	return o
   326  }
   327  
   328  func (o GatewayAssociationProposalMapOutput) MapIndex(k pulumi.StringInput) GatewayAssociationProposalOutput {
   329  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *GatewayAssociationProposal {
   330  		return vs[0].(map[string]*GatewayAssociationProposal)[vs[1].(string)]
   331  	}).(GatewayAssociationProposalOutput)
   332  }
   333  
   334  func init() {
   335  	pulumi.RegisterInputType(reflect.TypeOf((*GatewayAssociationProposalInput)(nil)).Elem(), &GatewayAssociationProposal{})
   336  	pulumi.RegisterInputType(reflect.TypeOf((*GatewayAssociationProposalArrayInput)(nil)).Elem(), GatewayAssociationProposalArray{})
   337  	pulumi.RegisterInputType(reflect.TypeOf((*GatewayAssociationProposalMapInput)(nil)).Elem(), GatewayAssociationProposalMap{})
   338  	pulumi.RegisterOutputType(GatewayAssociationProposalOutput{})
   339  	pulumi.RegisterOutputType(GatewayAssociationProposalArrayOutput{})
   340  	pulumi.RegisterOutputType(GatewayAssociationProposalMapOutput{})
   341  }