github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/ec2/vpnGateway.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 ec2
     5  
     6  import (
     7  	"context"
     8  	"reflect"
     9  
    10  	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
    11  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    12  )
    13  
    14  // Provides a resource to create a VPC VPN Gateway.
    15  //
    16  // ## Example Usage
    17  //
    18  // <!--Start PulumiCodeChooser -->
    19  // ```go
    20  // package main
    21  //
    22  // import (
    23  //
    24  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
    25  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    26  //
    27  // )
    28  //
    29  //	func main() {
    30  //		pulumi.Run(func(ctx *pulumi.Context) error {
    31  //			_, err := ec2.NewVpnGateway(ctx, "vpn_gw", &ec2.VpnGatewayArgs{
    32  //				VpcId: pulumi.Any(main.Id),
    33  //				Tags: pulumi.StringMap{
    34  //					"Name": pulumi.String("main"),
    35  //				},
    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 VPN Gateways using the VPN gateway `id`. For example:
    50  //
    51  // ```sh
    52  // $ pulumi import aws:ec2/vpnGateway:VpnGateway testvpngateway vgw-9a4cacf3
    53  // ```
    54  type VpnGateway struct {
    55  	pulumi.CustomResourceState
    56  
    57  	// The Autonomous System Number (ASN) for the Amazon side of the gateway. If you don't specify an ASN, the virtual private gateway is created with the default ASN.
    58  	AmazonSideAsn pulumi.StringOutput `pulumi:"amazonSideAsn"`
    59  	// Amazon Resource Name (ARN) of the VPN Gateway.
    60  	Arn pulumi.StringOutput `pulumi:"arn"`
    61  	// The Availability Zone for the virtual private gateway.
    62  	AvailabilityZone pulumi.StringPtrOutput `pulumi:"availabilityZone"`
    63  	// 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.
    64  	Tags pulumi.StringMapOutput `pulumi:"tags"`
    65  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
    66  	//
    67  	// Deprecated: Please use `tags` instead.
    68  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
    69  	// The VPC ID to create in.
    70  	VpcId pulumi.StringOutput `pulumi:"vpcId"`
    71  }
    72  
    73  // NewVpnGateway registers a new resource with the given unique name, arguments, and options.
    74  func NewVpnGateway(ctx *pulumi.Context,
    75  	name string, args *VpnGatewayArgs, opts ...pulumi.ResourceOption) (*VpnGateway, error) {
    76  	if args == nil {
    77  		args = &VpnGatewayArgs{}
    78  	}
    79  
    80  	opts = internal.PkgResourceDefaultOpts(opts)
    81  	var resource VpnGateway
    82  	err := ctx.RegisterResource("aws:ec2/vpnGateway:VpnGateway", name, args, &resource, opts...)
    83  	if err != nil {
    84  		return nil, err
    85  	}
    86  	return &resource, nil
    87  }
    88  
    89  // GetVpnGateway gets an existing VpnGateway resource's state with the given name, ID, and optional
    90  // state properties that are used to uniquely qualify the lookup (nil if not required).
    91  func GetVpnGateway(ctx *pulumi.Context,
    92  	name string, id pulumi.IDInput, state *VpnGatewayState, opts ...pulumi.ResourceOption) (*VpnGateway, error) {
    93  	var resource VpnGateway
    94  	err := ctx.ReadResource("aws:ec2/vpnGateway:VpnGateway", name, id, state, &resource, opts...)
    95  	if err != nil {
    96  		return nil, err
    97  	}
    98  	return &resource, nil
    99  }
   100  
   101  // Input properties used for looking up and filtering VpnGateway resources.
   102  type vpnGatewayState struct {
   103  	// The Autonomous System Number (ASN) for the Amazon side of the gateway. If you don't specify an ASN, the virtual private gateway is created with the default ASN.
   104  	AmazonSideAsn *string `pulumi:"amazonSideAsn"`
   105  	// Amazon Resource Name (ARN) of the VPN Gateway.
   106  	Arn *string `pulumi:"arn"`
   107  	// The Availability Zone for the virtual private gateway.
   108  	AvailabilityZone *string `pulumi:"availabilityZone"`
   109  	// 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.
   110  	Tags map[string]string `pulumi:"tags"`
   111  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   112  	//
   113  	// Deprecated: Please use `tags` instead.
   114  	TagsAll map[string]string `pulumi:"tagsAll"`
   115  	// The VPC ID to create in.
   116  	VpcId *string `pulumi:"vpcId"`
   117  }
   118  
   119  type VpnGatewayState struct {
   120  	// The Autonomous System Number (ASN) for the Amazon side of the gateway. If you don't specify an ASN, the virtual private gateway is created with the default ASN.
   121  	AmazonSideAsn pulumi.StringPtrInput
   122  	// Amazon Resource Name (ARN) of the VPN Gateway.
   123  	Arn pulumi.StringPtrInput
   124  	// The Availability Zone for the virtual private gateway.
   125  	AvailabilityZone pulumi.StringPtrInput
   126  	// 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.
   127  	Tags pulumi.StringMapInput
   128  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   129  	//
   130  	// Deprecated: Please use `tags` instead.
   131  	TagsAll pulumi.StringMapInput
   132  	// The VPC ID to create in.
   133  	VpcId pulumi.StringPtrInput
   134  }
   135  
   136  func (VpnGatewayState) ElementType() reflect.Type {
   137  	return reflect.TypeOf((*vpnGatewayState)(nil)).Elem()
   138  }
   139  
   140  type vpnGatewayArgs struct {
   141  	// The Autonomous System Number (ASN) for the Amazon side of the gateway. If you don't specify an ASN, the virtual private gateway is created with the default ASN.
   142  	AmazonSideAsn *string `pulumi:"amazonSideAsn"`
   143  	// The Availability Zone for the virtual private gateway.
   144  	AvailabilityZone *string `pulumi:"availabilityZone"`
   145  	// 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.
   146  	Tags map[string]string `pulumi:"tags"`
   147  	// The VPC ID to create in.
   148  	VpcId *string `pulumi:"vpcId"`
   149  }
   150  
   151  // The set of arguments for constructing a VpnGateway resource.
   152  type VpnGatewayArgs struct {
   153  	// The Autonomous System Number (ASN) for the Amazon side of the gateway. If you don't specify an ASN, the virtual private gateway is created with the default ASN.
   154  	AmazonSideAsn pulumi.StringPtrInput
   155  	// The Availability Zone for the virtual private gateway.
   156  	AvailabilityZone pulumi.StringPtrInput
   157  	// 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.
   158  	Tags pulumi.StringMapInput
   159  	// The VPC ID to create in.
   160  	VpcId pulumi.StringPtrInput
   161  }
   162  
   163  func (VpnGatewayArgs) ElementType() reflect.Type {
   164  	return reflect.TypeOf((*vpnGatewayArgs)(nil)).Elem()
   165  }
   166  
   167  type VpnGatewayInput interface {
   168  	pulumi.Input
   169  
   170  	ToVpnGatewayOutput() VpnGatewayOutput
   171  	ToVpnGatewayOutputWithContext(ctx context.Context) VpnGatewayOutput
   172  }
   173  
   174  func (*VpnGateway) ElementType() reflect.Type {
   175  	return reflect.TypeOf((**VpnGateway)(nil)).Elem()
   176  }
   177  
   178  func (i *VpnGateway) ToVpnGatewayOutput() VpnGatewayOutput {
   179  	return i.ToVpnGatewayOutputWithContext(context.Background())
   180  }
   181  
   182  func (i *VpnGateway) ToVpnGatewayOutputWithContext(ctx context.Context) VpnGatewayOutput {
   183  	return pulumi.ToOutputWithContext(ctx, i).(VpnGatewayOutput)
   184  }
   185  
   186  // VpnGatewayArrayInput is an input type that accepts VpnGatewayArray and VpnGatewayArrayOutput values.
   187  // You can construct a concrete instance of `VpnGatewayArrayInput` via:
   188  //
   189  //	VpnGatewayArray{ VpnGatewayArgs{...} }
   190  type VpnGatewayArrayInput interface {
   191  	pulumi.Input
   192  
   193  	ToVpnGatewayArrayOutput() VpnGatewayArrayOutput
   194  	ToVpnGatewayArrayOutputWithContext(context.Context) VpnGatewayArrayOutput
   195  }
   196  
   197  type VpnGatewayArray []VpnGatewayInput
   198  
   199  func (VpnGatewayArray) ElementType() reflect.Type {
   200  	return reflect.TypeOf((*[]*VpnGateway)(nil)).Elem()
   201  }
   202  
   203  func (i VpnGatewayArray) ToVpnGatewayArrayOutput() VpnGatewayArrayOutput {
   204  	return i.ToVpnGatewayArrayOutputWithContext(context.Background())
   205  }
   206  
   207  func (i VpnGatewayArray) ToVpnGatewayArrayOutputWithContext(ctx context.Context) VpnGatewayArrayOutput {
   208  	return pulumi.ToOutputWithContext(ctx, i).(VpnGatewayArrayOutput)
   209  }
   210  
   211  // VpnGatewayMapInput is an input type that accepts VpnGatewayMap and VpnGatewayMapOutput values.
   212  // You can construct a concrete instance of `VpnGatewayMapInput` via:
   213  //
   214  //	VpnGatewayMap{ "key": VpnGatewayArgs{...} }
   215  type VpnGatewayMapInput interface {
   216  	pulumi.Input
   217  
   218  	ToVpnGatewayMapOutput() VpnGatewayMapOutput
   219  	ToVpnGatewayMapOutputWithContext(context.Context) VpnGatewayMapOutput
   220  }
   221  
   222  type VpnGatewayMap map[string]VpnGatewayInput
   223  
   224  func (VpnGatewayMap) ElementType() reflect.Type {
   225  	return reflect.TypeOf((*map[string]*VpnGateway)(nil)).Elem()
   226  }
   227  
   228  func (i VpnGatewayMap) ToVpnGatewayMapOutput() VpnGatewayMapOutput {
   229  	return i.ToVpnGatewayMapOutputWithContext(context.Background())
   230  }
   231  
   232  func (i VpnGatewayMap) ToVpnGatewayMapOutputWithContext(ctx context.Context) VpnGatewayMapOutput {
   233  	return pulumi.ToOutputWithContext(ctx, i).(VpnGatewayMapOutput)
   234  }
   235  
   236  type VpnGatewayOutput struct{ *pulumi.OutputState }
   237  
   238  func (VpnGatewayOutput) ElementType() reflect.Type {
   239  	return reflect.TypeOf((**VpnGateway)(nil)).Elem()
   240  }
   241  
   242  func (o VpnGatewayOutput) ToVpnGatewayOutput() VpnGatewayOutput {
   243  	return o
   244  }
   245  
   246  func (o VpnGatewayOutput) ToVpnGatewayOutputWithContext(ctx context.Context) VpnGatewayOutput {
   247  	return o
   248  }
   249  
   250  // The Autonomous System Number (ASN) for the Amazon side of the gateway. If you don't specify an ASN, the virtual private gateway is created with the default ASN.
   251  func (o VpnGatewayOutput) AmazonSideAsn() pulumi.StringOutput {
   252  	return o.ApplyT(func(v *VpnGateway) pulumi.StringOutput { return v.AmazonSideAsn }).(pulumi.StringOutput)
   253  }
   254  
   255  // Amazon Resource Name (ARN) of the VPN Gateway.
   256  func (o VpnGatewayOutput) Arn() pulumi.StringOutput {
   257  	return o.ApplyT(func(v *VpnGateway) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   258  }
   259  
   260  // The Availability Zone for the virtual private gateway.
   261  func (o VpnGatewayOutput) AvailabilityZone() pulumi.StringPtrOutput {
   262  	return o.ApplyT(func(v *VpnGateway) pulumi.StringPtrOutput { return v.AvailabilityZone }).(pulumi.StringPtrOutput)
   263  }
   264  
   265  // 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.
   266  func (o VpnGatewayOutput) Tags() pulumi.StringMapOutput {
   267  	return o.ApplyT(func(v *VpnGateway) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   268  }
   269  
   270  // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   271  //
   272  // Deprecated: Please use `tags` instead.
   273  func (o VpnGatewayOutput) TagsAll() pulumi.StringMapOutput {
   274  	return o.ApplyT(func(v *VpnGateway) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   275  }
   276  
   277  // The VPC ID to create in.
   278  func (o VpnGatewayOutput) VpcId() pulumi.StringOutput {
   279  	return o.ApplyT(func(v *VpnGateway) pulumi.StringOutput { return v.VpcId }).(pulumi.StringOutput)
   280  }
   281  
   282  type VpnGatewayArrayOutput struct{ *pulumi.OutputState }
   283  
   284  func (VpnGatewayArrayOutput) ElementType() reflect.Type {
   285  	return reflect.TypeOf((*[]*VpnGateway)(nil)).Elem()
   286  }
   287  
   288  func (o VpnGatewayArrayOutput) ToVpnGatewayArrayOutput() VpnGatewayArrayOutput {
   289  	return o
   290  }
   291  
   292  func (o VpnGatewayArrayOutput) ToVpnGatewayArrayOutputWithContext(ctx context.Context) VpnGatewayArrayOutput {
   293  	return o
   294  }
   295  
   296  func (o VpnGatewayArrayOutput) Index(i pulumi.IntInput) VpnGatewayOutput {
   297  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *VpnGateway {
   298  		return vs[0].([]*VpnGateway)[vs[1].(int)]
   299  	}).(VpnGatewayOutput)
   300  }
   301  
   302  type VpnGatewayMapOutput struct{ *pulumi.OutputState }
   303  
   304  func (VpnGatewayMapOutput) ElementType() reflect.Type {
   305  	return reflect.TypeOf((*map[string]*VpnGateway)(nil)).Elem()
   306  }
   307  
   308  func (o VpnGatewayMapOutput) ToVpnGatewayMapOutput() VpnGatewayMapOutput {
   309  	return o
   310  }
   311  
   312  func (o VpnGatewayMapOutput) ToVpnGatewayMapOutputWithContext(ctx context.Context) VpnGatewayMapOutput {
   313  	return o
   314  }
   315  
   316  func (o VpnGatewayMapOutput) MapIndex(k pulumi.StringInput) VpnGatewayOutput {
   317  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *VpnGateway {
   318  		return vs[0].(map[string]*VpnGateway)[vs[1].(string)]
   319  	}).(VpnGatewayOutput)
   320  }
   321  
   322  func init() {
   323  	pulumi.RegisterInputType(reflect.TypeOf((*VpnGatewayInput)(nil)).Elem(), &VpnGateway{})
   324  	pulumi.RegisterInputType(reflect.TypeOf((*VpnGatewayArrayInput)(nil)).Elem(), VpnGatewayArray{})
   325  	pulumi.RegisterInputType(reflect.TypeOf((*VpnGatewayMapInput)(nil)).Elem(), VpnGatewayMap{})
   326  	pulumi.RegisterOutputType(VpnGatewayOutput{})
   327  	pulumi.RegisterOutputType(VpnGatewayArrayOutput{})
   328  	pulumi.RegisterOutputType(VpnGatewayMapOutput{})
   329  }