github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/account/alternativeContact.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 account
     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 specified alternate contact attached to an AWS Account.
    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/account"
    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 := account.NewAlternativeContact(ctx, "operations", &account.AlternativeContactArgs{
    33  //				AlternateContactType: pulumi.String("OPERATIONS"),
    34  //				Name:                 pulumi.String("Example"),
    35  //				Title:                pulumi.String("Example"),
    36  //				EmailAddress:         pulumi.String("test@example.com"),
    37  //				PhoneNumber:          pulumi.String("+1234567890"),
    38  //			})
    39  //			if err != nil {
    40  //				return err
    41  //			}
    42  //			return nil
    43  //		})
    44  //	}
    45  //
    46  // ```
    47  // <!--End PulumiCodeChooser -->
    48  //
    49  // ## Import
    50  //
    51  // Import the Alternate Contact for another account using the `account_id` and `alternate_contact_type` separated by a forward slash (`/`):
    52  //
    53  // __Using `pulumi import` to import__ the Alternate Contact for the current or another account using the `alternate_contact_type`. For example:
    54  //
    55  // Import the Alternate Contact for the current account:
    56  //
    57  // ```sh
    58  // $ pulumi import aws:account/alternativeContact:AlternativeContact operations OPERATIONS
    59  // ```
    60  // Import the Alternate Contact for another account using the `account_id` and `alternate_contact_type` separated by a forward slash (`/`):
    61  //
    62  // ```sh
    63  // $ pulumi import aws:account/alternativeContact:AlternativeContact operations 1234567890/OPERATIONS
    64  // ```
    65  type AlternativeContact struct {
    66  	pulumi.CustomResourceState
    67  
    68  	// ID of the target account when managing member accounts. Will manage current user's account by default if omitted.
    69  	AccountId pulumi.StringPtrOutput `pulumi:"accountId"`
    70  	// Type of the alternate contact. Allowed values are: `BILLING`, `OPERATIONS`, `SECURITY`.
    71  	AlternateContactType pulumi.StringOutput `pulumi:"alternateContactType"`
    72  	// An email address for the alternate contact.
    73  	EmailAddress pulumi.StringOutput `pulumi:"emailAddress"`
    74  	// Name of the alternate contact.
    75  	Name pulumi.StringOutput `pulumi:"name"`
    76  	// Phone number for the alternate contact.
    77  	PhoneNumber pulumi.StringOutput `pulumi:"phoneNumber"`
    78  	// Title for the alternate contact.
    79  	Title pulumi.StringOutput `pulumi:"title"`
    80  }
    81  
    82  // NewAlternativeContact registers a new resource with the given unique name, arguments, and options.
    83  func NewAlternativeContact(ctx *pulumi.Context,
    84  	name string, args *AlternativeContactArgs, opts ...pulumi.ResourceOption) (*AlternativeContact, error) {
    85  	if args == nil {
    86  		return nil, errors.New("missing one or more required arguments")
    87  	}
    88  
    89  	if args.AlternateContactType == nil {
    90  		return nil, errors.New("invalid value for required argument 'AlternateContactType'")
    91  	}
    92  	if args.EmailAddress == nil {
    93  		return nil, errors.New("invalid value for required argument 'EmailAddress'")
    94  	}
    95  	if args.PhoneNumber == nil {
    96  		return nil, errors.New("invalid value for required argument 'PhoneNumber'")
    97  	}
    98  	if args.Title == nil {
    99  		return nil, errors.New("invalid value for required argument 'Title'")
   100  	}
   101  	opts = internal.PkgResourceDefaultOpts(opts)
   102  	var resource AlternativeContact
   103  	err := ctx.RegisterResource("aws:account/alternativeContact:AlternativeContact", name, args, &resource, opts...)
   104  	if err != nil {
   105  		return nil, err
   106  	}
   107  	return &resource, nil
   108  }
   109  
   110  // GetAlternativeContact gets an existing AlternativeContact resource's state with the given name, ID, and optional
   111  // state properties that are used to uniquely qualify the lookup (nil if not required).
   112  func GetAlternativeContact(ctx *pulumi.Context,
   113  	name string, id pulumi.IDInput, state *AlternativeContactState, opts ...pulumi.ResourceOption) (*AlternativeContact, error) {
   114  	var resource AlternativeContact
   115  	err := ctx.ReadResource("aws:account/alternativeContact:AlternativeContact", name, id, state, &resource, opts...)
   116  	if err != nil {
   117  		return nil, err
   118  	}
   119  	return &resource, nil
   120  }
   121  
   122  // Input properties used for looking up and filtering AlternativeContact resources.
   123  type alternativeContactState struct {
   124  	// ID of the target account when managing member accounts. Will manage current user's account by default if omitted.
   125  	AccountId *string `pulumi:"accountId"`
   126  	// Type of the alternate contact. Allowed values are: `BILLING`, `OPERATIONS`, `SECURITY`.
   127  	AlternateContactType *string `pulumi:"alternateContactType"`
   128  	// An email address for the alternate contact.
   129  	EmailAddress *string `pulumi:"emailAddress"`
   130  	// Name of the alternate contact.
   131  	Name *string `pulumi:"name"`
   132  	// Phone number for the alternate contact.
   133  	PhoneNumber *string `pulumi:"phoneNumber"`
   134  	// Title for the alternate contact.
   135  	Title *string `pulumi:"title"`
   136  }
   137  
   138  type AlternativeContactState struct {
   139  	// ID of the target account when managing member accounts. Will manage current user's account by default if omitted.
   140  	AccountId pulumi.StringPtrInput
   141  	// Type of the alternate contact. Allowed values are: `BILLING`, `OPERATIONS`, `SECURITY`.
   142  	AlternateContactType pulumi.StringPtrInput
   143  	// An email address for the alternate contact.
   144  	EmailAddress pulumi.StringPtrInput
   145  	// Name of the alternate contact.
   146  	Name pulumi.StringPtrInput
   147  	// Phone number for the alternate contact.
   148  	PhoneNumber pulumi.StringPtrInput
   149  	// Title for the alternate contact.
   150  	Title pulumi.StringPtrInput
   151  }
   152  
   153  func (AlternativeContactState) ElementType() reflect.Type {
   154  	return reflect.TypeOf((*alternativeContactState)(nil)).Elem()
   155  }
   156  
   157  type alternativeContactArgs struct {
   158  	// ID of the target account when managing member accounts. Will manage current user's account by default if omitted.
   159  	AccountId *string `pulumi:"accountId"`
   160  	// Type of the alternate contact. Allowed values are: `BILLING`, `OPERATIONS`, `SECURITY`.
   161  	AlternateContactType string `pulumi:"alternateContactType"`
   162  	// An email address for the alternate contact.
   163  	EmailAddress string `pulumi:"emailAddress"`
   164  	// Name of the alternate contact.
   165  	Name *string `pulumi:"name"`
   166  	// Phone number for the alternate contact.
   167  	PhoneNumber string `pulumi:"phoneNumber"`
   168  	// Title for the alternate contact.
   169  	Title string `pulumi:"title"`
   170  }
   171  
   172  // The set of arguments for constructing a AlternativeContact resource.
   173  type AlternativeContactArgs struct {
   174  	// ID of the target account when managing member accounts. Will manage current user's account by default if omitted.
   175  	AccountId pulumi.StringPtrInput
   176  	// Type of the alternate contact. Allowed values are: `BILLING`, `OPERATIONS`, `SECURITY`.
   177  	AlternateContactType pulumi.StringInput
   178  	// An email address for the alternate contact.
   179  	EmailAddress pulumi.StringInput
   180  	// Name of the alternate contact.
   181  	Name pulumi.StringPtrInput
   182  	// Phone number for the alternate contact.
   183  	PhoneNumber pulumi.StringInput
   184  	// Title for the alternate contact.
   185  	Title pulumi.StringInput
   186  }
   187  
   188  func (AlternativeContactArgs) ElementType() reflect.Type {
   189  	return reflect.TypeOf((*alternativeContactArgs)(nil)).Elem()
   190  }
   191  
   192  type AlternativeContactInput interface {
   193  	pulumi.Input
   194  
   195  	ToAlternativeContactOutput() AlternativeContactOutput
   196  	ToAlternativeContactOutputWithContext(ctx context.Context) AlternativeContactOutput
   197  }
   198  
   199  func (*AlternativeContact) ElementType() reflect.Type {
   200  	return reflect.TypeOf((**AlternativeContact)(nil)).Elem()
   201  }
   202  
   203  func (i *AlternativeContact) ToAlternativeContactOutput() AlternativeContactOutput {
   204  	return i.ToAlternativeContactOutputWithContext(context.Background())
   205  }
   206  
   207  func (i *AlternativeContact) ToAlternativeContactOutputWithContext(ctx context.Context) AlternativeContactOutput {
   208  	return pulumi.ToOutputWithContext(ctx, i).(AlternativeContactOutput)
   209  }
   210  
   211  // AlternativeContactArrayInput is an input type that accepts AlternativeContactArray and AlternativeContactArrayOutput values.
   212  // You can construct a concrete instance of `AlternativeContactArrayInput` via:
   213  //
   214  //	AlternativeContactArray{ AlternativeContactArgs{...} }
   215  type AlternativeContactArrayInput interface {
   216  	pulumi.Input
   217  
   218  	ToAlternativeContactArrayOutput() AlternativeContactArrayOutput
   219  	ToAlternativeContactArrayOutputWithContext(context.Context) AlternativeContactArrayOutput
   220  }
   221  
   222  type AlternativeContactArray []AlternativeContactInput
   223  
   224  func (AlternativeContactArray) ElementType() reflect.Type {
   225  	return reflect.TypeOf((*[]*AlternativeContact)(nil)).Elem()
   226  }
   227  
   228  func (i AlternativeContactArray) ToAlternativeContactArrayOutput() AlternativeContactArrayOutput {
   229  	return i.ToAlternativeContactArrayOutputWithContext(context.Background())
   230  }
   231  
   232  func (i AlternativeContactArray) ToAlternativeContactArrayOutputWithContext(ctx context.Context) AlternativeContactArrayOutput {
   233  	return pulumi.ToOutputWithContext(ctx, i).(AlternativeContactArrayOutput)
   234  }
   235  
   236  // AlternativeContactMapInput is an input type that accepts AlternativeContactMap and AlternativeContactMapOutput values.
   237  // You can construct a concrete instance of `AlternativeContactMapInput` via:
   238  //
   239  //	AlternativeContactMap{ "key": AlternativeContactArgs{...} }
   240  type AlternativeContactMapInput interface {
   241  	pulumi.Input
   242  
   243  	ToAlternativeContactMapOutput() AlternativeContactMapOutput
   244  	ToAlternativeContactMapOutputWithContext(context.Context) AlternativeContactMapOutput
   245  }
   246  
   247  type AlternativeContactMap map[string]AlternativeContactInput
   248  
   249  func (AlternativeContactMap) ElementType() reflect.Type {
   250  	return reflect.TypeOf((*map[string]*AlternativeContact)(nil)).Elem()
   251  }
   252  
   253  func (i AlternativeContactMap) ToAlternativeContactMapOutput() AlternativeContactMapOutput {
   254  	return i.ToAlternativeContactMapOutputWithContext(context.Background())
   255  }
   256  
   257  func (i AlternativeContactMap) ToAlternativeContactMapOutputWithContext(ctx context.Context) AlternativeContactMapOutput {
   258  	return pulumi.ToOutputWithContext(ctx, i).(AlternativeContactMapOutput)
   259  }
   260  
   261  type AlternativeContactOutput struct{ *pulumi.OutputState }
   262  
   263  func (AlternativeContactOutput) ElementType() reflect.Type {
   264  	return reflect.TypeOf((**AlternativeContact)(nil)).Elem()
   265  }
   266  
   267  func (o AlternativeContactOutput) ToAlternativeContactOutput() AlternativeContactOutput {
   268  	return o
   269  }
   270  
   271  func (o AlternativeContactOutput) ToAlternativeContactOutputWithContext(ctx context.Context) AlternativeContactOutput {
   272  	return o
   273  }
   274  
   275  // ID of the target account when managing member accounts. Will manage current user's account by default if omitted.
   276  func (o AlternativeContactOutput) AccountId() pulumi.StringPtrOutput {
   277  	return o.ApplyT(func(v *AlternativeContact) pulumi.StringPtrOutput { return v.AccountId }).(pulumi.StringPtrOutput)
   278  }
   279  
   280  // Type of the alternate contact. Allowed values are: `BILLING`, `OPERATIONS`, `SECURITY`.
   281  func (o AlternativeContactOutput) AlternateContactType() pulumi.StringOutput {
   282  	return o.ApplyT(func(v *AlternativeContact) pulumi.StringOutput { return v.AlternateContactType }).(pulumi.StringOutput)
   283  }
   284  
   285  // An email address for the alternate contact.
   286  func (o AlternativeContactOutput) EmailAddress() pulumi.StringOutput {
   287  	return o.ApplyT(func(v *AlternativeContact) pulumi.StringOutput { return v.EmailAddress }).(pulumi.StringOutput)
   288  }
   289  
   290  // Name of the alternate contact.
   291  func (o AlternativeContactOutput) Name() pulumi.StringOutput {
   292  	return o.ApplyT(func(v *AlternativeContact) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
   293  }
   294  
   295  // Phone number for the alternate contact.
   296  func (o AlternativeContactOutput) PhoneNumber() pulumi.StringOutput {
   297  	return o.ApplyT(func(v *AlternativeContact) pulumi.StringOutput { return v.PhoneNumber }).(pulumi.StringOutput)
   298  }
   299  
   300  // Title for the alternate contact.
   301  func (o AlternativeContactOutput) Title() pulumi.StringOutput {
   302  	return o.ApplyT(func(v *AlternativeContact) pulumi.StringOutput { return v.Title }).(pulumi.StringOutput)
   303  }
   304  
   305  type AlternativeContactArrayOutput struct{ *pulumi.OutputState }
   306  
   307  func (AlternativeContactArrayOutput) ElementType() reflect.Type {
   308  	return reflect.TypeOf((*[]*AlternativeContact)(nil)).Elem()
   309  }
   310  
   311  func (o AlternativeContactArrayOutput) ToAlternativeContactArrayOutput() AlternativeContactArrayOutput {
   312  	return o
   313  }
   314  
   315  func (o AlternativeContactArrayOutput) ToAlternativeContactArrayOutputWithContext(ctx context.Context) AlternativeContactArrayOutput {
   316  	return o
   317  }
   318  
   319  func (o AlternativeContactArrayOutput) Index(i pulumi.IntInput) AlternativeContactOutput {
   320  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *AlternativeContact {
   321  		return vs[0].([]*AlternativeContact)[vs[1].(int)]
   322  	}).(AlternativeContactOutput)
   323  }
   324  
   325  type AlternativeContactMapOutput struct{ *pulumi.OutputState }
   326  
   327  func (AlternativeContactMapOutput) ElementType() reflect.Type {
   328  	return reflect.TypeOf((*map[string]*AlternativeContact)(nil)).Elem()
   329  }
   330  
   331  func (o AlternativeContactMapOutput) ToAlternativeContactMapOutput() AlternativeContactMapOutput {
   332  	return o
   333  }
   334  
   335  func (o AlternativeContactMapOutput) ToAlternativeContactMapOutputWithContext(ctx context.Context) AlternativeContactMapOutput {
   336  	return o
   337  }
   338  
   339  func (o AlternativeContactMapOutput) MapIndex(k pulumi.StringInput) AlternativeContactOutput {
   340  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *AlternativeContact {
   341  		return vs[0].(map[string]*AlternativeContact)[vs[1].(string)]
   342  	}).(AlternativeContactOutput)
   343  }
   344  
   345  func init() {
   346  	pulumi.RegisterInputType(reflect.TypeOf((*AlternativeContactInput)(nil)).Elem(), &AlternativeContact{})
   347  	pulumi.RegisterInputType(reflect.TypeOf((*AlternativeContactArrayInput)(nil)).Elem(), AlternativeContactArray{})
   348  	pulumi.RegisterInputType(reflect.TypeOf((*AlternativeContactMapInput)(nil)).Elem(), AlternativeContactMap{})
   349  	pulumi.RegisterOutputType(AlternativeContactOutput{})
   350  	pulumi.RegisterOutputType(AlternativeContactArrayOutput{})
   351  	pulumi.RegisterOutputType(AlternativeContactMapOutput{})
   352  }