github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/ec2transitgateway/routeTable.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 ec2transitgateway
     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 Transit Gateway Route Table.
    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/ec2transitgateway"
    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 := ec2transitgateway.NewRouteTable(ctx, "example", &ec2transitgateway.RouteTableArgs{
    33  //				TransitGatewayId: pulumi.Any(exampleAwsEc2TransitGateway.Id),
    34  //			})
    35  //			if err != nil {
    36  //				return err
    37  //			}
    38  //			return nil
    39  //		})
    40  //	}
    41  //
    42  // ```
    43  // <!--End PulumiCodeChooser -->
    44  //
    45  // ## Import
    46  //
    47  // Using `pulumi import`, import `aws_ec2_transit_gateway_route_table` using the EC2 Transit Gateway Route Table identifier. For example:
    48  //
    49  // ```sh
    50  // $ pulumi import aws:ec2transitgateway/routeTable:RouteTable example tgw-rtb-12345678
    51  // ```
    52  type RouteTable struct {
    53  	pulumi.CustomResourceState
    54  
    55  	// EC2 Transit Gateway Route Table Amazon Resource Name (ARN).
    56  	Arn pulumi.StringOutput `pulumi:"arn"`
    57  	// Boolean whether this is the default association route table for the EC2 Transit Gateway.
    58  	DefaultAssociationRouteTable pulumi.BoolOutput `pulumi:"defaultAssociationRouteTable"`
    59  	// Boolean whether this is the default propagation route table for the EC2 Transit Gateway.
    60  	DefaultPropagationRouteTable pulumi.BoolOutput `pulumi:"defaultPropagationRouteTable"`
    61  	// Key-value tags for the EC2 Transit Gateway Route Table. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    62  	Tags pulumi.StringMapOutput `pulumi:"tags"`
    63  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
    64  	//
    65  	// Deprecated: Please use `tags` instead.
    66  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
    67  	// Identifier of EC2 Transit Gateway.
    68  	TransitGatewayId pulumi.StringOutput `pulumi:"transitGatewayId"`
    69  }
    70  
    71  // NewRouteTable registers a new resource with the given unique name, arguments, and options.
    72  func NewRouteTable(ctx *pulumi.Context,
    73  	name string, args *RouteTableArgs, opts ...pulumi.ResourceOption) (*RouteTable, error) {
    74  	if args == nil {
    75  		return nil, errors.New("missing one or more required arguments")
    76  	}
    77  
    78  	if args.TransitGatewayId == nil {
    79  		return nil, errors.New("invalid value for required argument 'TransitGatewayId'")
    80  	}
    81  	opts = internal.PkgResourceDefaultOpts(opts)
    82  	var resource RouteTable
    83  	err := ctx.RegisterResource("aws:ec2transitgateway/routeTable:RouteTable", name, args, &resource, opts...)
    84  	if err != nil {
    85  		return nil, err
    86  	}
    87  	return &resource, nil
    88  }
    89  
    90  // GetRouteTable gets an existing RouteTable resource's state with the given name, ID, and optional
    91  // state properties that are used to uniquely qualify the lookup (nil if not required).
    92  func GetRouteTable(ctx *pulumi.Context,
    93  	name string, id pulumi.IDInput, state *RouteTableState, opts ...pulumi.ResourceOption) (*RouteTable, error) {
    94  	var resource RouteTable
    95  	err := ctx.ReadResource("aws:ec2transitgateway/routeTable:RouteTable", name, id, state, &resource, opts...)
    96  	if err != nil {
    97  		return nil, err
    98  	}
    99  	return &resource, nil
   100  }
   101  
   102  // Input properties used for looking up and filtering RouteTable resources.
   103  type routeTableState struct {
   104  	// EC2 Transit Gateway Route Table Amazon Resource Name (ARN).
   105  	Arn *string `pulumi:"arn"`
   106  	// Boolean whether this is the default association route table for the EC2 Transit Gateway.
   107  	DefaultAssociationRouteTable *bool `pulumi:"defaultAssociationRouteTable"`
   108  	// Boolean whether this is the default propagation route table for the EC2 Transit Gateway.
   109  	DefaultPropagationRouteTable *bool `pulumi:"defaultPropagationRouteTable"`
   110  	// Key-value tags for the EC2 Transit Gateway Route Table. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   111  	Tags map[string]string `pulumi:"tags"`
   112  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   113  	//
   114  	// Deprecated: Please use `tags` instead.
   115  	TagsAll map[string]string `pulumi:"tagsAll"`
   116  	// Identifier of EC2 Transit Gateway.
   117  	TransitGatewayId *string `pulumi:"transitGatewayId"`
   118  }
   119  
   120  type RouteTableState struct {
   121  	// EC2 Transit Gateway Route Table Amazon Resource Name (ARN).
   122  	Arn pulumi.StringPtrInput
   123  	// Boolean whether this is the default association route table for the EC2 Transit Gateway.
   124  	DefaultAssociationRouteTable pulumi.BoolPtrInput
   125  	// Boolean whether this is the default propagation route table for the EC2 Transit Gateway.
   126  	DefaultPropagationRouteTable pulumi.BoolPtrInput
   127  	// Key-value tags for the EC2 Transit Gateway Route Table. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   128  	Tags pulumi.StringMapInput
   129  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   130  	//
   131  	// Deprecated: Please use `tags` instead.
   132  	TagsAll pulumi.StringMapInput
   133  	// Identifier of EC2 Transit Gateway.
   134  	TransitGatewayId pulumi.StringPtrInput
   135  }
   136  
   137  func (RouteTableState) ElementType() reflect.Type {
   138  	return reflect.TypeOf((*routeTableState)(nil)).Elem()
   139  }
   140  
   141  type routeTableArgs struct {
   142  	// Key-value tags for the EC2 Transit Gateway Route Table. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   143  	Tags map[string]string `pulumi:"tags"`
   144  	// Identifier of EC2 Transit Gateway.
   145  	TransitGatewayId string `pulumi:"transitGatewayId"`
   146  }
   147  
   148  // The set of arguments for constructing a RouteTable resource.
   149  type RouteTableArgs struct {
   150  	// Key-value tags for the EC2 Transit Gateway Route Table. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   151  	Tags pulumi.StringMapInput
   152  	// Identifier of EC2 Transit Gateway.
   153  	TransitGatewayId pulumi.StringInput
   154  }
   155  
   156  func (RouteTableArgs) ElementType() reflect.Type {
   157  	return reflect.TypeOf((*routeTableArgs)(nil)).Elem()
   158  }
   159  
   160  type RouteTableInput interface {
   161  	pulumi.Input
   162  
   163  	ToRouteTableOutput() RouteTableOutput
   164  	ToRouteTableOutputWithContext(ctx context.Context) RouteTableOutput
   165  }
   166  
   167  func (*RouteTable) ElementType() reflect.Type {
   168  	return reflect.TypeOf((**RouteTable)(nil)).Elem()
   169  }
   170  
   171  func (i *RouteTable) ToRouteTableOutput() RouteTableOutput {
   172  	return i.ToRouteTableOutputWithContext(context.Background())
   173  }
   174  
   175  func (i *RouteTable) ToRouteTableOutputWithContext(ctx context.Context) RouteTableOutput {
   176  	return pulumi.ToOutputWithContext(ctx, i).(RouteTableOutput)
   177  }
   178  
   179  // RouteTableArrayInput is an input type that accepts RouteTableArray and RouteTableArrayOutput values.
   180  // You can construct a concrete instance of `RouteTableArrayInput` via:
   181  //
   182  //	RouteTableArray{ RouteTableArgs{...} }
   183  type RouteTableArrayInput interface {
   184  	pulumi.Input
   185  
   186  	ToRouteTableArrayOutput() RouteTableArrayOutput
   187  	ToRouteTableArrayOutputWithContext(context.Context) RouteTableArrayOutput
   188  }
   189  
   190  type RouteTableArray []RouteTableInput
   191  
   192  func (RouteTableArray) ElementType() reflect.Type {
   193  	return reflect.TypeOf((*[]*RouteTable)(nil)).Elem()
   194  }
   195  
   196  func (i RouteTableArray) ToRouteTableArrayOutput() RouteTableArrayOutput {
   197  	return i.ToRouteTableArrayOutputWithContext(context.Background())
   198  }
   199  
   200  func (i RouteTableArray) ToRouteTableArrayOutputWithContext(ctx context.Context) RouteTableArrayOutput {
   201  	return pulumi.ToOutputWithContext(ctx, i).(RouteTableArrayOutput)
   202  }
   203  
   204  // RouteTableMapInput is an input type that accepts RouteTableMap and RouteTableMapOutput values.
   205  // You can construct a concrete instance of `RouteTableMapInput` via:
   206  //
   207  //	RouteTableMap{ "key": RouteTableArgs{...} }
   208  type RouteTableMapInput interface {
   209  	pulumi.Input
   210  
   211  	ToRouteTableMapOutput() RouteTableMapOutput
   212  	ToRouteTableMapOutputWithContext(context.Context) RouteTableMapOutput
   213  }
   214  
   215  type RouteTableMap map[string]RouteTableInput
   216  
   217  func (RouteTableMap) ElementType() reflect.Type {
   218  	return reflect.TypeOf((*map[string]*RouteTable)(nil)).Elem()
   219  }
   220  
   221  func (i RouteTableMap) ToRouteTableMapOutput() RouteTableMapOutput {
   222  	return i.ToRouteTableMapOutputWithContext(context.Background())
   223  }
   224  
   225  func (i RouteTableMap) ToRouteTableMapOutputWithContext(ctx context.Context) RouteTableMapOutput {
   226  	return pulumi.ToOutputWithContext(ctx, i).(RouteTableMapOutput)
   227  }
   228  
   229  type RouteTableOutput struct{ *pulumi.OutputState }
   230  
   231  func (RouteTableOutput) ElementType() reflect.Type {
   232  	return reflect.TypeOf((**RouteTable)(nil)).Elem()
   233  }
   234  
   235  func (o RouteTableOutput) ToRouteTableOutput() RouteTableOutput {
   236  	return o
   237  }
   238  
   239  func (o RouteTableOutput) ToRouteTableOutputWithContext(ctx context.Context) RouteTableOutput {
   240  	return o
   241  }
   242  
   243  // EC2 Transit Gateway Route Table Amazon Resource Name (ARN).
   244  func (o RouteTableOutput) Arn() pulumi.StringOutput {
   245  	return o.ApplyT(func(v *RouteTable) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   246  }
   247  
   248  // Boolean whether this is the default association route table for the EC2 Transit Gateway.
   249  func (o RouteTableOutput) DefaultAssociationRouteTable() pulumi.BoolOutput {
   250  	return o.ApplyT(func(v *RouteTable) pulumi.BoolOutput { return v.DefaultAssociationRouteTable }).(pulumi.BoolOutput)
   251  }
   252  
   253  // Boolean whether this is the default propagation route table for the EC2 Transit Gateway.
   254  func (o RouteTableOutput) DefaultPropagationRouteTable() pulumi.BoolOutput {
   255  	return o.ApplyT(func(v *RouteTable) pulumi.BoolOutput { return v.DefaultPropagationRouteTable }).(pulumi.BoolOutput)
   256  }
   257  
   258  // Key-value tags for the EC2 Transit Gateway Route Table. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   259  func (o RouteTableOutput) Tags() pulumi.StringMapOutput {
   260  	return o.ApplyT(func(v *RouteTable) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   261  }
   262  
   263  // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   264  //
   265  // Deprecated: Please use `tags` instead.
   266  func (o RouteTableOutput) TagsAll() pulumi.StringMapOutput {
   267  	return o.ApplyT(func(v *RouteTable) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   268  }
   269  
   270  // Identifier of EC2 Transit Gateway.
   271  func (o RouteTableOutput) TransitGatewayId() pulumi.StringOutput {
   272  	return o.ApplyT(func(v *RouteTable) pulumi.StringOutput { return v.TransitGatewayId }).(pulumi.StringOutput)
   273  }
   274  
   275  type RouteTableArrayOutput struct{ *pulumi.OutputState }
   276  
   277  func (RouteTableArrayOutput) ElementType() reflect.Type {
   278  	return reflect.TypeOf((*[]*RouteTable)(nil)).Elem()
   279  }
   280  
   281  func (o RouteTableArrayOutput) ToRouteTableArrayOutput() RouteTableArrayOutput {
   282  	return o
   283  }
   284  
   285  func (o RouteTableArrayOutput) ToRouteTableArrayOutputWithContext(ctx context.Context) RouteTableArrayOutput {
   286  	return o
   287  }
   288  
   289  func (o RouteTableArrayOutput) Index(i pulumi.IntInput) RouteTableOutput {
   290  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *RouteTable {
   291  		return vs[0].([]*RouteTable)[vs[1].(int)]
   292  	}).(RouteTableOutput)
   293  }
   294  
   295  type RouteTableMapOutput struct{ *pulumi.OutputState }
   296  
   297  func (RouteTableMapOutput) ElementType() reflect.Type {
   298  	return reflect.TypeOf((*map[string]*RouteTable)(nil)).Elem()
   299  }
   300  
   301  func (o RouteTableMapOutput) ToRouteTableMapOutput() RouteTableMapOutput {
   302  	return o
   303  }
   304  
   305  func (o RouteTableMapOutput) ToRouteTableMapOutputWithContext(ctx context.Context) RouteTableMapOutput {
   306  	return o
   307  }
   308  
   309  func (o RouteTableMapOutput) MapIndex(k pulumi.StringInput) RouteTableOutput {
   310  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *RouteTable {
   311  		return vs[0].(map[string]*RouteTable)[vs[1].(string)]
   312  	}).(RouteTableOutput)
   313  }
   314  
   315  func init() {
   316  	pulumi.RegisterInputType(reflect.TypeOf((*RouteTableInput)(nil)).Elem(), &RouteTable{})
   317  	pulumi.RegisterInputType(reflect.TypeOf((*RouteTableArrayInput)(nil)).Elem(), RouteTableArray{})
   318  	pulumi.RegisterInputType(reflect.TypeOf((*RouteTableMapInput)(nil)).Elem(), RouteTableMap{})
   319  	pulumi.RegisterOutputType(RouteTableOutput{})
   320  	pulumi.RegisterOutputType(RouteTableArrayOutput{})
   321  	pulumi.RegisterOutputType(RouteTableMapOutput{})
   322  }