github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/apigatewayv2/vpcLink.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 apigatewayv2
     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 an Amazon API Gateway Version 2 VPC Link.
    16  //
    17  // > **Note:** Amazon API Gateway Version 2 VPC Links enable private integrations that connect HTTP APIs to private resources in a VPC.
    18  // To enable private integration for REST APIs, use the Amazon API Gateway Version 1 VPC Link resource.
    19  //
    20  // ## Example Usage
    21  //
    22  // <!--Start PulumiCodeChooser -->
    23  // ```go
    24  // package main
    25  //
    26  // import (
    27  //
    28  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/apigatewayv2"
    29  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    30  //
    31  // )
    32  //
    33  //	func main() {
    34  //		pulumi.Run(func(ctx *pulumi.Context) error {
    35  //			_, err := apigatewayv2.NewVpcLink(ctx, "example", &apigatewayv2.VpcLinkArgs{
    36  //				Name: pulumi.String("example"),
    37  //				SecurityGroupIds: pulumi.StringArray{
    38  //					exampleAwsSecurityGroup.Id,
    39  //				},
    40  //				SubnetIds: pulumi.Any(exampleAwsSubnets.Ids),
    41  //				Tags: pulumi.StringMap{
    42  //					"Usage": pulumi.String("example"),
    43  //				},
    44  //			})
    45  //			if err != nil {
    46  //				return err
    47  //			}
    48  //			return nil
    49  //		})
    50  //	}
    51  //
    52  // ```
    53  // <!--End PulumiCodeChooser -->
    54  //
    55  // ## Import
    56  //
    57  // Using `pulumi import`, import `aws_apigatewayv2_vpc_link` using the VPC Link identifier. For example:
    58  //
    59  // ```sh
    60  // $ pulumi import aws:apigatewayv2/vpcLink:VpcLink example aabbccddee
    61  // ```
    62  type VpcLink struct {
    63  	pulumi.CustomResourceState
    64  
    65  	// VPC Link ARN.
    66  	Arn pulumi.StringOutput `pulumi:"arn"`
    67  	// Name of the VPC Link. Must be between 1 and 128 characters in length.
    68  	Name pulumi.StringOutput `pulumi:"name"`
    69  	// Security group IDs for the VPC Link.
    70  	SecurityGroupIds pulumi.StringArrayOutput `pulumi:"securityGroupIds"`
    71  	// Subnet IDs for the VPC Link.
    72  	SubnetIds pulumi.StringArrayOutput `pulumi:"subnetIds"`
    73  	// Map of tags to assign to the VPC Link. 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  	// 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  }
    80  
    81  // NewVpcLink registers a new resource with the given unique name, arguments, and options.
    82  func NewVpcLink(ctx *pulumi.Context,
    83  	name string, args *VpcLinkArgs, opts ...pulumi.ResourceOption) (*VpcLink, error) {
    84  	if args == nil {
    85  		return nil, errors.New("missing one or more required arguments")
    86  	}
    87  
    88  	if args.SecurityGroupIds == nil {
    89  		return nil, errors.New("invalid value for required argument 'SecurityGroupIds'")
    90  	}
    91  	if args.SubnetIds == nil {
    92  		return nil, errors.New("invalid value for required argument 'SubnetIds'")
    93  	}
    94  	opts = internal.PkgResourceDefaultOpts(opts)
    95  	var resource VpcLink
    96  	err := ctx.RegisterResource("aws:apigatewayv2/vpcLink:VpcLink", name, args, &resource, opts...)
    97  	if err != nil {
    98  		return nil, err
    99  	}
   100  	return &resource, nil
   101  }
   102  
   103  // GetVpcLink gets an existing VpcLink resource's state with the given name, ID, and optional
   104  // state properties that are used to uniquely qualify the lookup (nil if not required).
   105  func GetVpcLink(ctx *pulumi.Context,
   106  	name string, id pulumi.IDInput, state *VpcLinkState, opts ...pulumi.ResourceOption) (*VpcLink, error) {
   107  	var resource VpcLink
   108  	err := ctx.ReadResource("aws:apigatewayv2/vpcLink:VpcLink", name, id, state, &resource, opts...)
   109  	if err != nil {
   110  		return nil, err
   111  	}
   112  	return &resource, nil
   113  }
   114  
   115  // Input properties used for looking up and filtering VpcLink resources.
   116  type vpcLinkState struct {
   117  	// VPC Link ARN.
   118  	Arn *string `pulumi:"arn"`
   119  	// Name of the VPC Link. Must be between 1 and 128 characters in length.
   120  	Name *string `pulumi:"name"`
   121  	// Security group IDs for the VPC Link.
   122  	SecurityGroupIds []string `pulumi:"securityGroupIds"`
   123  	// Subnet IDs for the VPC Link.
   124  	SubnetIds []string `pulumi:"subnetIds"`
   125  	// Map of tags to assign to the VPC Link. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   126  	Tags map[string]string `pulumi:"tags"`
   127  	// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   128  	//
   129  	// Deprecated: Please use `tags` instead.
   130  	TagsAll map[string]string `pulumi:"tagsAll"`
   131  }
   132  
   133  type VpcLinkState struct {
   134  	// VPC Link ARN.
   135  	Arn pulumi.StringPtrInput
   136  	// Name of the VPC Link. Must be between 1 and 128 characters in length.
   137  	Name pulumi.StringPtrInput
   138  	// Security group IDs for the VPC Link.
   139  	SecurityGroupIds pulumi.StringArrayInput
   140  	// Subnet IDs for the VPC Link.
   141  	SubnetIds pulumi.StringArrayInput
   142  	// Map of tags to assign to the VPC Link. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   143  	Tags pulumi.StringMapInput
   144  	// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   145  	//
   146  	// Deprecated: Please use `tags` instead.
   147  	TagsAll pulumi.StringMapInput
   148  }
   149  
   150  func (VpcLinkState) ElementType() reflect.Type {
   151  	return reflect.TypeOf((*vpcLinkState)(nil)).Elem()
   152  }
   153  
   154  type vpcLinkArgs struct {
   155  	// Name of the VPC Link. Must be between 1 and 128 characters in length.
   156  	Name *string `pulumi:"name"`
   157  	// Security group IDs for the VPC Link.
   158  	SecurityGroupIds []string `pulumi:"securityGroupIds"`
   159  	// Subnet IDs for the VPC Link.
   160  	SubnetIds []string `pulumi:"subnetIds"`
   161  	// Map of tags to assign to the VPC Link. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   162  	Tags map[string]string `pulumi:"tags"`
   163  }
   164  
   165  // The set of arguments for constructing a VpcLink resource.
   166  type VpcLinkArgs struct {
   167  	// Name of the VPC Link. Must be between 1 and 128 characters in length.
   168  	Name pulumi.StringPtrInput
   169  	// Security group IDs for the VPC Link.
   170  	SecurityGroupIds pulumi.StringArrayInput
   171  	// Subnet IDs for the VPC Link.
   172  	SubnetIds pulumi.StringArrayInput
   173  	// Map of tags to assign to the VPC Link. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   174  	Tags pulumi.StringMapInput
   175  }
   176  
   177  func (VpcLinkArgs) ElementType() reflect.Type {
   178  	return reflect.TypeOf((*vpcLinkArgs)(nil)).Elem()
   179  }
   180  
   181  type VpcLinkInput interface {
   182  	pulumi.Input
   183  
   184  	ToVpcLinkOutput() VpcLinkOutput
   185  	ToVpcLinkOutputWithContext(ctx context.Context) VpcLinkOutput
   186  }
   187  
   188  func (*VpcLink) ElementType() reflect.Type {
   189  	return reflect.TypeOf((**VpcLink)(nil)).Elem()
   190  }
   191  
   192  func (i *VpcLink) ToVpcLinkOutput() VpcLinkOutput {
   193  	return i.ToVpcLinkOutputWithContext(context.Background())
   194  }
   195  
   196  func (i *VpcLink) ToVpcLinkOutputWithContext(ctx context.Context) VpcLinkOutput {
   197  	return pulumi.ToOutputWithContext(ctx, i).(VpcLinkOutput)
   198  }
   199  
   200  // VpcLinkArrayInput is an input type that accepts VpcLinkArray and VpcLinkArrayOutput values.
   201  // You can construct a concrete instance of `VpcLinkArrayInput` via:
   202  //
   203  //	VpcLinkArray{ VpcLinkArgs{...} }
   204  type VpcLinkArrayInput interface {
   205  	pulumi.Input
   206  
   207  	ToVpcLinkArrayOutput() VpcLinkArrayOutput
   208  	ToVpcLinkArrayOutputWithContext(context.Context) VpcLinkArrayOutput
   209  }
   210  
   211  type VpcLinkArray []VpcLinkInput
   212  
   213  func (VpcLinkArray) ElementType() reflect.Type {
   214  	return reflect.TypeOf((*[]*VpcLink)(nil)).Elem()
   215  }
   216  
   217  func (i VpcLinkArray) ToVpcLinkArrayOutput() VpcLinkArrayOutput {
   218  	return i.ToVpcLinkArrayOutputWithContext(context.Background())
   219  }
   220  
   221  func (i VpcLinkArray) ToVpcLinkArrayOutputWithContext(ctx context.Context) VpcLinkArrayOutput {
   222  	return pulumi.ToOutputWithContext(ctx, i).(VpcLinkArrayOutput)
   223  }
   224  
   225  // VpcLinkMapInput is an input type that accepts VpcLinkMap and VpcLinkMapOutput values.
   226  // You can construct a concrete instance of `VpcLinkMapInput` via:
   227  //
   228  //	VpcLinkMap{ "key": VpcLinkArgs{...} }
   229  type VpcLinkMapInput interface {
   230  	pulumi.Input
   231  
   232  	ToVpcLinkMapOutput() VpcLinkMapOutput
   233  	ToVpcLinkMapOutputWithContext(context.Context) VpcLinkMapOutput
   234  }
   235  
   236  type VpcLinkMap map[string]VpcLinkInput
   237  
   238  func (VpcLinkMap) ElementType() reflect.Type {
   239  	return reflect.TypeOf((*map[string]*VpcLink)(nil)).Elem()
   240  }
   241  
   242  func (i VpcLinkMap) ToVpcLinkMapOutput() VpcLinkMapOutput {
   243  	return i.ToVpcLinkMapOutputWithContext(context.Background())
   244  }
   245  
   246  func (i VpcLinkMap) ToVpcLinkMapOutputWithContext(ctx context.Context) VpcLinkMapOutput {
   247  	return pulumi.ToOutputWithContext(ctx, i).(VpcLinkMapOutput)
   248  }
   249  
   250  type VpcLinkOutput struct{ *pulumi.OutputState }
   251  
   252  func (VpcLinkOutput) ElementType() reflect.Type {
   253  	return reflect.TypeOf((**VpcLink)(nil)).Elem()
   254  }
   255  
   256  func (o VpcLinkOutput) ToVpcLinkOutput() VpcLinkOutput {
   257  	return o
   258  }
   259  
   260  func (o VpcLinkOutput) ToVpcLinkOutputWithContext(ctx context.Context) VpcLinkOutput {
   261  	return o
   262  }
   263  
   264  // VPC Link ARN.
   265  func (o VpcLinkOutput) Arn() pulumi.StringOutput {
   266  	return o.ApplyT(func(v *VpcLink) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   267  }
   268  
   269  // Name of the VPC Link. Must be between 1 and 128 characters in length.
   270  func (o VpcLinkOutput) Name() pulumi.StringOutput {
   271  	return o.ApplyT(func(v *VpcLink) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
   272  }
   273  
   274  // Security group IDs for the VPC Link.
   275  func (o VpcLinkOutput) SecurityGroupIds() pulumi.StringArrayOutput {
   276  	return o.ApplyT(func(v *VpcLink) pulumi.StringArrayOutput { return v.SecurityGroupIds }).(pulumi.StringArrayOutput)
   277  }
   278  
   279  // Subnet IDs for the VPC Link.
   280  func (o VpcLinkOutput) SubnetIds() pulumi.StringArrayOutput {
   281  	return o.ApplyT(func(v *VpcLink) pulumi.StringArrayOutput { return v.SubnetIds }).(pulumi.StringArrayOutput)
   282  }
   283  
   284  // Map of tags to assign to the VPC Link. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   285  func (o VpcLinkOutput) Tags() pulumi.StringMapOutput {
   286  	return o.ApplyT(func(v *VpcLink) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   287  }
   288  
   289  // Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   290  //
   291  // Deprecated: Please use `tags` instead.
   292  func (o VpcLinkOutput) TagsAll() pulumi.StringMapOutput {
   293  	return o.ApplyT(func(v *VpcLink) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   294  }
   295  
   296  type VpcLinkArrayOutput struct{ *pulumi.OutputState }
   297  
   298  func (VpcLinkArrayOutput) ElementType() reflect.Type {
   299  	return reflect.TypeOf((*[]*VpcLink)(nil)).Elem()
   300  }
   301  
   302  func (o VpcLinkArrayOutput) ToVpcLinkArrayOutput() VpcLinkArrayOutput {
   303  	return o
   304  }
   305  
   306  func (o VpcLinkArrayOutput) ToVpcLinkArrayOutputWithContext(ctx context.Context) VpcLinkArrayOutput {
   307  	return o
   308  }
   309  
   310  func (o VpcLinkArrayOutput) Index(i pulumi.IntInput) VpcLinkOutput {
   311  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *VpcLink {
   312  		return vs[0].([]*VpcLink)[vs[1].(int)]
   313  	}).(VpcLinkOutput)
   314  }
   315  
   316  type VpcLinkMapOutput struct{ *pulumi.OutputState }
   317  
   318  func (VpcLinkMapOutput) ElementType() reflect.Type {
   319  	return reflect.TypeOf((*map[string]*VpcLink)(nil)).Elem()
   320  }
   321  
   322  func (o VpcLinkMapOutput) ToVpcLinkMapOutput() VpcLinkMapOutput {
   323  	return o
   324  }
   325  
   326  func (o VpcLinkMapOutput) ToVpcLinkMapOutputWithContext(ctx context.Context) VpcLinkMapOutput {
   327  	return o
   328  }
   329  
   330  func (o VpcLinkMapOutput) MapIndex(k pulumi.StringInput) VpcLinkOutput {
   331  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *VpcLink {
   332  		return vs[0].(map[string]*VpcLink)[vs[1].(string)]
   333  	}).(VpcLinkOutput)
   334  }
   335  
   336  func init() {
   337  	pulumi.RegisterInputType(reflect.TypeOf((*VpcLinkInput)(nil)).Elem(), &VpcLink{})
   338  	pulumi.RegisterInputType(reflect.TypeOf((*VpcLinkArrayInput)(nil)).Elem(), VpcLinkArray{})
   339  	pulumi.RegisterInputType(reflect.TypeOf((*VpcLinkMapInput)(nil)).Elem(), VpcLinkMap{})
   340  	pulumi.RegisterOutputType(VpcLinkOutput{})
   341  	pulumi.RegisterOutputType(VpcLinkArrayOutput{})
   342  	pulumi.RegisterOutputType(VpcLinkMapOutput{})
   343  }