github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/sesv2/dedicatedIpAssignment.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 sesv2
     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  // Resource for managing an AWS SESv2 (Simple Email V2) Dedicated IP Assignment.
    16  //
    17  // This resource is used with "Standard" dedicated IP addresses. This includes addresses [requested and relinquished manually](https://docs.aws.amazon.com/ses/latest/dg/dedicated-ip-case.html) via an AWS support case, or [Bring Your Own IP](https://docs.aws.amazon.com/ses/latest/dg/dedicated-ip-byo.html) addresses. Once no longer assigned, this resource returns the IP to the [`ses-default-dedicated-pool`](https://docs.aws.amazon.com/ses/latest/dg/managing-ip-pools.html), managed by AWS.
    18  //
    19  // ## Example Usage
    20  //
    21  // ### Basic Usage
    22  //
    23  // <!--Start PulumiCodeChooser -->
    24  // ```go
    25  // package main
    26  //
    27  // import (
    28  //
    29  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/sesv2"
    30  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    31  //
    32  // )
    33  //
    34  //	func main() {
    35  //		pulumi.Run(func(ctx *pulumi.Context) error {
    36  //			_, err := sesv2.NewDedicatedIpAssignment(ctx, "example", &sesv2.DedicatedIpAssignmentArgs{
    37  //				Ip:                  pulumi.String("0.0.0.0"),
    38  //				DestinationPoolName: pulumi.String("my-pool"),
    39  //			})
    40  //			if err != nil {
    41  //				return err
    42  //			}
    43  //			return nil
    44  //		})
    45  //	}
    46  //
    47  // ```
    48  // <!--End PulumiCodeChooser -->
    49  //
    50  // ## Import
    51  //
    52  // Using `pulumi import`, import SESv2 (Simple Email V2) Dedicated IP Assignment using the `id`, which is a comma-separated string made up of `ip` and `destination_pool_name`. For example:
    53  //
    54  // ```sh
    55  // $ pulumi import aws:sesv2/dedicatedIpAssignment:DedicatedIpAssignment example "0.0.0.0,my-pool"
    56  // ```
    57  type DedicatedIpAssignment struct {
    58  	pulumi.CustomResourceState
    59  
    60  	// Dedicated IP address.
    61  	DestinationPoolName pulumi.StringOutput `pulumi:"destinationPoolName"`
    62  	// Dedicated IP address.
    63  	Ip pulumi.StringOutput `pulumi:"ip"`
    64  }
    65  
    66  // NewDedicatedIpAssignment registers a new resource with the given unique name, arguments, and options.
    67  func NewDedicatedIpAssignment(ctx *pulumi.Context,
    68  	name string, args *DedicatedIpAssignmentArgs, opts ...pulumi.ResourceOption) (*DedicatedIpAssignment, error) {
    69  	if args == nil {
    70  		return nil, errors.New("missing one or more required arguments")
    71  	}
    72  
    73  	if args.DestinationPoolName == nil {
    74  		return nil, errors.New("invalid value for required argument 'DestinationPoolName'")
    75  	}
    76  	if args.Ip == nil {
    77  		return nil, errors.New("invalid value for required argument 'Ip'")
    78  	}
    79  	opts = internal.PkgResourceDefaultOpts(opts)
    80  	var resource DedicatedIpAssignment
    81  	err := ctx.RegisterResource("aws:sesv2/dedicatedIpAssignment:DedicatedIpAssignment", name, args, &resource, opts...)
    82  	if err != nil {
    83  		return nil, err
    84  	}
    85  	return &resource, nil
    86  }
    87  
    88  // GetDedicatedIpAssignment gets an existing DedicatedIpAssignment 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 GetDedicatedIpAssignment(ctx *pulumi.Context,
    91  	name string, id pulumi.IDInput, state *DedicatedIpAssignmentState, opts ...pulumi.ResourceOption) (*DedicatedIpAssignment, error) {
    92  	var resource DedicatedIpAssignment
    93  	err := ctx.ReadResource("aws:sesv2/dedicatedIpAssignment:DedicatedIpAssignment", 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 DedicatedIpAssignment resources.
   101  type dedicatedIpAssignmentState struct {
   102  	// Dedicated IP address.
   103  	DestinationPoolName *string `pulumi:"destinationPoolName"`
   104  	// Dedicated IP address.
   105  	Ip *string `pulumi:"ip"`
   106  }
   107  
   108  type DedicatedIpAssignmentState struct {
   109  	// Dedicated IP address.
   110  	DestinationPoolName pulumi.StringPtrInput
   111  	// Dedicated IP address.
   112  	Ip pulumi.StringPtrInput
   113  }
   114  
   115  func (DedicatedIpAssignmentState) ElementType() reflect.Type {
   116  	return reflect.TypeOf((*dedicatedIpAssignmentState)(nil)).Elem()
   117  }
   118  
   119  type dedicatedIpAssignmentArgs struct {
   120  	// Dedicated IP address.
   121  	DestinationPoolName string `pulumi:"destinationPoolName"`
   122  	// Dedicated IP address.
   123  	Ip string `pulumi:"ip"`
   124  }
   125  
   126  // The set of arguments for constructing a DedicatedIpAssignment resource.
   127  type DedicatedIpAssignmentArgs struct {
   128  	// Dedicated IP address.
   129  	DestinationPoolName pulumi.StringInput
   130  	// Dedicated IP address.
   131  	Ip pulumi.StringInput
   132  }
   133  
   134  func (DedicatedIpAssignmentArgs) ElementType() reflect.Type {
   135  	return reflect.TypeOf((*dedicatedIpAssignmentArgs)(nil)).Elem()
   136  }
   137  
   138  type DedicatedIpAssignmentInput interface {
   139  	pulumi.Input
   140  
   141  	ToDedicatedIpAssignmentOutput() DedicatedIpAssignmentOutput
   142  	ToDedicatedIpAssignmentOutputWithContext(ctx context.Context) DedicatedIpAssignmentOutput
   143  }
   144  
   145  func (*DedicatedIpAssignment) ElementType() reflect.Type {
   146  	return reflect.TypeOf((**DedicatedIpAssignment)(nil)).Elem()
   147  }
   148  
   149  func (i *DedicatedIpAssignment) ToDedicatedIpAssignmentOutput() DedicatedIpAssignmentOutput {
   150  	return i.ToDedicatedIpAssignmentOutputWithContext(context.Background())
   151  }
   152  
   153  func (i *DedicatedIpAssignment) ToDedicatedIpAssignmentOutputWithContext(ctx context.Context) DedicatedIpAssignmentOutput {
   154  	return pulumi.ToOutputWithContext(ctx, i).(DedicatedIpAssignmentOutput)
   155  }
   156  
   157  // DedicatedIpAssignmentArrayInput is an input type that accepts DedicatedIpAssignmentArray and DedicatedIpAssignmentArrayOutput values.
   158  // You can construct a concrete instance of `DedicatedIpAssignmentArrayInput` via:
   159  //
   160  //	DedicatedIpAssignmentArray{ DedicatedIpAssignmentArgs{...} }
   161  type DedicatedIpAssignmentArrayInput interface {
   162  	pulumi.Input
   163  
   164  	ToDedicatedIpAssignmentArrayOutput() DedicatedIpAssignmentArrayOutput
   165  	ToDedicatedIpAssignmentArrayOutputWithContext(context.Context) DedicatedIpAssignmentArrayOutput
   166  }
   167  
   168  type DedicatedIpAssignmentArray []DedicatedIpAssignmentInput
   169  
   170  func (DedicatedIpAssignmentArray) ElementType() reflect.Type {
   171  	return reflect.TypeOf((*[]*DedicatedIpAssignment)(nil)).Elem()
   172  }
   173  
   174  func (i DedicatedIpAssignmentArray) ToDedicatedIpAssignmentArrayOutput() DedicatedIpAssignmentArrayOutput {
   175  	return i.ToDedicatedIpAssignmentArrayOutputWithContext(context.Background())
   176  }
   177  
   178  func (i DedicatedIpAssignmentArray) ToDedicatedIpAssignmentArrayOutputWithContext(ctx context.Context) DedicatedIpAssignmentArrayOutput {
   179  	return pulumi.ToOutputWithContext(ctx, i).(DedicatedIpAssignmentArrayOutput)
   180  }
   181  
   182  // DedicatedIpAssignmentMapInput is an input type that accepts DedicatedIpAssignmentMap and DedicatedIpAssignmentMapOutput values.
   183  // You can construct a concrete instance of `DedicatedIpAssignmentMapInput` via:
   184  //
   185  //	DedicatedIpAssignmentMap{ "key": DedicatedIpAssignmentArgs{...} }
   186  type DedicatedIpAssignmentMapInput interface {
   187  	pulumi.Input
   188  
   189  	ToDedicatedIpAssignmentMapOutput() DedicatedIpAssignmentMapOutput
   190  	ToDedicatedIpAssignmentMapOutputWithContext(context.Context) DedicatedIpAssignmentMapOutput
   191  }
   192  
   193  type DedicatedIpAssignmentMap map[string]DedicatedIpAssignmentInput
   194  
   195  func (DedicatedIpAssignmentMap) ElementType() reflect.Type {
   196  	return reflect.TypeOf((*map[string]*DedicatedIpAssignment)(nil)).Elem()
   197  }
   198  
   199  func (i DedicatedIpAssignmentMap) ToDedicatedIpAssignmentMapOutput() DedicatedIpAssignmentMapOutput {
   200  	return i.ToDedicatedIpAssignmentMapOutputWithContext(context.Background())
   201  }
   202  
   203  func (i DedicatedIpAssignmentMap) ToDedicatedIpAssignmentMapOutputWithContext(ctx context.Context) DedicatedIpAssignmentMapOutput {
   204  	return pulumi.ToOutputWithContext(ctx, i).(DedicatedIpAssignmentMapOutput)
   205  }
   206  
   207  type DedicatedIpAssignmentOutput struct{ *pulumi.OutputState }
   208  
   209  func (DedicatedIpAssignmentOutput) ElementType() reflect.Type {
   210  	return reflect.TypeOf((**DedicatedIpAssignment)(nil)).Elem()
   211  }
   212  
   213  func (o DedicatedIpAssignmentOutput) ToDedicatedIpAssignmentOutput() DedicatedIpAssignmentOutput {
   214  	return o
   215  }
   216  
   217  func (o DedicatedIpAssignmentOutput) ToDedicatedIpAssignmentOutputWithContext(ctx context.Context) DedicatedIpAssignmentOutput {
   218  	return o
   219  }
   220  
   221  // Dedicated IP address.
   222  func (o DedicatedIpAssignmentOutput) DestinationPoolName() pulumi.StringOutput {
   223  	return o.ApplyT(func(v *DedicatedIpAssignment) pulumi.StringOutput { return v.DestinationPoolName }).(pulumi.StringOutput)
   224  }
   225  
   226  // Dedicated IP address.
   227  func (o DedicatedIpAssignmentOutput) Ip() pulumi.StringOutput {
   228  	return o.ApplyT(func(v *DedicatedIpAssignment) pulumi.StringOutput { return v.Ip }).(pulumi.StringOutput)
   229  }
   230  
   231  type DedicatedIpAssignmentArrayOutput struct{ *pulumi.OutputState }
   232  
   233  func (DedicatedIpAssignmentArrayOutput) ElementType() reflect.Type {
   234  	return reflect.TypeOf((*[]*DedicatedIpAssignment)(nil)).Elem()
   235  }
   236  
   237  func (o DedicatedIpAssignmentArrayOutput) ToDedicatedIpAssignmentArrayOutput() DedicatedIpAssignmentArrayOutput {
   238  	return o
   239  }
   240  
   241  func (o DedicatedIpAssignmentArrayOutput) ToDedicatedIpAssignmentArrayOutputWithContext(ctx context.Context) DedicatedIpAssignmentArrayOutput {
   242  	return o
   243  }
   244  
   245  func (o DedicatedIpAssignmentArrayOutput) Index(i pulumi.IntInput) DedicatedIpAssignmentOutput {
   246  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *DedicatedIpAssignment {
   247  		return vs[0].([]*DedicatedIpAssignment)[vs[1].(int)]
   248  	}).(DedicatedIpAssignmentOutput)
   249  }
   250  
   251  type DedicatedIpAssignmentMapOutput struct{ *pulumi.OutputState }
   252  
   253  func (DedicatedIpAssignmentMapOutput) ElementType() reflect.Type {
   254  	return reflect.TypeOf((*map[string]*DedicatedIpAssignment)(nil)).Elem()
   255  }
   256  
   257  func (o DedicatedIpAssignmentMapOutput) ToDedicatedIpAssignmentMapOutput() DedicatedIpAssignmentMapOutput {
   258  	return o
   259  }
   260  
   261  func (o DedicatedIpAssignmentMapOutput) ToDedicatedIpAssignmentMapOutputWithContext(ctx context.Context) DedicatedIpAssignmentMapOutput {
   262  	return o
   263  }
   264  
   265  func (o DedicatedIpAssignmentMapOutput) MapIndex(k pulumi.StringInput) DedicatedIpAssignmentOutput {
   266  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *DedicatedIpAssignment {
   267  		return vs[0].(map[string]*DedicatedIpAssignment)[vs[1].(string)]
   268  	}).(DedicatedIpAssignmentOutput)
   269  }
   270  
   271  func init() {
   272  	pulumi.RegisterInputType(reflect.TypeOf((*DedicatedIpAssignmentInput)(nil)).Elem(), &DedicatedIpAssignment{})
   273  	pulumi.RegisterInputType(reflect.TypeOf((*DedicatedIpAssignmentArrayInput)(nil)).Elem(), DedicatedIpAssignmentArray{})
   274  	pulumi.RegisterInputType(reflect.TypeOf((*DedicatedIpAssignmentMapInput)(nil)).Elem(), DedicatedIpAssignmentMap{})
   275  	pulumi.RegisterOutputType(DedicatedIpAssignmentOutput{})
   276  	pulumi.RegisterOutputType(DedicatedIpAssignmentArrayOutput{})
   277  	pulumi.RegisterOutputType(DedicatedIpAssignmentMapOutput{})
   278  }