github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/account/primaryContact.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 primary contact information associated with 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.NewPrimaryContact(ctx, "test", &account.PrimaryContactArgs{
    33  //				AddressLine1:     pulumi.String("123 Any Street"),
    34  //				City:             pulumi.String("Seattle"),
    35  //				CompanyName:      pulumi.String("Example Corp, Inc."),
    36  //				CountryCode:      pulumi.String("US"),
    37  //				DistrictOrCounty: pulumi.String("King"),
    38  //				FullName:         pulumi.String("My Name"),
    39  //				PhoneNumber:      pulumi.String("+64211111111"),
    40  //				PostalCode:       pulumi.String("98101"),
    41  //				StateOrRegion:    pulumi.String("WA"),
    42  //				WebsiteUrl:       pulumi.String("https://www.examplecorp.com"),
    43  //			})
    44  //			if err != nil {
    45  //				return err
    46  //			}
    47  //			return nil
    48  //		})
    49  //	}
    50  //
    51  // ```
    52  // <!--End PulumiCodeChooser -->
    53  //
    54  // ## Import
    55  //
    56  // Using `pulumi import`, import the Primary Contact using the `account_id`. For example:
    57  //
    58  // ```sh
    59  // $ pulumi import aws:account/primaryContact:PrimaryContact test 1234567890
    60  // ```
    61  type PrimaryContact struct {
    62  	pulumi.CustomResourceState
    63  
    64  	// The ID of the target account when managing member accounts. Will manage current user's account by default if omitted.
    65  	AccountId pulumi.StringPtrOutput `pulumi:"accountId"`
    66  	// The first line of the primary contact address.
    67  	AddressLine1 pulumi.StringOutput `pulumi:"addressLine1"`
    68  	// The second line of the primary contact address, if any.
    69  	AddressLine2 pulumi.StringPtrOutput `pulumi:"addressLine2"`
    70  	// The third line of the primary contact address, if any.
    71  	AddressLine3 pulumi.StringPtrOutput `pulumi:"addressLine3"`
    72  	// The city of the primary contact address.
    73  	City pulumi.StringOutput `pulumi:"city"`
    74  	// The name of the company associated with the primary contact information, if any.
    75  	CompanyName pulumi.StringPtrOutput `pulumi:"companyName"`
    76  	// The ISO-3166 two-letter country code for the primary contact address.
    77  	CountryCode pulumi.StringOutput `pulumi:"countryCode"`
    78  	// The district or county of the primary contact address, if any.
    79  	DistrictOrCounty pulumi.StringPtrOutput `pulumi:"districtOrCounty"`
    80  	// The full name of the primary contact address.
    81  	FullName pulumi.StringOutput `pulumi:"fullName"`
    82  	// The phone number of the primary contact information. The number will be validated and, in some countries, checked for activation.
    83  	PhoneNumber pulumi.StringOutput `pulumi:"phoneNumber"`
    84  	// The postal code of the primary contact address.
    85  	PostalCode pulumi.StringOutput `pulumi:"postalCode"`
    86  	// The state or region of the primary contact address. This field is required in selected countries.
    87  	StateOrRegion pulumi.StringPtrOutput `pulumi:"stateOrRegion"`
    88  	// The URL of the website associated with the primary contact information, if any.
    89  	WebsiteUrl pulumi.StringPtrOutput `pulumi:"websiteUrl"`
    90  }
    91  
    92  // NewPrimaryContact registers a new resource with the given unique name, arguments, and options.
    93  func NewPrimaryContact(ctx *pulumi.Context,
    94  	name string, args *PrimaryContactArgs, opts ...pulumi.ResourceOption) (*PrimaryContact, error) {
    95  	if args == nil {
    96  		return nil, errors.New("missing one or more required arguments")
    97  	}
    98  
    99  	if args.AddressLine1 == nil {
   100  		return nil, errors.New("invalid value for required argument 'AddressLine1'")
   101  	}
   102  	if args.City == nil {
   103  		return nil, errors.New("invalid value for required argument 'City'")
   104  	}
   105  	if args.CountryCode == nil {
   106  		return nil, errors.New("invalid value for required argument 'CountryCode'")
   107  	}
   108  	if args.FullName == nil {
   109  		return nil, errors.New("invalid value for required argument 'FullName'")
   110  	}
   111  	if args.PhoneNumber == nil {
   112  		return nil, errors.New("invalid value for required argument 'PhoneNumber'")
   113  	}
   114  	if args.PostalCode == nil {
   115  		return nil, errors.New("invalid value for required argument 'PostalCode'")
   116  	}
   117  	opts = internal.PkgResourceDefaultOpts(opts)
   118  	var resource PrimaryContact
   119  	err := ctx.RegisterResource("aws:account/primaryContact:PrimaryContact", name, args, &resource, opts...)
   120  	if err != nil {
   121  		return nil, err
   122  	}
   123  	return &resource, nil
   124  }
   125  
   126  // GetPrimaryContact gets an existing PrimaryContact resource's state with the given name, ID, and optional
   127  // state properties that are used to uniquely qualify the lookup (nil if not required).
   128  func GetPrimaryContact(ctx *pulumi.Context,
   129  	name string, id pulumi.IDInput, state *PrimaryContactState, opts ...pulumi.ResourceOption) (*PrimaryContact, error) {
   130  	var resource PrimaryContact
   131  	err := ctx.ReadResource("aws:account/primaryContact:PrimaryContact", name, id, state, &resource, opts...)
   132  	if err != nil {
   133  		return nil, err
   134  	}
   135  	return &resource, nil
   136  }
   137  
   138  // Input properties used for looking up and filtering PrimaryContact resources.
   139  type primaryContactState struct {
   140  	// The ID of the target account when managing member accounts. Will manage current user's account by default if omitted.
   141  	AccountId *string `pulumi:"accountId"`
   142  	// The first line of the primary contact address.
   143  	AddressLine1 *string `pulumi:"addressLine1"`
   144  	// The second line of the primary contact address, if any.
   145  	AddressLine2 *string `pulumi:"addressLine2"`
   146  	// The third line of the primary contact address, if any.
   147  	AddressLine3 *string `pulumi:"addressLine3"`
   148  	// The city of the primary contact address.
   149  	City *string `pulumi:"city"`
   150  	// The name of the company associated with the primary contact information, if any.
   151  	CompanyName *string `pulumi:"companyName"`
   152  	// The ISO-3166 two-letter country code for the primary contact address.
   153  	CountryCode *string `pulumi:"countryCode"`
   154  	// The district or county of the primary contact address, if any.
   155  	DistrictOrCounty *string `pulumi:"districtOrCounty"`
   156  	// The full name of the primary contact address.
   157  	FullName *string `pulumi:"fullName"`
   158  	// The phone number of the primary contact information. The number will be validated and, in some countries, checked for activation.
   159  	PhoneNumber *string `pulumi:"phoneNumber"`
   160  	// The postal code of the primary contact address.
   161  	PostalCode *string `pulumi:"postalCode"`
   162  	// The state or region of the primary contact address. This field is required in selected countries.
   163  	StateOrRegion *string `pulumi:"stateOrRegion"`
   164  	// The URL of the website associated with the primary contact information, if any.
   165  	WebsiteUrl *string `pulumi:"websiteUrl"`
   166  }
   167  
   168  type PrimaryContactState struct {
   169  	// The ID of the target account when managing member accounts. Will manage current user's account by default if omitted.
   170  	AccountId pulumi.StringPtrInput
   171  	// The first line of the primary contact address.
   172  	AddressLine1 pulumi.StringPtrInput
   173  	// The second line of the primary contact address, if any.
   174  	AddressLine2 pulumi.StringPtrInput
   175  	// The third line of the primary contact address, if any.
   176  	AddressLine3 pulumi.StringPtrInput
   177  	// The city of the primary contact address.
   178  	City pulumi.StringPtrInput
   179  	// The name of the company associated with the primary contact information, if any.
   180  	CompanyName pulumi.StringPtrInput
   181  	// The ISO-3166 two-letter country code for the primary contact address.
   182  	CountryCode pulumi.StringPtrInput
   183  	// The district or county of the primary contact address, if any.
   184  	DistrictOrCounty pulumi.StringPtrInput
   185  	// The full name of the primary contact address.
   186  	FullName pulumi.StringPtrInput
   187  	// The phone number of the primary contact information. The number will be validated and, in some countries, checked for activation.
   188  	PhoneNumber pulumi.StringPtrInput
   189  	// The postal code of the primary contact address.
   190  	PostalCode pulumi.StringPtrInput
   191  	// The state or region of the primary contact address. This field is required in selected countries.
   192  	StateOrRegion pulumi.StringPtrInput
   193  	// The URL of the website associated with the primary contact information, if any.
   194  	WebsiteUrl pulumi.StringPtrInput
   195  }
   196  
   197  func (PrimaryContactState) ElementType() reflect.Type {
   198  	return reflect.TypeOf((*primaryContactState)(nil)).Elem()
   199  }
   200  
   201  type primaryContactArgs struct {
   202  	// The ID of the target account when managing member accounts. Will manage current user's account by default if omitted.
   203  	AccountId *string `pulumi:"accountId"`
   204  	// The first line of the primary contact address.
   205  	AddressLine1 string `pulumi:"addressLine1"`
   206  	// The second line of the primary contact address, if any.
   207  	AddressLine2 *string `pulumi:"addressLine2"`
   208  	// The third line of the primary contact address, if any.
   209  	AddressLine3 *string `pulumi:"addressLine3"`
   210  	// The city of the primary contact address.
   211  	City string `pulumi:"city"`
   212  	// The name of the company associated with the primary contact information, if any.
   213  	CompanyName *string `pulumi:"companyName"`
   214  	// The ISO-3166 two-letter country code for the primary contact address.
   215  	CountryCode string `pulumi:"countryCode"`
   216  	// The district or county of the primary contact address, if any.
   217  	DistrictOrCounty *string `pulumi:"districtOrCounty"`
   218  	// The full name of the primary contact address.
   219  	FullName string `pulumi:"fullName"`
   220  	// The phone number of the primary contact information. The number will be validated and, in some countries, checked for activation.
   221  	PhoneNumber string `pulumi:"phoneNumber"`
   222  	// The postal code of the primary contact address.
   223  	PostalCode string `pulumi:"postalCode"`
   224  	// The state or region of the primary contact address. This field is required in selected countries.
   225  	StateOrRegion *string `pulumi:"stateOrRegion"`
   226  	// The URL of the website associated with the primary contact information, if any.
   227  	WebsiteUrl *string `pulumi:"websiteUrl"`
   228  }
   229  
   230  // The set of arguments for constructing a PrimaryContact resource.
   231  type PrimaryContactArgs struct {
   232  	// The ID of the target account when managing member accounts. Will manage current user's account by default if omitted.
   233  	AccountId pulumi.StringPtrInput
   234  	// The first line of the primary contact address.
   235  	AddressLine1 pulumi.StringInput
   236  	// The second line of the primary contact address, if any.
   237  	AddressLine2 pulumi.StringPtrInput
   238  	// The third line of the primary contact address, if any.
   239  	AddressLine3 pulumi.StringPtrInput
   240  	// The city of the primary contact address.
   241  	City pulumi.StringInput
   242  	// The name of the company associated with the primary contact information, if any.
   243  	CompanyName pulumi.StringPtrInput
   244  	// The ISO-3166 two-letter country code for the primary contact address.
   245  	CountryCode pulumi.StringInput
   246  	// The district or county of the primary contact address, if any.
   247  	DistrictOrCounty pulumi.StringPtrInput
   248  	// The full name of the primary contact address.
   249  	FullName pulumi.StringInput
   250  	// The phone number of the primary contact information. The number will be validated and, in some countries, checked for activation.
   251  	PhoneNumber pulumi.StringInput
   252  	// The postal code of the primary contact address.
   253  	PostalCode pulumi.StringInput
   254  	// The state or region of the primary contact address. This field is required in selected countries.
   255  	StateOrRegion pulumi.StringPtrInput
   256  	// The URL of the website associated with the primary contact information, if any.
   257  	WebsiteUrl pulumi.StringPtrInput
   258  }
   259  
   260  func (PrimaryContactArgs) ElementType() reflect.Type {
   261  	return reflect.TypeOf((*primaryContactArgs)(nil)).Elem()
   262  }
   263  
   264  type PrimaryContactInput interface {
   265  	pulumi.Input
   266  
   267  	ToPrimaryContactOutput() PrimaryContactOutput
   268  	ToPrimaryContactOutputWithContext(ctx context.Context) PrimaryContactOutput
   269  }
   270  
   271  func (*PrimaryContact) ElementType() reflect.Type {
   272  	return reflect.TypeOf((**PrimaryContact)(nil)).Elem()
   273  }
   274  
   275  func (i *PrimaryContact) ToPrimaryContactOutput() PrimaryContactOutput {
   276  	return i.ToPrimaryContactOutputWithContext(context.Background())
   277  }
   278  
   279  func (i *PrimaryContact) ToPrimaryContactOutputWithContext(ctx context.Context) PrimaryContactOutput {
   280  	return pulumi.ToOutputWithContext(ctx, i).(PrimaryContactOutput)
   281  }
   282  
   283  // PrimaryContactArrayInput is an input type that accepts PrimaryContactArray and PrimaryContactArrayOutput values.
   284  // You can construct a concrete instance of `PrimaryContactArrayInput` via:
   285  //
   286  //	PrimaryContactArray{ PrimaryContactArgs{...} }
   287  type PrimaryContactArrayInput interface {
   288  	pulumi.Input
   289  
   290  	ToPrimaryContactArrayOutput() PrimaryContactArrayOutput
   291  	ToPrimaryContactArrayOutputWithContext(context.Context) PrimaryContactArrayOutput
   292  }
   293  
   294  type PrimaryContactArray []PrimaryContactInput
   295  
   296  func (PrimaryContactArray) ElementType() reflect.Type {
   297  	return reflect.TypeOf((*[]*PrimaryContact)(nil)).Elem()
   298  }
   299  
   300  func (i PrimaryContactArray) ToPrimaryContactArrayOutput() PrimaryContactArrayOutput {
   301  	return i.ToPrimaryContactArrayOutputWithContext(context.Background())
   302  }
   303  
   304  func (i PrimaryContactArray) ToPrimaryContactArrayOutputWithContext(ctx context.Context) PrimaryContactArrayOutput {
   305  	return pulumi.ToOutputWithContext(ctx, i).(PrimaryContactArrayOutput)
   306  }
   307  
   308  // PrimaryContactMapInput is an input type that accepts PrimaryContactMap and PrimaryContactMapOutput values.
   309  // You can construct a concrete instance of `PrimaryContactMapInput` via:
   310  //
   311  //	PrimaryContactMap{ "key": PrimaryContactArgs{...} }
   312  type PrimaryContactMapInput interface {
   313  	pulumi.Input
   314  
   315  	ToPrimaryContactMapOutput() PrimaryContactMapOutput
   316  	ToPrimaryContactMapOutputWithContext(context.Context) PrimaryContactMapOutput
   317  }
   318  
   319  type PrimaryContactMap map[string]PrimaryContactInput
   320  
   321  func (PrimaryContactMap) ElementType() reflect.Type {
   322  	return reflect.TypeOf((*map[string]*PrimaryContact)(nil)).Elem()
   323  }
   324  
   325  func (i PrimaryContactMap) ToPrimaryContactMapOutput() PrimaryContactMapOutput {
   326  	return i.ToPrimaryContactMapOutputWithContext(context.Background())
   327  }
   328  
   329  func (i PrimaryContactMap) ToPrimaryContactMapOutputWithContext(ctx context.Context) PrimaryContactMapOutput {
   330  	return pulumi.ToOutputWithContext(ctx, i).(PrimaryContactMapOutput)
   331  }
   332  
   333  type PrimaryContactOutput struct{ *pulumi.OutputState }
   334  
   335  func (PrimaryContactOutput) ElementType() reflect.Type {
   336  	return reflect.TypeOf((**PrimaryContact)(nil)).Elem()
   337  }
   338  
   339  func (o PrimaryContactOutput) ToPrimaryContactOutput() PrimaryContactOutput {
   340  	return o
   341  }
   342  
   343  func (o PrimaryContactOutput) ToPrimaryContactOutputWithContext(ctx context.Context) PrimaryContactOutput {
   344  	return o
   345  }
   346  
   347  // The ID of the target account when managing member accounts. Will manage current user's account by default if omitted.
   348  func (o PrimaryContactOutput) AccountId() pulumi.StringPtrOutput {
   349  	return o.ApplyT(func(v *PrimaryContact) pulumi.StringPtrOutput { return v.AccountId }).(pulumi.StringPtrOutput)
   350  }
   351  
   352  // The first line of the primary contact address.
   353  func (o PrimaryContactOutput) AddressLine1() pulumi.StringOutput {
   354  	return o.ApplyT(func(v *PrimaryContact) pulumi.StringOutput { return v.AddressLine1 }).(pulumi.StringOutput)
   355  }
   356  
   357  // The second line of the primary contact address, if any.
   358  func (o PrimaryContactOutput) AddressLine2() pulumi.StringPtrOutput {
   359  	return o.ApplyT(func(v *PrimaryContact) pulumi.StringPtrOutput { return v.AddressLine2 }).(pulumi.StringPtrOutput)
   360  }
   361  
   362  // The third line of the primary contact address, if any.
   363  func (o PrimaryContactOutput) AddressLine3() pulumi.StringPtrOutput {
   364  	return o.ApplyT(func(v *PrimaryContact) pulumi.StringPtrOutput { return v.AddressLine3 }).(pulumi.StringPtrOutput)
   365  }
   366  
   367  // The city of the primary contact address.
   368  func (o PrimaryContactOutput) City() pulumi.StringOutput {
   369  	return o.ApplyT(func(v *PrimaryContact) pulumi.StringOutput { return v.City }).(pulumi.StringOutput)
   370  }
   371  
   372  // The name of the company associated with the primary contact information, if any.
   373  func (o PrimaryContactOutput) CompanyName() pulumi.StringPtrOutput {
   374  	return o.ApplyT(func(v *PrimaryContact) pulumi.StringPtrOutput { return v.CompanyName }).(pulumi.StringPtrOutput)
   375  }
   376  
   377  // The ISO-3166 two-letter country code for the primary contact address.
   378  func (o PrimaryContactOutput) CountryCode() pulumi.StringOutput {
   379  	return o.ApplyT(func(v *PrimaryContact) pulumi.StringOutput { return v.CountryCode }).(pulumi.StringOutput)
   380  }
   381  
   382  // The district or county of the primary contact address, if any.
   383  func (o PrimaryContactOutput) DistrictOrCounty() pulumi.StringPtrOutput {
   384  	return o.ApplyT(func(v *PrimaryContact) pulumi.StringPtrOutput { return v.DistrictOrCounty }).(pulumi.StringPtrOutput)
   385  }
   386  
   387  // The full name of the primary contact address.
   388  func (o PrimaryContactOutput) FullName() pulumi.StringOutput {
   389  	return o.ApplyT(func(v *PrimaryContact) pulumi.StringOutput { return v.FullName }).(pulumi.StringOutput)
   390  }
   391  
   392  // The phone number of the primary contact information. The number will be validated and, in some countries, checked for activation.
   393  func (o PrimaryContactOutput) PhoneNumber() pulumi.StringOutput {
   394  	return o.ApplyT(func(v *PrimaryContact) pulumi.StringOutput { return v.PhoneNumber }).(pulumi.StringOutput)
   395  }
   396  
   397  // The postal code of the primary contact address.
   398  func (o PrimaryContactOutput) PostalCode() pulumi.StringOutput {
   399  	return o.ApplyT(func(v *PrimaryContact) pulumi.StringOutput { return v.PostalCode }).(pulumi.StringOutput)
   400  }
   401  
   402  // The state or region of the primary contact address. This field is required in selected countries.
   403  func (o PrimaryContactOutput) StateOrRegion() pulumi.StringPtrOutput {
   404  	return o.ApplyT(func(v *PrimaryContact) pulumi.StringPtrOutput { return v.StateOrRegion }).(pulumi.StringPtrOutput)
   405  }
   406  
   407  // The URL of the website associated with the primary contact information, if any.
   408  func (o PrimaryContactOutput) WebsiteUrl() pulumi.StringPtrOutput {
   409  	return o.ApplyT(func(v *PrimaryContact) pulumi.StringPtrOutput { return v.WebsiteUrl }).(pulumi.StringPtrOutput)
   410  }
   411  
   412  type PrimaryContactArrayOutput struct{ *pulumi.OutputState }
   413  
   414  func (PrimaryContactArrayOutput) ElementType() reflect.Type {
   415  	return reflect.TypeOf((*[]*PrimaryContact)(nil)).Elem()
   416  }
   417  
   418  func (o PrimaryContactArrayOutput) ToPrimaryContactArrayOutput() PrimaryContactArrayOutput {
   419  	return o
   420  }
   421  
   422  func (o PrimaryContactArrayOutput) ToPrimaryContactArrayOutputWithContext(ctx context.Context) PrimaryContactArrayOutput {
   423  	return o
   424  }
   425  
   426  func (o PrimaryContactArrayOutput) Index(i pulumi.IntInput) PrimaryContactOutput {
   427  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *PrimaryContact {
   428  		return vs[0].([]*PrimaryContact)[vs[1].(int)]
   429  	}).(PrimaryContactOutput)
   430  }
   431  
   432  type PrimaryContactMapOutput struct{ *pulumi.OutputState }
   433  
   434  func (PrimaryContactMapOutput) ElementType() reflect.Type {
   435  	return reflect.TypeOf((*map[string]*PrimaryContact)(nil)).Elem()
   436  }
   437  
   438  func (o PrimaryContactMapOutput) ToPrimaryContactMapOutput() PrimaryContactMapOutput {
   439  	return o
   440  }
   441  
   442  func (o PrimaryContactMapOutput) ToPrimaryContactMapOutputWithContext(ctx context.Context) PrimaryContactMapOutput {
   443  	return o
   444  }
   445  
   446  func (o PrimaryContactMapOutput) MapIndex(k pulumi.StringInput) PrimaryContactOutput {
   447  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *PrimaryContact {
   448  		return vs[0].(map[string]*PrimaryContact)[vs[1].(string)]
   449  	}).(PrimaryContactOutput)
   450  }
   451  
   452  func init() {
   453  	pulumi.RegisterInputType(reflect.TypeOf((*PrimaryContactInput)(nil)).Elem(), &PrimaryContact{})
   454  	pulumi.RegisterInputType(reflect.TypeOf((*PrimaryContactArrayInput)(nil)).Elem(), PrimaryContactArray{})
   455  	pulumi.RegisterInputType(reflect.TypeOf((*PrimaryContactMapInput)(nil)).Elem(), PrimaryContactMap{})
   456  	pulumi.RegisterOutputType(PrimaryContactOutput{})
   457  	pulumi.RegisterOutputType(PrimaryContactArrayOutput{})
   458  	pulumi.RegisterOutputType(PrimaryContactMapOutput{})
   459  }