github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/ec2transitgateway/routeTablePropagation.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 propagation.
    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.NewRouteTablePropagation(ctx, "example", &ec2transitgateway.RouteTablePropagationArgs{
    33  //				TransitGatewayAttachmentId: pulumi.Any(exampleAwsEc2TransitGatewayVpcAttachment.Id),
    34  //				TransitGatewayRouteTableId: pulumi.Any(exampleAwsEc2TransitGatewayRouteTable.Id),
    35  //			})
    36  //			if err != nil {
    37  //				return err
    38  //			}
    39  //			return nil
    40  //		})
    41  //	}
    42  //
    43  // ```
    44  // <!--End PulumiCodeChooser -->
    45  //
    46  // ## Import
    47  //
    48  // Using `pulumi import`, import `aws_ec2_transit_gateway_route_table_propagation` using the EC2 Transit Gateway Route Table identifier, an underscore, and the EC2 Transit Gateway Attachment identifier. For example:
    49  //
    50  // ```sh
    51  // $ pulumi import aws:ec2transitgateway/routeTablePropagation:RouteTablePropagation example tgw-rtb-12345678_tgw-attach-87654321
    52  // ```
    53  type RouteTablePropagation struct {
    54  	pulumi.CustomResourceState
    55  
    56  	// Identifier of the resource
    57  	ResourceId pulumi.StringOutput `pulumi:"resourceId"`
    58  	// Type of the resource
    59  	ResourceType pulumi.StringOutput `pulumi:"resourceType"`
    60  	// Identifier of EC2 Transit Gateway Attachment.
    61  	TransitGatewayAttachmentId pulumi.StringOutput `pulumi:"transitGatewayAttachmentId"`
    62  	// Identifier of EC2 Transit Gateway Route Table.
    63  	TransitGatewayRouteTableId pulumi.StringOutput `pulumi:"transitGatewayRouteTableId"`
    64  }
    65  
    66  // NewRouteTablePropagation registers a new resource with the given unique name, arguments, and options.
    67  func NewRouteTablePropagation(ctx *pulumi.Context,
    68  	name string, args *RouteTablePropagationArgs, opts ...pulumi.ResourceOption) (*RouteTablePropagation, error) {
    69  	if args == nil {
    70  		return nil, errors.New("missing one or more required arguments")
    71  	}
    72  
    73  	if args.TransitGatewayAttachmentId == nil {
    74  		return nil, errors.New("invalid value for required argument 'TransitGatewayAttachmentId'")
    75  	}
    76  	if args.TransitGatewayRouteTableId == nil {
    77  		return nil, errors.New("invalid value for required argument 'TransitGatewayRouteTableId'")
    78  	}
    79  	opts = internal.PkgResourceDefaultOpts(opts)
    80  	var resource RouteTablePropagation
    81  	err := ctx.RegisterResource("aws:ec2transitgateway/routeTablePropagation:RouteTablePropagation", name, args, &resource, opts...)
    82  	if err != nil {
    83  		return nil, err
    84  	}
    85  	return &resource, nil
    86  }
    87  
    88  // GetRouteTablePropagation gets an existing RouteTablePropagation resource's state with the given name, ID, and optional
    89  // state properties that are used to uniquely qualify the lookup (nil if not required).
    90  func GetRouteTablePropagation(ctx *pulumi.Context,
    91  	name string, id pulumi.IDInput, state *RouteTablePropagationState, opts ...pulumi.ResourceOption) (*RouteTablePropagation, error) {
    92  	var resource RouteTablePropagation
    93  	err := ctx.ReadResource("aws:ec2transitgateway/routeTablePropagation:RouteTablePropagation", name, id, state, &resource, opts...)
    94  	if err != nil {
    95  		return nil, err
    96  	}
    97  	return &resource, nil
    98  }
    99  
   100  // Input properties used for looking up and filtering RouteTablePropagation resources.
   101  type routeTablePropagationState struct {
   102  	// Identifier of the resource
   103  	ResourceId *string `pulumi:"resourceId"`
   104  	// Type of the resource
   105  	ResourceType *string `pulumi:"resourceType"`
   106  	// Identifier of EC2 Transit Gateway Attachment.
   107  	TransitGatewayAttachmentId *string `pulumi:"transitGatewayAttachmentId"`
   108  	// Identifier of EC2 Transit Gateway Route Table.
   109  	TransitGatewayRouteTableId *string `pulumi:"transitGatewayRouteTableId"`
   110  }
   111  
   112  type RouteTablePropagationState struct {
   113  	// Identifier of the resource
   114  	ResourceId pulumi.StringPtrInput
   115  	// Type of the resource
   116  	ResourceType pulumi.StringPtrInput
   117  	// Identifier of EC2 Transit Gateway Attachment.
   118  	TransitGatewayAttachmentId pulumi.StringPtrInput
   119  	// Identifier of EC2 Transit Gateway Route Table.
   120  	TransitGatewayRouteTableId pulumi.StringPtrInput
   121  }
   122  
   123  func (RouteTablePropagationState) ElementType() reflect.Type {
   124  	return reflect.TypeOf((*routeTablePropagationState)(nil)).Elem()
   125  }
   126  
   127  type routeTablePropagationArgs struct {
   128  	// Identifier of EC2 Transit Gateway Attachment.
   129  	TransitGatewayAttachmentId string `pulumi:"transitGatewayAttachmentId"`
   130  	// Identifier of EC2 Transit Gateway Route Table.
   131  	TransitGatewayRouteTableId string `pulumi:"transitGatewayRouteTableId"`
   132  }
   133  
   134  // The set of arguments for constructing a RouteTablePropagation resource.
   135  type RouteTablePropagationArgs struct {
   136  	// Identifier of EC2 Transit Gateway Attachment.
   137  	TransitGatewayAttachmentId pulumi.StringInput
   138  	// Identifier of EC2 Transit Gateway Route Table.
   139  	TransitGatewayRouteTableId pulumi.StringInput
   140  }
   141  
   142  func (RouteTablePropagationArgs) ElementType() reflect.Type {
   143  	return reflect.TypeOf((*routeTablePropagationArgs)(nil)).Elem()
   144  }
   145  
   146  type RouteTablePropagationInput interface {
   147  	pulumi.Input
   148  
   149  	ToRouteTablePropagationOutput() RouteTablePropagationOutput
   150  	ToRouteTablePropagationOutputWithContext(ctx context.Context) RouteTablePropagationOutput
   151  }
   152  
   153  func (*RouteTablePropagation) ElementType() reflect.Type {
   154  	return reflect.TypeOf((**RouteTablePropagation)(nil)).Elem()
   155  }
   156  
   157  func (i *RouteTablePropagation) ToRouteTablePropagationOutput() RouteTablePropagationOutput {
   158  	return i.ToRouteTablePropagationOutputWithContext(context.Background())
   159  }
   160  
   161  func (i *RouteTablePropagation) ToRouteTablePropagationOutputWithContext(ctx context.Context) RouteTablePropagationOutput {
   162  	return pulumi.ToOutputWithContext(ctx, i).(RouteTablePropagationOutput)
   163  }
   164  
   165  // RouteTablePropagationArrayInput is an input type that accepts RouteTablePropagationArray and RouteTablePropagationArrayOutput values.
   166  // You can construct a concrete instance of `RouteTablePropagationArrayInput` via:
   167  //
   168  //	RouteTablePropagationArray{ RouteTablePropagationArgs{...} }
   169  type RouteTablePropagationArrayInput interface {
   170  	pulumi.Input
   171  
   172  	ToRouteTablePropagationArrayOutput() RouteTablePropagationArrayOutput
   173  	ToRouteTablePropagationArrayOutputWithContext(context.Context) RouteTablePropagationArrayOutput
   174  }
   175  
   176  type RouteTablePropagationArray []RouteTablePropagationInput
   177  
   178  func (RouteTablePropagationArray) ElementType() reflect.Type {
   179  	return reflect.TypeOf((*[]*RouteTablePropagation)(nil)).Elem()
   180  }
   181  
   182  func (i RouteTablePropagationArray) ToRouteTablePropagationArrayOutput() RouteTablePropagationArrayOutput {
   183  	return i.ToRouteTablePropagationArrayOutputWithContext(context.Background())
   184  }
   185  
   186  func (i RouteTablePropagationArray) ToRouteTablePropagationArrayOutputWithContext(ctx context.Context) RouteTablePropagationArrayOutput {
   187  	return pulumi.ToOutputWithContext(ctx, i).(RouteTablePropagationArrayOutput)
   188  }
   189  
   190  // RouteTablePropagationMapInput is an input type that accepts RouteTablePropagationMap and RouteTablePropagationMapOutput values.
   191  // You can construct a concrete instance of `RouteTablePropagationMapInput` via:
   192  //
   193  //	RouteTablePropagationMap{ "key": RouteTablePropagationArgs{...} }
   194  type RouteTablePropagationMapInput interface {
   195  	pulumi.Input
   196  
   197  	ToRouteTablePropagationMapOutput() RouteTablePropagationMapOutput
   198  	ToRouteTablePropagationMapOutputWithContext(context.Context) RouteTablePropagationMapOutput
   199  }
   200  
   201  type RouteTablePropagationMap map[string]RouteTablePropagationInput
   202  
   203  func (RouteTablePropagationMap) ElementType() reflect.Type {
   204  	return reflect.TypeOf((*map[string]*RouteTablePropagation)(nil)).Elem()
   205  }
   206  
   207  func (i RouteTablePropagationMap) ToRouteTablePropagationMapOutput() RouteTablePropagationMapOutput {
   208  	return i.ToRouteTablePropagationMapOutputWithContext(context.Background())
   209  }
   210  
   211  func (i RouteTablePropagationMap) ToRouteTablePropagationMapOutputWithContext(ctx context.Context) RouteTablePropagationMapOutput {
   212  	return pulumi.ToOutputWithContext(ctx, i).(RouteTablePropagationMapOutput)
   213  }
   214  
   215  type RouteTablePropagationOutput struct{ *pulumi.OutputState }
   216  
   217  func (RouteTablePropagationOutput) ElementType() reflect.Type {
   218  	return reflect.TypeOf((**RouteTablePropagation)(nil)).Elem()
   219  }
   220  
   221  func (o RouteTablePropagationOutput) ToRouteTablePropagationOutput() RouteTablePropagationOutput {
   222  	return o
   223  }
   224  
   225  func (o RouteTablePropagationOutput) ToRouteTablePropagationOutputWithContext(ctx context.Context) RouteTablePropagationOutput {
   226  	return o
   227  }
   228  
   229  // Identifier of the resource
   230  func (o RouteTablePropagationOutput) ResourceId() pulumi.StringOutput {
   231  	return o.ApplyT(func(v *RouteTablePropagation) pulumi.StringOutput { return v.ResourceId }).(pulumi.StringOutput)
   232  }
   233  
   234  // Type of the resource
   235  func (o RouteTablePropagationOutput) ResourceType() pulumi.StringOutput {
   236  	return o.ApplyT(func(v *RouteTablePropagation) pulumi.StringOutput { return v.ResourceType }).(pulumi.StringOutput)
   237  }
   238  
   239  // Identifier of EC2 Transit Gateway Attachment.
   240  func (o RouteTablePropagationOutput) TransitGatewayAttachmentId() pulumi.StringOutput {
   241  	return o.ApplyT(func(v *RouteTablePropagation) pulumi.StringOutput { return v.TransitGatewayAttachmentId }).(pulumi.StringOutput)
   242  }
   243  
   244  // Identifier of EC2 Transit Gateway Route Table.
   245  func (o RouteTablePropagationOutput) TransitGatewayRouteTableId() pulumi.StringOutput {
   246  	return o.ApplyT(func(v *RouteTablePropagation) pulumi.StringOutput { return v.TransitGatewayRouteTableId }).(pulumi.StringOutput)
   247  }
   248  
   249  type RouteTablePropagationArrayOutput struct{ *pulumi.OutputState }
   250  
   251  func (RouteTablePropagationArrayOutput) ElementType() reflect.Type {
   252  	return reflect.TypeOf((*[]*RouteTablePropagation)(nil)).Elem()
   253  }
   254  
   255  func (o RouteTablePropagationArrayOutput) ToRouteTablePropagationArrayOutput() RouteTablePropagationArrayOutput {
   256  	return o
   257  }
   258  
   259  func (o RouteTablePropagationArrayOutput) ToRouteTablePropagationArrayOutputWithContext(ctx context.Context) RouteTablePropagationArrayOutput {
   260  	return o
   261  }
   262  
   263  func (o RouteTablePropagationArrayOutput) Index(i pulumi.IntInput) RouteTablePropagationOutput {
   264  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *RouteTablePropagation {
   265  		return vs[0].([]*RouteTablePropagation)[vs[1].(int)]
   266  	}).(RouteTablePropagationOutput)
   267  }
   268  
   269  type RouteTablePropagationMapOutput struct{ *pulumi.OutputState }
   270  
   271  func (RouteTablePropagationMapOutput) ElementType() reflect.Type {
   272  	return reflect.TypeOf((*map[string]*RouteTablePropagation)(nil)).Elem()
   273  }
   274  
   275  func (o RouteTablePropagationMapOutput) ToRouteTablePropagationMapOutput() RouteTablePropagationMapOutput {
   276  	return o
   277  }
   278  
   279  func (o RouteTablePropagationMapOutput) ToRouteTablePropagationMapOutputWithContext(ctx context.Context) RouteTablePropagationMapOutput {
   280  	return o
   281  }
   282  
   283  func (o RouteTablePropagationMapOutput) MapIndex(k pulumi.StringInput) RouteTablePropagationOutput {
   284  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *RouteTablePropagation {
   285  		return vs[0].(map[string]*RouteTablePropagation)[vs[1].(string)]
   286  	}).(RouteTablePropagationOutput)
   287  }
   288  
   289  func init() {
   290  	pulumi.RegisterInputType(reflect.TypeOf((*RouteTablePropagationInput)(nil)).Elem(), &RouteTablePropagation{})
   291  	pulumi.RegisterInputType(reflect.TypeOf((*RouteTablePropagationArrayInput)(nil)).Elem(), RouteTablePropagationArray{})
   292  	pulumi.RegisterInputType(reflect.TypeOf((*RouteTablePropagationMapInput)(nil)).Elem(), RouteTablePropagationMap{})
   293  	pulumi.RegisterOutputType(RouteTablePropagationOutput{})
   294  	pulumi.RegisterOutputType(RouteTablePropagationArrayOutput{})
   295  	pulumi.RegisterOutputType(RouteTablePropagationMapOutput{})
   296  }