github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/ec2transitgateway/peeringAttachmentAccepter.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 the accepter's side of an EC2 Transit Gateway Peering Attachment.
    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.NewPeeringAttachmentAccepter(ctx, "example", &ec2transitgateway.PeeringAttachmentAccepterArgs{
    33  //				TransitGatewayAttachmentId: pulumi.Any(exampleAwsEc2TransitGatewayPeeringAttachment.Id),
    34  //				Tags: pulumi.StringMap{
    35  //					"Name": pulumi.String("Example cross-account attachment"),
    36  //				},
    37  //			})
    38  //			if err != nil {
    39  //				return err
    40  //			}
    41  //			return nil
    42  //		})
    43  //	}
    44  //
    45  // ```
    46  // <!--End PulumiCodeChooser -->
    47  //
    48  // ## Import
    49  //
    50  // Using `pulumi import`, import `aws_ec2_transit_gateway_peering_attachment_accepter` using the EC2 Transit Gateway Attachment identifier. For example:
    51  //
    52  // ```sh
    53  // $ pulumi import aws:ec2transitgateway/peeringAttachmentAccepter:PeeringAttachmentAccepter example tgw-attach-12345678
    54  // ```
    55  type PeeringAttachmentAccepter struct {
    56  	pulumi.CustomResourceState
    57  
    58  	// Identifier of the AWS account that owns the EC2 TGW peering.
    59  	PeerAccountId pulumi.StringOutput `pulumi:"peerAccountId"`
    60  	PeerRegion    pulumi.StringOutput `pulumi:"peerRegion"`
    61  	// Identifier of EC2 Transit Gateway to peer with.
    62  	PeerTransitGatewayId pulumi.StringOutput `pulumi:"peerTransitGatewayId"`
    63  	// Key-value tags for the EC2 Transit Gateway Peering Attachment. 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 ID of the EC2 Transit Gateway Peering Attachment to manage.
    70  	TransitGatewayAttachmentId pulumi.StringOutput `pulumi:"transitGatewayAttachmentId"`
    71  	// Identifier of EC2 Transit Gateway.
    72  	TransitGatewayId pulumi.StringOutput `pulumi:"transitGatewayId"`
    73  }
    74  
    75  // NewPeeringAttachmentAccepter registers a new resource with the given unique name, arguments, and options.
    76  func NewPeeringAttachmentAccepter(ctx *pulumi.Context,
    77  	name string, args *PeeringAttachmentAccepterArgs, opts ...pulumi.ResourceOption) (*PeeringAttachmentAccepter, error) {
    78  	if args == nil {
    79  		return nil, errors.New("missing one or more required arguments")
    80  	}
    81  
    82  	if args.TransitGatewayAttachmentId == nil {
    83  		return nil, errors.New("invalid value for required argument 'TransitGatewayAttachmentId'")
    84  	}
    85  	aliases := pulumi.Aliases([]pulumi.Alias{
    86  		{
    87  			Type: pulumi.String("aws:ec2/transitGatewayPeeringAttachmentAccepter:TransitGatewayPeeringAttachmentAccepter"),
    88  		},
    89  	})
    90  	opts = append(opts, aliases)
    91  	opts = internal.PkgResourceDefaultOpts(opts)
    92  	var resource PeeringAttachmentAccepter
    93  	err := ctx.RegisterResource("aws:ec2transitgateway/peeringAttachmentAccepter:PeeringAttachmentAccepter", name, args, &resource, opts...)
    94  	if err != nil {
    95  		return nil, err
    96  	}
    97  	return &resource, nil
    98  }
    99  
   100  // GetPeeringAttachmentAccepter gets an existing PeeringAttachmentAccepter resource's state with the given name, ID, and optional
   101  // state properties that are used to uniquely qualify the lookup (nil if not required).
   102  func GetPeeringAttachmentAccepter(ctx *pulumi.Context,
   103  	name string, id pulumi.IDInput, state *PeeringAttachmentAccepterState, opts ...pulumi.ResourceOption) (*PeeringAttachmentAccepter, error) {
   104  	var resource PeeringAttachmentAccepter
   105  	err := ctx.ReadResource("aws:ec2transitgateway/peeringAttachmentAccepter:PeeringAttachmentAccepter", name, id, state, &resource, opts...)
   106  	if err != nil {
   107  		return nil, err
   108  	}
   109  	return &resource, nil
   110  }
   111  
   112  // Input properties used for looking up and filtering PeeringAttachmentAccepter resources.
   113  type peeringAttachmentAccepterState struct {
   114  	// Identifier of the AWS account that owns the EC2 TGW peering.
   115  	PeerAccountId *string `pulumi:"peerAccountId"`
   116  	PeerRegion    *string `pulumi:"peerRegion"`
   117  	// Identifier of EC2 Transit Gateway to peer with.
   118  	PeerTransitGatewayId *string `pulumi:"peerTransitGatewayId"`
   119  	// Key-value tags for the EC2 Transit Gateway Peering Attachment. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   120  	Tags map[string]string `pulumi:"tags"`
   121  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   122  	//
   123  	// Deprecated: Please use `tags` instead.
   124  	TagsAll map[string]string `pulumi:"tagsAll"`
   125  	// The ID of the EC2 Transit Gateway Peering Attachment to manage.
   126  	TransitGatewayAttachmentId *string `pulumi:"transitGatewayAttachmentId"`
   127  	// Identifier of EC2 Transit Gateway.
   128  	TransitGatewayId *string `pulumi:"transitGatewayId"`
   129  }
   130  
   131  type PeeringAttachmentAccepterState struct {
   132  	// Identifier of the AWS account that owns the EC2 TGW peering.
   133  	PeerAccountId pulumi.StringPtrInput
   134  	PeerRegion    pulumi.StringPtrInput
   135  	// Identifier of EC2 Transit Gateway to peer with.
   136  	PeerTransitGatewayId pulumi.StringPtrInput
   137  	// Key-value tags for the EC2 Transit Gateway Peering Attachment. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   138  	Tags pulumi.StringMapInput
   139  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   140  	//
   141  	// Deprecated: Please use `tags` instead.
   142  	TagsAll pulumi.StringMapInput
   143  	// The ID of the EC2 Transit Gateway Peering Attachment to manage.
   144  	TransitGatewayAttachmentId pulumi.StringPtrInput
   145  	// Identifier of EC2 Transit Gateway.
   146  	TransitGatewayId pulumi.StringPtrInput
   147  }
   148  
   149  func (PeeringAttachmentAccepterState) ElementType() reflect.Type {
   150  	return reflect.TypeOf((*peeringAttachmentAccepterState)(nil)).Elem()
   151  }
   152  
   153  type peeringAttachmentAccepterArgs struct {
   154  	// Key-value tags for the EC2 Transit Gateway Peering Attachment. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   155  	Tags map[string]string `pulumi:"tags"`
   156  	// The ID of the EC2 Transit Gateway Peering Attachment to manage.
   157  	TransitGatewayAttachmentId string `pulumi:"transitGatewayAttachmentId"`
   158  }
   159  
   160  // The set of arguments for constructing a PeeringAttachmentAccepter resource.
   161  type PeeringAttachmentAccepterArgs struct {
   162  	// Key-value tags for the EC2 Transit Gateway Peering Attachment. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   163  	Tags pulumi.StringMapInput
   164  	// The ID of the EC2 Transit Gateway Peering Attachment to manage.
   165  	TransitGatewayAttachmentId pulumi.StringInput
   166  }
   167  
   168  func (PeeringAttachmentAccepterArgs) ElementType() reflect.Type {
   169  	return reflect.TypeOf((*peeringAttachmentAccepterArgs)(nil)).Elem()
   170  }
   171  
   172  type PeeringAttachmentAccepterInput interface {
   173  	pulumi.Input
   174  
   175  	ToPeeringAttachmentAccepterOutput() PeeringAttachmentAccepterOutput
   176  	ToPeeringAttachmentAccepterOutputWithContext(ctx context.Context) PeeringAttachmentAccepterOutput
   177  }
   178  
   179  func (*PeeringAttachmentAccepter) ElementType() reflect.Type {
   180  	return reflect.TypeOf((**PeeringAttachmentAccepter)(nil)).Elem()
   181  }
   182  
   183  func (i *PeeringAttachmentAccepter) ToPeeringAttachmentAccepterOutput() PeeringAttachmentAccepterOutput {
   184  	return i.ToPeeringAttachmentAccepterOutputWithContext(context.Background())
   185  }
   186  
   187  func (i *PeeringAttachmentAccepter) ToPeeringAttachmentAccepterOutputWithContext(ctx context.Context) PeeringAttachmentAccepterOutput {
   188  	return pulumi.ToOutputWithContext(ctx, i).(PeeringAttachmentAccepterOutput)
   189  }
   190  
   191  // PeeringAttachmentAccepterArrayInput is an input type that accepts PeeringAttachmentAccepterArray and PeeringAttachmentAccepterArrayOutput values.
   192  // You can construct a concrete instance of `PeeringAttachmentAccepterArrayInput` via:
   193  //
   194  //	PeeringAttachmentAccepterArray{ PeeringAttachmentAccepterArgs{...} }
   195  type PeeringAttachmentAccepterArrayInput interface {
   196  	pulumi.Input
   197  
   198  	ToPeeringAttachmentAccepterArrayOutput() PeeringAttachmentAccepterArrayOutput
   199  	ToPeeringAttachmentAccepterArrayOutputWithContext(context.Context) PeeringAttachmentAccepterArrayOutput
   200  }
   201  
   202  type PeeringAttachmentAccepterArray []PeeringAttachmentAccepterInput
   203  
   204  func (PeeringAttachmentAccepterArray) ElementType() reflect.Type {
   205  	return reflect.TypeOf((*[]*PeeringAttachmentAccepter)(nil)).Elem()
   206  }
   207  
   208  func (i PeeringAttachmentAccepterArray) ToPeeringAttachmentAccepterArrayOutput() PeeringAttachmentAccepterArrayOutput {
   209  	return i.ToPeeringAttachmentAccepterArrayOutputWithContext(context.Background())
   210  }
   211  
   212  func (i PeeringAttachmentAccepterArray) ToPeeringAttachmentAccepterArrayOutputWithContext(ctx context.Context) PeeringAttachmentAccepterArrayOutput {
   213  	return pulumi.ToOutputWithContext(ctx, i).(PeeringAttachmentAccepterArrayOutput)
   214  }
   215  
   216  // PeeringAttachmentAccepterMapInput is an input type that accepts PeeringAttachmentAccepterMap and PeeringAttachmentAccepterMapOutput values.
   217  // You can construct a concrete instance of `PeeringAttachmentAccepterMapInput` via:
   218  //
   219  //	PeeringAttachmentAccepterMap{ "key": PeeringAttachmentAccepterArgs{...} }
   220  type PeeringAttachmentAccepterMapInput interface {
   221  	pulumi.Input
   222  
   223  	ToPeeringAttachmentAccepterMapOutput() PeeringAttachmentAccepterMapOutput
   224  	ToPeeringAttachmentAccepterMapOutputWithContext(context.Context) PeeringAttachmentAccepterMapOutput
   225  }
   226  
   227  type PeeringAttachmentAccepterMap map[string]PeeringAttachmentAccepterInput
   228  
   229  func (PeeringAttachmentAccepterMap) ElementType() reflect.Type {
   230  	return reflect.TypeOf((*map[string]*PeeringAttachmentAccepter)(nil)).Elem()
   231  }
   232  
   233  func (i PeeringAttachmentAccepterMap) ToPeeringAttachmentAccepterMapOutput() PeeringAttachmentAccepterMapOutput {
   234  	return i.ToPeeringAttachmentAccepterMapOutputWithContext(context.Background())
   235  }
   236  
   237  func (i PeeringAttachmentAccepterMap) ToPeeringAttachmentAccepterMapOutputWithContext(ctx context.Context) PeeringAttachmentAccepterMapOutput {
   238  	return pulumi.ToOutputWithContext(ctx, i).(PeeringAttachmentAccepterMapOutput)
   239  }
   240  
   241  type PeeringAttachmentAccepterOutput struct{ *pulumi.OutputState }
   242  
   243  func (PeeringAttachmentAccepterOutput) ElementType() reflect.Type {
   244  	return reflect.TypeOf((**PeeringAttachmentAccepter)(nil)).Elem()
   245  }
   246  
   247  func (o PeeringAttachmentAccepterOutput) ToPeeringAttachmentAccepterOutput() PeeringAttachmentAccepterOutput {
   248  	return o
   249  }
   250  
   251  func (o PeeringAttachmentAccepterOutput) ToPeeringAttachmentAccepterOutputWithContext(ctx context.Context) PeeringAttachmentAccepterOutput {
   252  	return o
   253  }
   254  
   255  // Identifier of the AWS account that owns the EC2 TGW peering.
   256  func (o PeeringAttachmentAccepterOutput) PeerAccountId() pulumi.StringOutput {
   257  	return o.ApplyT(func(v *PeeringAttachmentAccepter) pulumi.StringOutput { return v.PeerAccountId }).(pulumi.StringOutput)
   258  }
   259  
   260  func (o PeeringAttachmentAccepterOutput) PeerRegion() pulumi.StringOutput {
   261  	return o.ApplyT(func(v *PeeringAttachmentAccepter) pulumi.StringOutput { return v.PeerRegion }).(pulumi.StringOutput)
   262  }
   263  
   264  // Identifier of EC2 Transit Gateway to peer with.
   265  func (o PeeringAttachmentAccepterOutput) PeerTransitGatewayId() pulumi.StringOutput {
   266  	return o.ApplyT(func(v *PeeringAttachmentAccepter) pulumi.StringOutput { return v.PeerTransitGatewayId }).(pulumi.StringOutput)
   267  }
   268  
   269  // Key-value tags for the EC2 Transit Gateway Peering Attachment. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   270  func (o PeeringAttachmentAccepterOutput) Tags() pulumi.StringMapOutput {
   271  	return o.ApplyT(func(v *PeeringAttachmentAccepter) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   272  }
   273  
   274  // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   275  //
   276  // Deprecated: Please use `tags` instead.
   277  func (o PeeringAttachmentAccepterOutput) TagsAll() pulumi.StringMapOutput {
   278  	return o.ApplyT(func(v *PeeringAttachmentAccepter) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   279  }
   280  
   281  // The ID of the EC2 Transit Gateway Peering Attachment to manage.
   282  func (o PeeringAttachmentAccepterOutput) TransitGatewayAttachmentId() pulumi.StringOutput {
   283  	return o.ApplyT(func(v *PeeringAttachmentAccepter) pulumi.StringOutput { return v.TransitGatewayAttachmentId }).(pulumi.StringOutput)
   284  }
   285  
   286  // Identifier of EC2 Transit Gateway.
   287  func (o PeeringAttachmentAccepterOutput) TransitGatewayId() pulumi.StringOutput {
   288  	return o.ApplyT(func(v *PeeringAttachmentAccepter) pulumi.StringOutput { return v.TransitGatewayId }).(pulumi.StringOutput)
   289  }
   290  
   291  type PeeringAttachmentAccepterArrayOutput struct{ *pulumi.OutputState }
   292  
   293  func (PeeringAttachmentAccepterArrayOutput) ElementType() reflect.Type {
   294  	return reflect.TypeOf((*[]*PeeringAttachmentAccepter)(nil)).Elem()
   295  }
   296  
   297  func (o PeeringAttachmentAccepterArrayOutput) ToPeeringAttachmentAccepterArrayOutput() PeeringAttachmentAccepterArrayOutput {
   298  	return o
   299  }
   300  
   301  func (o PeeringAttachmentAccepterArrayOutput) ToPeeringAttachmentAccepterArrayOutputWithContext(ctx context.Context) PeeringAttachmentAccepterArrayOutput {
   302  	return o
   303  }
   304  
   305  func (o PeeringAttachmentAccepterArrayOutput) Index(i pulumi.IntInput) PeeringAttachmentAccepterOutput {
   306  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *PeeringAttachmentAccepter {
   307  		return vs[0].([]*PeeringAttachmentAccepter)[vs[1].(int)]
   308  	}).(PeeringAttachmentAccepterOutput)
   309  }
   310  
   311  type PeeringAttachmentAccepterMapOutput struct{ *pulumi.OutputState }
   312  
   313  func (PeeringAttachmentAccepterMapOutput) ElementType() reflect.Type {
   314  	return reflect.TypeOf((*map[string]*PeeringAttachmentAccepter)(nil)).Elem()
   315  }
   316  
   317  func (o PeeringAttachmentAccepterMapOutput) ToPeeringAttachmentAccepterMapOutput() PeeringAttachmentAccepterMapOutput {
   318  	return o
   319  }
   320  
   321  func (o PeeringAttachmentAccepterMapOutput) ToPeeringAttachmentAccepterMapOutputWithContext(ctx context.Context) PeeringAttachmentAccepterMapOutput {
   322  	return o
   323  }
   324  
   325  func (o PeeringAttachmentAccepterMapOutput) MapIndex(k pulumi.StringInput) PeeringAttachmentAccepterOutput {
   326  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *PeeringAttachmentAccepter {
   327  		return vs[0].(map[string]*PeeringAttachmentAccepter)[vs[1].(string)]
   328  	}).(PeeringAttachmentAccepterOutput)
   329  }
   330  
   331  func init() {
   332  	pulumi.RegisterInputType(reflect.TypeOf((*PeeringAttachmentAccepterInput)(nil)).Elem(), &PeeringAttachmentAccepter{})
   333  	pulumi.RegisterInputType(reflect.TypeOf((*PeeringAttachmentAccepterArrayInput)(nil)).Elem(), PeeringAttachmentAccepterArray{})
   334  	pulumi.RegisterInputType(reflect.TypeOf((*PeeringAttachmentAccepterMapInput)(nil)).Elem(), PeeringAttachmentAccepterMap{})
   335  	pulumi.RegisterOutputType(PeeringAttachmentAccepterOutput{})
   336  	pulumi.RegisterOutputType(PeeringAttachmentAccepterArrayOutput{})
   337  	pulumi.RegisterOutputType(PeeringAttachmentAccepterMapOutput{})
   338  }