github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/ec2/localGatewayRouteTableVpcAssociation.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  	"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 EC2 Local Gateway Route Table VPC Association. More information can be found in the [Outposts User Guide](https://docs.aws.amazon.com/outposts/latest/userguide/outposts-local-gateways.html#vpc-associations).
    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/ec2"
    26  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    27  //
    28  // )
    29  //
    30  //	func main() {
    31  //		pulumi.Run(func(ctx *pulumi.Context) error {
    32  //			example, err := ec2.GetLocalGatewayRouteTable(ctx, &ec2.GetLocalGatewayRouteTableArgs{
    33  //				OutpostArn: pulumi.StringRef("arn:aws:outposts:us-west-2:123456789012:outpost/op-1234567890abcdef"),
    34  //			}, nil)
    35  //			if err != nil {
    36  //				return err
    37  //			}
    38  //			exampleVpc, err := ec2.NewVpc(ctx, "example", &ec2.VpcArgs{
    39  //				CidrBlock: pulumi.String("10.0.0.0/16"),
    40  //			})
    41  //			if err != nil {
    42  //				return err
    43  //			}
    44  //			_, err = ec2.NewLocalGatewayRouteTableVpcAssociation(ctx, "example", &ec2.LocalGatewayRouteTableVpcAssociationArgs{
    45  //				LocalGatewayRouteTableId: pulumi.String(example.Id),
    46  //				VpcId:                    exampleVpc.ID(),
    47  //			})
    48  //			if err != nil {
    49  //				return err
    50  //			}
    51  //			return nil
    52  //		})
    53  //	}
    54  //
    55  // ```
    56  // <!--End PulumiCodeChooser -->
    57  //
    58  // ## Import
    59  //
    60  // Using `pulumi import`, import `aws_ec2_local_gateway_route_table_vpc_association` using the Local Gateway Route Table VPC Association identifier. For example:
    61  //
    62  // ```sh
    63  // $ pulumi import aws:ec2/localGatewayRouteTableVpcAssociation:LocalGatewayRouteTableVpcAssociation example lgw-vpc-assoc-1234567890abcdef
    64  // ```
    65  type LocalGatewayRouteTableVpcAssociation struct {
    66  	pulumi.CustomResourceState
    67  
    68  	LocalGatewayId pulumi.StringOutput `pulumi:"localGatewayId"`
    69  	// Identifier of EC2 Local Gateway Route Table.
    70  	LocalGatewayRouteTableId pulumi.StringOutput `pulumi:"localGatewayRouteTableId"`
    71  	// Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    72  	Tags pulumi.StringMapOutput `pulumi:"tags"`
    73  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
    74  	//
    75  	// Deprecated: Please use `tags` instead.
    76  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
    77  	// Identifier of EC2 VPC.
    78  	//
    79  	// The following arguments are optional:
    80  	VpcId pulumi.StringOutput `pulumi:"vpcId"`
    81  }
    82  
    83  // NewLocalGatewayRouteTableVpcAssociation registers a new resource with the given unique name, arguments, and options.
    84  func NewLocalGatewayRouteTableVpcAssociation(ctx *pulumi.Context,
    85  	name string, args *LocalGatewayRouteTableVpcAssociationArgs, opts ...pulumi.ResourceOption) (*LocalGatewayRouteTableVpcAssociation, error) {
    86  	if args == nil {
    87  		return nil, errors.New("missing one or more required arguments")
    88  	}
    89  
    90  	if args.LocalGatewayRouteTableId == nil {
    91  		return nil, errors.New("invalid value for required argument 'LocalGatewayRouteTableId'")
    92  	}
    93  	if args.VpcId == nil {
    94  		return nil, errors.New("invalid value for required argument 'VpcId'")
    95  	}
    96  	opts = internal.PkgResourceDefaultOpts(opts)
    97  	var resource LocalGatewayRouteTableVpcAssociation
    98  	err := ctx.RegisterResource("aws:ec2/localGatewayRouteTableVpcAssociation:LocalGatewayRouteTableVpcAssociation", name, args, &resource, opts...)
    99  	if err != nil {
   100  		return nil, err
   101  	}
   102  	return &resource, nil
   103  }
   104  
   105  // GetLocalGatewayRouteTableVpcAssociation gets an existing LocalGatewayRouteTableVpcAssociation resource's state with the given name, ID, and optional
   106  // state properties that are used to uniquely qualify the lookup (nil if not required).
   107  func GetLocalGatewayRouteTableVpcAssociation(ctx *pulumi.Context,
   108  	name string, id pulumi.IDInput, state *LocalGatewayRouteTableVpcAssociationState, opts ...pulumi.ResourceOption) (*LocalGatewayRouteTableVpcAssociation, error) {
   109  	var resource LocalGatewayRouteTableVpcAssociation
   110  	err := ctx.ReadResource("aws:ec2/localGatewayRouteTableVpcAssociation:LocalGatewayRouteTableVpcAssociation", name, id, state, &resource, opts...)
   111  	if err != nil {
   112  		return nil, err
   113  	}
   114  	return &resource, nil
   115  }
   116  
   117  // Input properties used for looking up and filtering LocalGatewayRouteTableVpcAssociation resources.
   118  type localGatewayRouteTableVpcAssociationState struct {
   119  	LocalGatewayId *string `pulumi:"localGatewayId"`
   120  	// Identifier of EC2 Local Gateway Route Table.
   121  	LocalGatewayRouteTableId *string `pulumi:"localGatewayRouteTableId"`
   122  	// Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   123  	Tags map[string]string `pulumi:"tags"`
   124  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   125  	//
   126  	// Deprecated: Please use `tags` instead.
   127  	TagsAll map[string]string `pulumi:"tagsAll"`
   128  	// Identifier of EC2 VPC.
   129  	//
   130  	// The following arguments are optional:
   131  	VpcId *string `pulumi:"vpcId"`
   132  }
   133  
   134  type LocalGatewayRouteTableVpcAssociationState struct {
   135  	LocalGatewayId pulumi.StringPtrInput
   136  	// Identifier of EC2 Local Gateway Route Table.
   137  	LocalGatewayRouteTableId pulumi.StringPtrInput
   138  	// Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   139  	Tags pulumi.StringMapInput
   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 pulumi.StringMapInput
   144  	// Identifier of EC2 VPC.
   145  	//
   146  	// The following arguments are optional:
   147  	VpcId pulumi.StringPtrInput
   148  }
   149  
   150  func (LocalGatewayRouteTableVpcAssociationState) ElementType() reflect.Type {
   151  	return reflect.TypeOf((*localGatewayRouteTableVpcAssociationState)(nil)).Elem()
   152  }
   153  
   154  type localGatewayRouteTableVpcAssociationArgs struct {
   155  	// Identifier of EC2 Local Gateway Route Table.
   156  	LocalGatewayRouteTableId string `pulumi:"localGatewayRouteTableId"`
   157  	// Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   158  	Tags map[string]string `pulumi:"tags"`
   159  	// Identifier of EC2 VPC.
   160  	//
   161  	// The following arguments are optional:
   162  	VpcId string `pulumi:"vpcId"`
   163  }
   164  
   165  // The set of arguments for constructing a LocalGatewayRouteTableVpcAssociation resource.
   166  type LocalGatewayRouteTableVpcAssociationArgs struct {
   167  	// Identifier of EC2 Local Gateway Route Table.
   168  	LocalGatewayRouteTableId pulumi.StringInput
   169  	// Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   170  	Tags pulumi.StringMapInput
   171  	// Identifier of EC2 VPC.
   172  	//
   173  	// The following arguments are optional:
   174  	VpcId pulumi.StringInput
   175  }
   176  
   177  func (LocalGatewayRouteTableVpcAssociationArgs) ElementType() reflect.Type {
   178  	return reflect.TypeOf((*localGatewayRouteTableVpcAssociationArgs)(nil)).Elem()
   179  }
   180  
   181  type LocalGatewayRouteTableVpcAssociationInput interface {
   182  	pulumi.Input
   183  
   184  	ToLocalGatewayRouteTableVpcAssociationOutput() LocalGatewayRouteTableVpcAssociationOutput
   185  	ToLocalGatewayRouteTableVpcAssociationOutputWithContext(ctx context.Context) LocalGatewayRouteTableVpcAssociationOutput
   186  }
   187  
   188  func (*LocalGatewayRouteTableVpcAssociation) ElementType() reflect.Type {
   189  	return reflect.TypeOf((**LocalGatewayRouteTableVpcAssociation)(nil)).Elem()
   190  }
   191  
   192  func (i *LocalGatewayRouteTableVpcAssociation) ToLocalGatewayRouteTableVpcAssociationOutput() LocalGatewayRouteTableVpcAssociationOutput {
   193  	return i.ToLocalGatewayRouteTableVpcAssociationOutputWithContext(context.Background())
   194  }
   195  
   196  func (i *LocalGatewayRouteTableVpcAssociation) ToLocalGatewayRouteTableVpcAssociationOutputWithContext(ctx context.Context) LocalGatewayRouteTableVpcAssociationOutput {
   197  	return pulumi.ToOutputWithContext(ctx, i).(LocalGatewayRouteTableVpcAssociationOutput)
   198  }
   199  
   200  // LocalGatewayRouteTableVpcAssociationArrayInput is an input type that accepts LocalGatewayRouteTableVpcAssociationArray and LocalGatewayRouteTableVpcAssociationArrayOutput values.
   201  // You can construct a concrete instance of `LocalGatewayRouteTableVpcAssociationArrayInput` via:
   202  //
   203  //	LocalGatewayRouteTableVpcAssociationArray{ LocalGatewayRouteTableVpcAssociationArgs{...} }
   204  type LocalGatewayRouteTableVpcAssociationArrayInput interface {
   205  	pulumi.Input
   206  
   207  	ToLocalGatewayRouteTableVpcAssociationArrayOutput() LocalGatewayRouteTableVpcAssociationArrayOutput
   208  	ToLocalGatewayRouteTableVpcAssociationArrayOutputWithContext(context.Context) LocalGatewayRouteTableVpcAssociationArrayOutput
   209  }
   210  
   211  type LocalGatewayRouteTableVpcAssociationArray []LocalGatewayRouteTableVpcAssociationInput
   212  
   213  func (LocalGatewayRouteTableVpcAssociationArray) ElementType() reflect.Type {
   214  	return reflect.TypeOf((*[]*LocalGatewayRouteTableVpcAssociation)(nil)).Elem()
   215  }
   216  
   217  func (i LocalGatewayRouteTableVpcAssociationArray) ToLocalGatewayRouteTableVpcAssociationArrayOutput() LocalGatewayRouteTableVpcAssociationArrayOutput {
   218  	return i.ToLocalGatewayRouteTableVpcAssociationArrayOutputWithContext(context.Background())
   219  }
   220  
   221  func (i LocalGatewayRouteTableVpcAssociationArray) ToLocalGatewayRouteTableVpcAssociationArrayOutputWithContext(ctx context.Context) LocalGatewayRouteTableVpcAssociationArrayOutput {
   222  	return pulumi.ToOutputWithContext(ctx, i).(LocalGatewayRouteTableVpcAssociationArrayOutput)
   223  }
   224  
   225  // LocalGatewayRouteTableVpcAssociationMapInput is an input type that accepts LocalGatewayRouteTableVpcAssociationMap and LocalGatewayRouteTableVpcAssociationMapOutput values.
   226  // You can construct a concrete instance of `LocalGatewayRouteTableVpcAssociationMapInput` via:
   227  //
   228  //	LocalGatewayRouteTableVpcAssociationMap{ "key": LocalGatewayRouteTableVpcAssociationArgs{...} }
   229  type LocalGatewayRouteTableVpcAssociationMapInput interface {
   230  	pulumi.Input
   231  
   232  	ToLocalGatewayRouteTableVpcAssociationMapOutput() LocalGatewayRouteTableVpcAssociationMapOutput
   233  	ToLocalGatewayRouteTableVpcAssociationMapOutputWithContext(context.Context) LocalGatewayRouteTableVpcAssociationMapOutput
   234  }
   235  
   236  type LocalGatewayRouteTableVpcAssociationMap map[string]LocalGatewayRouteTableVpcAssociationInput
   237  
   238  func (LocalGatewayRouteTableVpcAssociationMap) ElementType() reflect.Type {
   239  	return reflect.TypeOf((*map[string]*LocalGatewayRouteTableVpcAssociation)(nil)).Elem()
   240  }
   241  
   242  func (i LocalGatewayRouteTableVpcAssociationMap) ToLocalGatewayRouteTableVpcAssociationMapOutput() LocalGatewayRouteTableVpcAssociationMapOutput {
   243  	return i.ToLocalGatewayRouteTableVpcAssociationMapOutputWithContext(context.Background())
   244  }
   245  
   246  func (i LocalGatewayRouteTableVpcAssociationMap) ToLocalGatewayRouteTableVpcAssociationMapOutputWithContext(ctx context.Context) LocalGatewayRouteTableVpcAssociationMapOutput {
   247  	return pulumi.ToOutputWithContext(ctx, i).(LocalGatewayRouteTableVpcAssociationMapOutput)
   248  }
   249  
   250  type LocalGatewayRouteTableVpcAssociationOutput struct{ *pulumi.OutputState }
   251  
   252  func (LocalGatewayRouteTableVpcAssociationOutput) ElementType() reflect.Type {
   253  	return reflect.TypeOf((**LocalGatewayRouteTableVpcAssociation)(nil)).Elem()
   254  }
   255  
   256  func (o LocalGatewayRouteTableVpcAssociationOutput) ToLocalGatewayRouteTableVpcAssociationOutput() LocalGatewayRouteTableVpcAssociationOutput {
   257  	return o
   258  }
   259  
   260  func (o LocalGatewayRouteTableVpcAssociationOutput) ToLocalGatewayRouteTableVpcAssociationOutputWithContext(ctx context.Context) LocalGatewayRouteTableVpcAssociationOutput {
   261  	return o
   262  }
   263  
   264  func (o LocalGatewayRouteTableVpcAssociationOutput) LocalGatewayId() pulumi.StringOutput {
   265  	return o.ApplyT(func(v *LocalGatewayRouteTableVpcAssociation) pulumi.StringOutput { return v.LocalGatewayId }).(pulumi.StringOutput)
   266  }
   267  
   268  // Identifier of EC2 Local Gateway Route Table.
   269  func (o LocalGatewayRouteTableVpcAssociationOutput) LocalGatewayRouteTableId() pulumi.StringOutput {
   270  	return o.ApplyT(func(v *LocalGatewayRouteTableVpcAssociation) pulumi.StringOutput { return v.LocalGatewayRouteTableId }).(pulumi.StringOutput)
   271  }
   272  
   273  // Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   274  func (o LocalGatewayRouteTableVpcAssociationOutput) Tags() pulumi.StringMapOutput {
   275  	return o.ApplyT(func(v *LocalGatewayRouteTableVpcAssociation) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   276  }
   277  
   278  // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   279  //
   280  // Deprecated: Please use `tags` instead.
   281  func (o LocalGatewayRouteTableVpcAssociationOutput) TagsAll() pulumi.StringMapOutput {
   282  	return o.ApplyT(func(v *LocalGatewayRouteTableVpcAssociation) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   283  }
   284  
   285  // Identifier of EC2 VPC.
   286  //
   287  // The following arguments are optional:
   288  func (o LocalGatewayRouteTableVpcAssociationOutput) VpcId() pulumi.StringOutput {
   289  	return o.ApplyT(func(v *LocalGatewayRouteTableVpcAssociation) pulumi.StringOutput { return v.VpcId }).(pulumi.StringOutput)
   290  }
   291  
   292  type LocalGatewayRouteTableVpcAssociationArrayOutput struct{ *pulumi.OutputState }
   293  
   294  func (LocalGatewayRouteTableVpcAssociationArrayOutput) ElementType() reflect.Type {
   295  	return reflect.TypeOf((*[]*LocalGatewayRouteTableVpcAssociation)(nil)).Elem()
   296  }
   297  
   298  func (o LocalGatewayRouteTableVpcAssociationArrayOutput) ToLocalGatewayRouteTableVpcAssociationArrayOutput() LocalGatewayRouteTableVpcAssociationArrayOutput {
   299  	return o
   300  }
   301  
   302  func (o LocalGatewayRouteTableVpcAssociationArrayOutput) ToLocalGatewayRouteTableVpcAssociationArrayOutputWithContext(ctx context.Context) LocalGatewayRouteTableVpcAssociationArrayOutput {
   303  	return o
   304  }
   305  
   306  func (o LocalGatewayRouteTableVpcAssociationArrayOutput) Index(i pulumi.IntInput) LocalGatewayRouteTableVpcAssociationOutput {
   307  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *LocalGatewayRouteTableVpcAssociation {
   308  		return vs[0].([]*LocalGatewayRouteTableVpcAssociation)[vs[1].(int)]
   309  	}).(LocalGatewayRouteTableVpcAssociationOutput)
   310  }
   311  
   312  type LocalGatewayRouteTableVpcAssociationMapOutput struct{ *pulumi.OutputState }
   313  
   314  func (LocalGatewayRouteTableVpcAssociationMapOutput) ElementType() reflect.Type {
   315  	return reflect.TypeOf((*map[string]*LocalGatewayRouteTableVpcAssociation)(nil)).Elem()
   316  }
   317  
   318  func (o LocalGatewayRouteTableVpcAssociationMapOutput) ToLocalGatewayRouteTableVpcAssociationMapOutput() LocalGatewayRouteTableVpcAssociationMapOutput {
   319  	return o
   320  }
   321  
   322  func (o LocalGatewayRouteTableVpcAssociationMapOutput) ToLocalGatewayRouteTableVpcAssociationMapOutputWithContext(ctx context.Context) LocalGatewayRouteTableVpcAssociationMapOutput {
   323  	return o
   324  }
   325  
   326  func (o LocalGatewayRouteTableVpcAssociationMapOutput) MapIndex(k pulumi.StringInput) LocalGatewayRouteTableVpcAssociationOutput {
   327  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *LocalGatewayRouteTableVpcAssociation {
   328  		return vs[0].(map[string]*LocalGatewayRouteTableVpcAssociation)[vs[1].(string)]
   329  	}).(LocalGatewayRouteTableVpcAssociationOutput)
   330  }
   331  
   332  func init() {
   333  	pulumi.RegisterInputType(reflect.TypeOf((*LocalGatewayRouteTableVpcAssociationInput)(nil)).Elem(), &LocalGatewayRouteTableVpcAssociation{})
   334  	pulumi.RegisterInputType(reflect.TypeOf((*LocalGatewayRouteTableVpcAssociationArrayInput)(nil)).Elem(), LocalGatewayRouteTableVpcAssociationArray{})
   335  	pulumi.RegisterInputType(reflect.TypeOf((*LocalGatewayRouteTableVpcAssociationMapInput)(nil)).Elem(), LocalGatewayRouteTableVpcAssociationMap{})
   336  	pulumi.RegisterOutputType(LocalGatewayRouteTableVpcAssociationOutput{})
   337  	pulumi.RegisterOutputType(LocalGatewayRouteTableVpcAssociationArrayOutput{})
   338  	pulumi.RegisterOutputType(LocalGatewayRouteTableVpcAssociationMapOutput{})
   339  }