github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/s3outposts/endpoint.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 s3outposts
     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  // Provides a resource to manage an S3 Outposts Endpoint.
    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/s3outposts"
    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 := s3outposts.NewEndpoint(ctx, "example", &s3outposts.EndpointArgs{
    33  //				OutpostId:       pulumi.Any(exampleAwsOutpostsOutpost.Id),
    34  //				SecurityGroupId: pulumi.Any(exampleAwsSecurityGroup.Id),
    35  //				SubnetId:        pulumi.Any(exampleAwsSubnet.Id),
    36  //			})
    37  //			if err != nil {
    38  //				return err
    39  //			}
    40  //			return nil
    41  //		})
    42  //	}
    43  //
    44  // ```
    45  // <!--End PulumiCodeChooser -->
    46  //
    47  // ## Import
    48  //
    49  // Using `pulumi import`, import S3 Outposts Endpoints using Amazon Resource Name (ARN), EC2 Security Group identifier, and EC2 Subnet identifier, separated by commas (`,`). For example:
    50  //
    51  // ```sh
    52  // $ pulumi import aws:s3outposts/endpoint:Endpoint example arn:aws:s3-outposts:us-east-1:123456789012:outpost/op-12345678/endpoint/0123456789abcdef,sg-12345678,subnet-12345678
    53  // ```
    54  type Endpoint struct {
    55  	pulumi.CustomResourceState
    56  
    57  	// Type of access for the network connectivity. Valid values are `Private` or `CustomerOwnedIp`.
    58  	AccessType pulumi.StringOutput `pulumi:"accessType"`
    59  	// Amazon Resource Name (ARN) of the endpoint.
    60  	Arn pulumi.StringOutput `pulumi:"arn"`
    61  	// VPC CIDR block of the endpoint.
    62  	CidrBlock pulumi.StringOutput `pulumi:"cidrBlock"`
    63  	// UTC creation time in [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8).
    64  	CreationTime pulumi.StringOutput `pulumi:"creationTime"`
    65  	// The ID of a Customer Owned IP Pool. For more on customer owned IP addresses see the [User Guide](https://docs.aws.amazon.com/outposts/latest/userguide/local-rack.html#local-gateway-subnet).
    66  	CustomerOwnedIpv4Pool pulumi.StringPtrOutput `pulumi:"customerOwnedIpv4Pool"`
    67  	// Set of nested attributes for associated Elastic Network Interfaces (ENIs).
    68  	NetworkInterfaces EndpointNetworkInterfaceArrayOutput `pulumi:"networkInterfaces"`
    69  	// Identifier of the Outpost to contain this endpoint.
    70  	OutpostId pulumi.StringOutput `pulumi:"outpostId"`
    71  	// Identifier of the EC2 Security Group.
    72  	SecurityGroupId pulumi.StringOutput `pulumi:"securityGroupId"`
    73  	// Identifier of the EC2 Subnet.
    74  	SubnetId pulumi.StringOutput `pulumi:"subnetId"`
    75  }
    76  
    77  // NewEndpoint registers a new resource with the given unique name, arguments, and options.
    78  func NewEndpoint(ctx *pulumi.Context,
    79  	name string, args *EndpointArgs, opts ...pulumi.ResourceOption) (*Endpoint, error) {
    80  	if args == nil {
    81  		return nil, errors.New("missing one or more required arguments")
    82  	}
    83  
    84  	if args.OutpostId == nil {
    85  		return nil, errors.New("invalid value for required argument 'OutpostId'")
    86  	}
    87  	if args.SecurityGroupId == nil {
    88  		return nil, errors.New("invalid value for required argument 'SecurityGroupId'")
    89  	}
    90  	if args.SubnetId == nil {
    91  		return nil, errors.New("invalid value for required argument 'SubnetId'")
    92  	}
    93  	opts = internal.PkgResourceDefaultOpts(opts)
    94  	var resource Endpoint
    95  	err := ctx.RegisterResource("aws:s3outposts/endpoint:Endpoint", name, args, &resource, opts...)
    96  	if err != nil {
    97  		return nil, err
    98  	}
    99  	return &resource, nil
   100  }
   101  
   102  // GetEndpoint gets an existing Endpoint resource's state with the given name, ID, and optional
   103  // state properties that are used to uniquely qualify the lookup (nil if not required).
   104  func GetEndpoint(ctx *pulumi.Context,
   105  	name string, id pulumi.IDInput, state *EndpointState, opts ...pulumi.ResourceOption) (*Endpoint, error) {
   106  	var resource Endpoint
   107  	err := ctx.ReadResource("aws:s3outposts/endpoint:Endpoint", name, id, state, &resource, opts...)
   108  	if err != nil {
   109  		return nil, err
   110  	}
   111  	return &resource, nil
   112  }
   113  
   114  // Input properties used for looking up and filtering Endpoint resources.
   115  type endpointState struct {
   116  	// Type of access for the network connectivity. Valid values are `Private` or `CustomerOwnedIp`.
   117  	AccessType *string `pulumi:"accessType"`
   118  	// Amazon Resource Name (ARN) of the endpoint.
   119  	Arn *string `pulumi:"arn"`
   120  	// VPC CIDR block of the endpoint.
   121  	CidrBlock *string `pulumi:"cidrBlock"`
   122  	// UTC creation time in [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8).
   123  	CreationTime *string `pulumi:"creationTime"`
   124  	// The ID of a Customer Owned IP Pool. For more on customer owned IP addresses see the [User Guide](https://docs.aws.amazon.com/outposts/latest/userguide/local-rack.html#local-gateway-subnet).
   125  	CustomerOwnedIpv4Pool *string `pulumi:"customerOwnedIpv4Pool"`
   126  	// Set of nested attributes for associated Elastic Network Interfaces (ENIs).
   127  	NetworkInterfaces []EndpointNetworkInterface `pulumi:"networkInterfaces"`
   128  	// Identifier of the Outpost to contain this endpoint.
   129  	OutpostId *string `pulumi:"outpostId"`
   130  	// Identifier of the EC2 Security Group.
   131  	SecurityGroupId *string `pulumi:"securityGroupId"`
   132  	// Identifier of the EC2 Subnet.
   133  	SubnetId *string `pulumi:"subnetId"`
   134  }
   135  
   136  type EndpointState struct {
   137  	// Type of access for the network connectivity. Valid values are `Private` or `CustomerOwnedIp`.
   138  	AccessType pulumi.StringPtrInput
   139  	// Amazon Resource Name (ARN) of the endpoint.
   140  	Arn pulumi.StringPtrInput
   141  	// VPC CIDR block of the endpoint.
   142  	CidrBlock pulumi.StringPtrInput
   143  	// UTC creation time in [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8).
   144  	CreationTime pulumi.StringPtrInput
   145  	// The ID of a Customer Owned IP Pool. For more on customer owned IP addresses see the [User Guide](https://docs.aws.amazon.com/outposts/latest/userguide/local-rack.html#local-gateway-subnet).
   146  	CustomerOwnedIpv4Pool pulumi.StringPtrInput
   147  	// Set of nested attributes for associated Elastic Network Interfaces (ENIs).
   148  	NetworkInterfaces EndpointNetworkInterfaceArrayInput
   149  	// Identifier of the Outpost to contain this endpoint.
   150  	OutpostId pulumi.StringPtrInput
   151  	// Identifier of the EC2 Security Group.
   152  	SecurityGroupId pulumi.StringPtrInput
   153  	// Identifier of the EC2 Subnet.
   154  	SubnetId pulumi.StringPtrInput
   155  }
   156  
   157  func (EndpointState) ElementType() reflect.Type {
   158  	return reflect.TypeOf((*endpointState)(nil)).Elem()
   159  }
   160  
   161  type endpointArgs struct {
   162  	// Type of access for the network connectivity. Valid values are `Private` or `CustomerOwnedIp`.
   163  	AccessType *string `pulumi:"accessType"`
   164  	// The ID of a Customer Owned IP Pool. For more on customer owned IP addresses see the [User Guide](https://docs.aws.amazon.com/outposts/latest/userguide/local-rack.html#local-gateway-subnet).
   165  	CustomerOwnedIpv4Pool *string `pulumi:"customerOwnedIpv4Pool"`
   166  	// Identifier of the Outpost to contain this endpoint.
   167  	OutpostId string `pulumi:"outpostId"`
   168  	// Identifier of the EC2 Security Group.
   169  	SecurityGroupId string `pulumi:"securityGroupId"`
   170  	// Identifier of the EC2 Subnet.
   171  	SubnetId string `pulumi:"subnetId"`
   172  }
   173  
   174  // The set of arguments for constructing a Endpoint resource.
   175  type EndpointArgs struct {
   176  	// Type of access for the network connectivity. Valid values are `Private` or `CustomerOwnedIp`.
   177  	AccessType pulumi.StringPtrInput
   178  	// The ID of a Customer Owned IP Pool. For more on customer owned IP addresses see the [User Guide](https://docs.aws.amazon.com/outposts/latest/userguide/local-rack.html#local-gateway-subnet).
   179  	CustomerOwnedIpv4Pool pulumi.StringPtrInput
   180  	// Identifier of the Outpost to contain this endpoint.
   181  	OutpostId pulumi.StringInput
   182  	// Identifier of the EC2 Security Group.
   183  	SecurityGroupId pulumi.StringInput
   184  	// Identifier of the EC2 Subnet.
   185  	SubnetId pulumi.StringInput
   186  }
   187  
   188  func (EndpointArgs) ElementType() reflect.Type {
   189  	return reflect.TypeOf((*endpointArgs)(nil)).Elem()
   190  }
   191  
   192  type EndpointInput interface {
   193  	pulumi.Input
   194  
   195  	ToEndpointOutput() EndpointOutput
   196  	ToEndpointOutputWithContext(ctx context.Context) EndpointOutput
   197  }
   198  
   199  func (*Endpoint) ElementType() reflect.Type {
   200  	return reflect.TypeOf((**Endpoint)(nil)).Elem()
   201  }
   202  
   203  func (i *Endpoint) ToEndpointOutput() EndpointOutput {
   204  	return i.ToEndpointOutputWithContext(context.Background())
   205  }
   206  
   207  func (i *Endpoint) ToEndpointOutputWithContext(ctx context.Context) EndpointOutput {
   208  	return pulumi.ToOutputWithContext(ctx, i).(EndpointOutput)
   209  }
   210  
   211  // EndpointArrayInput is an input type that accepts EndpointArray and EndpointArrayOutput values.
   212  // You can construct a concrete instance of `EndpointArrayInput` via:
   213  //
   214  //	EndpointArray{ EndpointArgs{...} }
   215  type EndpointArrayInput interface {
   216  	pulumi.Input
   217  
   218  	ToEndpointArrayOutput() EndpointArrayOutput
   219  	ToEndpointArrayOutputWithContext(context.Context) EndpointArrayOutput
   220  }
   221  
   222  type EndpointArray []EndpointInput
   223  
   224  func (EndpointArray) ElementType() reflect.Type {
   225  	return reflect.TypeOf((*[]*Endpoint)(nil)).Elem()
   226  }
   227  
   228  func (i EndpointArray) ToEndpointArrayOutput() EndpointArrayOutput {
   229  	return i.ToEndpointArrayOutputWithContext(context.Background())
   230  }
   231  
   232  func (i EndpointArray) ToEndpointArrayOutputWithContext(ctx context.Context) EndpointArrayOutput {
   233  	return pulumi.ToOutputWithContext(ctx, i).(EndpointArrayOutput)
   234  }
   235  
   236  // EndpointMapInput is an input type that accepts EndpointMap and EndpointMapOutput values.
   237  // You can construct a concrete instance of `EndpointMapInput` via:
   238  //
   239  //	EndpointMap{ "key": EndpointArgs{...} }
   240  type EndpointMapInput interface {
   241  	pulumi.Input
   242  
   243  	ToEndpointMapOutput() EndpointMapOutput
   244  	ToEndpointMapOutputWithContext(context.Context) EndpointMapOutput
   245  }
   246  
   247  type EndpointMap map[string]EndpointInput
   248  
   249  func (EndpointMap) ElementType() reflect.Type {
   250  	return reflect.TypeOf((*map[string]*Endpoint)(nil)).Elem()
   251  }
   252  
   253  func (i EndpointMap) ToEndpointMapOutput() EndpointMapOutput {
   254  	return i.ToEndpointMapOutputWithContext(context.Background())
   255  }
   256  
   257  func (i EndpointMap) ToEndpointMapOutputWithContext(ctx context.Context) EndpointMapOutput {
   258  	return pulumi.ToOutputWithContext(ctx, i).(EndpointMapOutput)
   259  }
   260  
   261  type EndpointOutput struct{ *pulumi.OutputState }
   262  
   263  func (EndpointOutput) ElementType() reflect.Type {
   264  	return reflect.TypeOf((**Endpoint)(nil)).Elem()
   265  }
   266  
   267  func (o EndpointOutput) ToEndpointOutput() EndpointOutput {
   268  	return o
   269  }
   270  
   271  func (o EndpointOutput) ToEndpointOutputWithContext(ctx context.Context) EndpointOutput {
   272  	return o
   273  }
   274  
   275  // Type of access for the network connectivity. Valid values are `Private` or `CustomerOwnedIp`.
   276  func (o EndpointOutput) AccessType() pulumi.StringOutput {
   277  	return o.ApplyT(func(v *Endpoint) pulumi.StringOutput { return v.AccessType }).(pulumi.StringOutput)
   278  }
   279  
   280  // Amazon Resource Name (ARN) of the endpoint.
   281  func (o EndpointOutput) Arn() pulumi.StringOutput {
   282  	return o.ApplyT(func(v *Endpoint) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   283  }
   284  
   285  // VPC CIDR block of the endpoint.
   286  func (o EndpointOutput) CidrBlock() pulumi.StringOutput {
   287  	return o.ApplyT(func(v *Endpoint) pulumi.StringOutput { return v.CidrBlock }).(pulumi.StringOutput)
   288  }
   289  
   290  // UTC creation time in [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8).
   291  func (o EndpointOutput) CreationTime() pulumi.StringOutput {
   292  	return o.ApplyT(func(v *Endpoint) pulumi.StringOutput { return v.CreationTime }).(pulumi.StringOutput)
   293  }
   294  
   295  // The ID of a Customer Owned IP Pool. For more on customer owned IP addresses see the [User Guide](https://docs.aws.amazon.com/outposts/latest/userguide/local-rack.html#local-gateway-subnet).
   296  func (o EndpointOutput) CustomerOwnedIpv4Pool() pulumi.StringPtrOutput {
   297  	return o.ApplyT(func(v *Endpoint) pulumi.StringPtrOutput { return v.CustomerOwnedIpv4Pool }).(pulumi.StringPtrOutput)
   298  }
   299  
   300  // Set of nested attributes for associated Elastic Network Interfaces (ENIs).
   301  func (o EndpointOutput) NetworkInterfaces() EndpointNetworkInterfaceArrayOutput {
   302  	return o.ApplyT(func(v *Endpoint) EndpointNetworkInterfaceArrayOutput { return v.NetworkInterfaces }).(EndpointNetworkInterfaceArrayOutput)
   303  }
   304  
   305  // Identifier of the Outpost to contain this endpoint.
   306  func (o EndpointOutput) OutpostId() pulumi.StringOutput {
   307  	return o.ApplyT(func(v *Endpoint) pulumi.StringOutput { return v.OutpostId }).(pulumi.StringOutput)
   308  }
   309  
   310  // Identifier of the EC2 Security Group.
   311  func (o EndpointOutput) SecurityGroupId() pulumi.StringOutput {
   312  	return o.ApplyT(func(v *Endpoint) pulumi.StringOutput { return v.SecurityGroupId }).(pulumi.StringOutput)
   313  }
   314  
   315  // Identifier of the EC2 Subnet.
   316  func (o EndpointOutput) SubnetId() pulumi.StringOutput {
   317  	return o.ApplyT(func(v *Endpoint) pulumi.StringOutput { return v.SubnetId }).(pulumi.StringOutput)
   318  }
   319  
   320  type EndpointArrayOutput struct{ *pulumi.OutputState }
   321  
   322  func (EndpointArrayOutput) ElementType() reflect.Type {
   323  	return reflect.TypeOf((*[]*Endpoint)(nil)).Elem()
   324  }
   325  
   326  func (o EndpointArrayOutput) ToEndpointArrayOutput() EndpointArrayOutput {
   327  	return o
   328  }
   329  
   330  func (o EndpointArrayOutput) ToEndpointArrayOutputWithContext(ctx context.Context) EndpointArrayOutput {
   331  	return o
   332  }
   333  
   334  func (o EndpointArrayOutput) Index(i pulumi.IntInput) EndpointOutput {
   335  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Endpoint {
   336  		return vs[0].([]*Endpoint)[vs[1].(int)]
   337  	}).(EndpointOutput)
   338  }
   339  
   340  type EndpointMapOutput struct{ *pulumi.OutputState }
   341  
   342  func (EndpointMapOutput) ElementType() reflect.Type {
   343  	return reflect.TypeOf((*map[string]*Endpoint)(nil)).Elem()
   344  }
   345  
   346  func (o EndpointMapOutput) ToEndpointMapOutput() EndpointMapOutput {
   347  	return o
   348  }
   349  
   350  func (o EndpointMapOutput) ToEndpointMapOutputWithContext(ctx context.Context) EndpointMapOutput {
   351  	return o
   352  }
   353  
   354  func (o EndpointMapOutput) MapIndex(k pulumi.StringInput) EndpointOutput {
   355  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Endpoint {
   356  		return vs[0].(map[string]*Endpoint)[vs[1].(string)]
   357  	}).(EndpointOutput)
   358  }
   359  
   360  func init() {
   361  	pulumi.RegisterInputType(reflect.TypeOf((*EndpointInput)(nil)).Elem(), &Endpoint{})
   362  	pulumi.RegisterInputType(reflect.TypeOf((*EndpointArrayInput)(nil)).Elem(), EndpointArray{})
   363  	pulumi.RegisterInputType(reflect.TypeOf((*EndpointMapInput)(nil)).Elem(), EndpointMap{})
   364  	pulumi.RegisterOutputType(EndpointOutput{})
   365  	pulumi.RegisterOutputType(EndpointArrayOutput{})
   366  	pulumi.RegisterOutputType(EndpointMapOutput{})
   367  }