github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/ssmcontacts/contact.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 ssmcontacts
     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 SSM Contact.
    16  //
    17  // ## Example Usage
    18  //
    19  // ### Basic Usage
    20  //
    21  // <!--Start PulumiCodeChooser -->
    22  // ```go
    23  // package main
    24  //
    25  // import (
    26  //
    27  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ssmcontacts"
    28  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    29  //
    30  // )
    31  //
    32  //	func main() {
    33  //		pulumi.Run(func(ctx *pulumi.Context) error {
    34  //			_, err := ssmcontacts.NewContact(ctx, "example", &ssmcontacts.ContactArgs{
    35  //				Alias: pulumi.String("alias"),
    36  //				Type:  pulumi.String("PERSONAL"),
    37  //			}, pulumi.DependsOn([]pulumi.Resource{
    38  //				exampleAwsSsmincidentsReplicationSet,
    39  //			}))
    40  //			if err != nil {
    41  //				return err
    42  //			}
    43  //			return nil
    44  //		})
    45  //	}
    46  //
    47  // ```
    48  // <!--End PulumiCodeChooser -->
    49  //
    50  // ### Usage With All Fields
    51  //
    52  // <!--Start PulumiCodeChooser -->
    53  // ```go
    54  // package main
    55  //
    56  // import (
    57  //
    58  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ssmcontacts"
    59  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    60  //
    61  // )
    62  //
    63  //	func main() {
    64  //		pulumi.Run(func(ctx *pulumi.Context) error {
    65  //			_, err := ssmcontacts.NewContact(ctx, "example", &ssmcontacts.ContactArgs{
    66  //				Alias:       pulumi.String("alias"),
    67  //				DisplayName: pulumi.String("displayName"),
    68  //				Type:        pulumi.String("ESCALATION"),
    69  //				Tags: pulumi.StringMap{
    70  //					"key": pulumi.String("value"),
    71  //				},
    72  //			}, pulumi.DependsOn([]pulumi.Resource{
    73  //				exampleAwsSsmincidentsReplicationSet,
    74  //			}))
    75  //			if err != nil {
    76  //				return err
    77  //			}
    78  //			return nil
    79  //		})
    80  //	}
    81  //
    82  // ```
    83  // <!--End PulumiCodeChooser -->
    84  //
    85  // ## Import
    86  //
    87  // Using `pulumi import`, import SSM Contact using the `ARN`. For example:
    88  //
    89  // ```sh
    90  // $ pulumi import aws:ssmcontacts/contact:Contact example {ARNValue}
    91  // ```
    92  type Contact struct {
    93  	pulumi.CustomResourceState
    94  
    95  	// A unique and identifiable alias for the contact or escalation plan. Must be between 1 and 255 characters, and may contain alphanumerics, underscores (`_`), and hyphens (`-`).
    96  	Alias pulumi.StringOutput `pulumi:"alias"`
    97  	// The Amazon Resource Name (ARN) of the contact or escalation plan.
    98  	Arn pulumi.StringOutput `pulumi:"arn"`
    99  	// Full friendly name of the contact or escalation plan. If set, must be between 1 and 255 characters, and may contain alphanumerics, underscores (`_`), hyphens (`-`), periods (`.`), and spaces.
   100  	DisplayName pulumi.StringPtrOutput `pulumi:"displayName"`
   101  	// Map of tags to assign to the resource.
   102  	Tags pulumi.StringMapOutput `pulumi:"tags"`
   103  	// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   104  	//
   105  	// Deprecated: Please use `tags` instead.
   106  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
   107  	// The type of contact engaged. A single contact is type PERSONAL and an escalation
   108  	// plan is type ESCALATION.
   109  	//
   110  	// The following arguments are optional:
   111  	Type pulumi.StringOutput `pulumi:"type"`
   112  }
   113  
   114  // NewContact registers a new resource with the given unique name, arguments, and options.
   115  func NewContact(ctx *pulumi.Context,
   116  	name string, args *ContactArgs, opts ...pulumi.ResourceOption) (*Contact, error) {
   117  	if args == nil {
   118  		return nil, errors.New("missing one or more required arguments")
   119  	}
   120  
   121  	if args.Alias == nil {
   122  		return nil, errors.New("invalid value for required argument 'Alias'")
   123  	}
   124  	if args.Type == nil {
   125  		return nil, errors.New("invalid value for required argument 'Type'")
   126  	}
   127  	opts = internal.PkgResourceDefaultOpts(opts)
   128  	var resource Contact
   129  	err := ctx.RegisterResource("aws:ssmcontacts/contact:Contact", name, args, &resource, opts...)
   130  	if err != nil {
   131  		return nil, err
   132  	}
   133  	return &resource, nil
   134  }
   135  
   136  // GetContact gets an existing Contact resource's state with the given name, ID, and optional
   137  // state properties that are used to uniquely qualify the lookup (nil if not required).
   138  func GetContact(ctx *pulumi.Context,
   139  	name string, id pulumi.IDInput, state *ContactState, opts ...pulumi.ResourceOption) (*Contact, error) {
   140  	var resource Contact
   141  	err := ctx.ReadResource("aws:ssmcontacts/contact:Contact", name, id, state, &resource, opts...)
   142  	if err != nil {
   143  		return nil, err
   144  	}
   145  	return &resource, nil
   146  }
   147  
   148  // Input properties used for looking up and filtering Contact resources.
   149  type contactState struct {
   150  	// A unique and identifiable alias for the contact or escalation plan. Must be between 1 and 255 characters, and may contain alphanumerics, underscores (`_`), and hyphens (`-`).
   151  	Alias *string `pulumi:"alias"`
   152  	// The Amazon Resource Name (ARN) of the contact or escalation plan.
   153  	Arn *string `pulumi:"arn"`
   154  	// Full friendly name of the contact or escalation plan. If set, must be between 1 and 255 characters, and may contain alphanumerics, underscores (`_`), hyphens (`-`), periods (`.`), and spaces.
   155  	DisplayName *string `pulumi:"displayName"`
   156  	// Map of tags to assign to the resource.
   157  	Tags map[string]string `pulumi:"tags"`
   158  	// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   159  	//
   160  	// Deprecated: Please use `tags` instead.
   161  	TagsAll map[string]string `pulumi:"tagsAll"`
   162  	// The type of contact engaged. A single contact is type PERSONAL and an escalation
   163  	// plan is type ESCALATION.
   164  	//
   165  	// The following arguments are optional:
   166  	Type *string `pulumi:"type"`
   167  }
   168  
   169  type ContactState struct {
   170  	// A unique and identifiable alias for the contact or escalation plan. Must be between 1 and 255 characters, and may contain alphanumerics, underscores (`_`), and hyphens (`-`).
   171  	Alias pulumi.StringPtrInput
   172  	// The Amazon Resource Name (ARN) of the contact or escalation plan.
   173  	Arn pulumi.StringPtrInput
   174  	// Full friendly name of the contact or escalation plan. If set, must be between 1 and 255 characters, and may contain alphanumerics, underscores (`_`), hyphens (`-`), periods (`.`), and spaces.
   175  	DisplayName pulumi.StringPtrInput
   176  	// Map of tags to assign to the resource.
   177  	Tags pulumi.StringMapInput
   178  	// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   179  	//
   180  	// Deprecated: Please use `tags` instead.
   181  	TagsAll pulumi.StringMapInput
   182  	// The type of contact engaged. A single contact is type PERSONAL and an escalation
   183  	// plan is type ESCALATION.
   184  	//
   185  	// The following arguments are optional:
   186  	Type pulumi.StringPtrInput
   187  }
   188  
   189  func (ContactState) ElementType() reflect.Type {
   190  	return reflect.TypeOf((*contactState)(nil)).Elem()
   191  }
   192  
   193  type contactArgs struct {
   194  	// A unique and identifiable alias for the contact or escalation plan. Must be between 1 and 255 characters, and may contain alphanumerics, underscores (`_`), and hyphens (`-`).
   195  	Alias string `pulumi:"alias"`
   196  	// Full friendly name of the contact or escalation plan. If set, must be between 1 and 255 characters, and may contain alphanumerics, underscores (`_`), hyphens (`-`), periods (`.`), and spaces.
   197  	DisplayName *string `pulumi:"displayName"`
   198  	// Map of tags to assign to the resource.
   199  	Tags map[string]string `pulumi:"tags"`
   200  	// The type of contact engaged. A single contact is type PERSONAL and an escalation
   201  	// plan is type ESCALATION.
   202  	//
   203  	// The following arguments are optional:
   204  	Type string `pulumi:"type"`
   205  }
   206  
   207  // The set of arguments for constructing a Contact resource.
   208  type ContactArgs struct {
   209  	// A unique and identifiable alias for the contact or escalation plan. Must be between 1 and 255 characters, and may contain alphanumerics, underscores (`_`), and hyphens (`-`).
   210  	Alias pulumi.StringInput
   211  	// Full friendly name of the contact or escalation plan. If set, must be between 1 and 255 characters, and may contain alphanumerics, underscores (`_`), hyphens (`-`), periods (`.`), and spaces.
   212  	DisplayName pulumi.StringPtrInput
   213  	// Map of tags to assign to the resource.
   214  	Tags pulumi.StringMapInput
   215  	// The type of contact engaged. A single contact is type PERSONAL and an escalation
   216  	// plan is type ESCALATION.
   217  	//
   218  	// The following arguments are optional:
   219  	Type pulumi.StringInput
   220  }
   221  
   222  func (ContactArgs) ElementType() reflect.Type {
   223  	return reflect.TypeOf((*contactArgs)(nil)).Elem()
   224  }
   225  
   226  type ContactInput interface {
   227  	pulumi.Input
   228  
   229  	ToContactOutput() ContactOutput
   230  	ToContactOutputWithContext(ctx context.Context) ContactOutput
   231  }
   232  
   233  func (*Contact) ElementType() reflect.Type {
   234  	return reflect.TypeOf((**Contact)(nil)).Elem()
   235  }
   236  
   237  func (i *Contact) ToContactOutput() ContactOutput {
   238  	return i.ToContactOutputWithContext(context.Background())
   239  }
   240  
   241  func (i *Contact) ToContactOutputWithContext(ctx context.Context) ContactOutput {
   242  	return pulumi.ToOutputWithContext(ctx, i).(ContactOutput)
   243  }
   244  
   245  // ContactArrayInput is an input type that accepts ContactArray and ContactArrayOutput values.
   246  // You can construct a concrete instance of `ContactArrayInput` via:
   247  //
   248  //	ContactArray{ ContactArgs{...} }
   249  type ContactArrayInput interface {
   250  	pulumi.Input
   251  
   252  	ToContactArrayOutput() ContactArrayOutput
   253  	ToContactArrayOutputWithContext(context.Context) ContactArrayOutput
   254  }
   255  
   256  type ContactArray []ContactInput
   257  
   258  func (ContactArray) ElementType() reflect.Type {
   259  	return reflect.TypeOf((*[]*Contact)(nil)).Elem()
   260  }
   261  
   262  func (i ContactArray) ToContactArrayOutput() ContactArrayOutput {
   263  	return i.ToContactArrayOutputWithContext(context.Background())
   264  }
   265  
   266  func (i ContactArray) ToContactArrayOutputWithContext(ctx context.Context) ContactArrayOutput {
   267  	return pulumi.ToOutputWithContext(ctx, i).(ContactArrayOutput)
   268  }
   269  
   270  // ContactMapInput is an input type that accepts ContactMap and ContactMapOutput values.
   271  // You can construct a concrete instance of `ContactMapInput` via:
   272  //
   273  //	ContactMap{ "key": ContactArgs{...} }
   274  type ContactMapInput interface {
   275  	pulumi.Input
   276  
   277  	ToContactMapOutput() ContactMapOutput
   278  	ToContactMapOutputWithContext(context.Context) ContactMapOutput
   279  }
   280  
   281  type ContactMap map[string]ContactInput
   282  
   283  func (ContactMap) ElementType() reflect.Type {
   284  	return reflect.TypeOf((*map[string]*Contact)(nil)).Elem()
   285  }
   286  
   287  func (i ContactMap) ToContactMapOutput() ContactMapOutput {
   288  	return i.ToContactMapOutputWithContext(context.Background())
   289  }
   290  
   291  func (i ContactMap) ToContactMapOutputWithContext(ctx context.Context) ContactMapOutput {
   292  	return pulumi.ToOutputWithContext(ctx, i).(ContactMapOutput)
   293  }
   294  
   295  type ContactOutput struct{ *pulumi.OutputState }
   296  
   297  func (ContactOutput) ElementType() reflect.Type {
   298  	return reflect.TypeOf((**Contact)(nil)).Elem()
   299  }
   300  
   301  func (o ContactOutput) ToContactOutput() ContactOutput {
   302  	return o
   303  }
   304  
   305  func (o ContactOutput) ToContactOutputWithContext(ctx context.Context) ContactOutput {
   306  	return o
   307  }
   308  
   309  // A unique and identifiable alias for the contact or escalation plan. Must be between 1 and 255 characters, and may contain alphanumerics, underscores (`_`), and hyphens (`-`).
   310  func (o ContactOutput) Alias() pulumi.StringOutput {
   311  	return o.ApplyT(func(v *Contact) pulumi.StringOutput { return v.Alias }).(pulumi.StringOutput)
   312  }
   313  
   314  // The Amazon Resource Name (ARN) of the contact or escalation plan.
   315  func (o ContactOutput) Arn() pulumi.StringOutput {
   316  	return o.ApplyT(func(v *Contact) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   317  }
   318  
   319  // Full friendly name of the contact or escalation plan. If set, must be between 1 and 255 characters, and may contain alphanumerics, underscores (`_`), hyphens (`-`), periods (`.`), and spaces.
   320  func (o ContactOutput) DisplayName() pulumi.StringPtrOutput {
   321  	return o.ApplyT(func(v *Contact) pulumi.StringPtrOutput { return v.DisplayName }).(pulumi.StringPtrOutput)
   322  }
   323  
   324  // Map of tags to assign to the resource.
   325  func (o ContactOutput) Tags() pulumi.StringMapOutput {
   326  	return o.ApplyT(func(v *Contact) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   327  }
   328  
   329  // Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   330  //
   331  // Deprecated: Please use `tags` instead.
   332  func (o ContactOutput) TagsAll() pulumi.StringMapOutput {
   333  	return o.ApplyT(func(v *Contact) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   334  }
   335  
   336  // The type of contact engaged. A single contact is type PERSONAL and an escalation
   337  // plan is type ESCALATION.
   338  //
   339  // The following arguments are optional:
   340  func (o ContactOutput) Type() pulumi.StringOutput {
   341  	return o.ApplyT(func(v *Contact) pulumi.StringOutput { return v.Type }).(pulumi.StringOutput)
   342  }
   343  
   344  type ContactArrayOutput struct{ *pulumi.OutputState }
   345  
   346  func (ContactArrayOutput) ElementType() reflect.Type {
   347  	return reflect.TypeOf((*[]*Contact)(nil)).Elem()
   348  }
   349  
   350  func (o ContactArrayOutput) ToContactArrayOutput() ContactArrayOutput {
   351  	return o
   352  }
   353  
   354  func (o ContactArrayOutput) ToContactArrayOutputWithContext(ctx context.Context) ContactArrayOutput {
   355  	return o
   356  }
   357  
   358  func (o ContactArrayOutput) Index(i pulumi.IntInput) ContactOutput {
   359  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Contact {
   360  		return vs[0].([]*Contact)[vs[1].(int)]
   361  	}).(ContactOutput)
   362  }
   363  
   364  type ContactMapOutput struct{ *pulumi.OutputState }
   365  
   366  func (ContactMapOutput) ElementType() reflect.Type {
   367  	return reflect.TypeOf((*map[string]*Contact)(nil)).Elem()
   368  }
   369  
   370  func (o ContactMapOutput) ToContactMapOutput() ContactMapOutput {
   371  	return o
   372  }
   373  
   374  func (o ContactMapOutput) ToContactMapOutputWithContext(ctx context.Context) ContactMapOutput {
   375  	return o
   376  }
   377  
   378  func (o ContactMapOutput) MapIndex(k pulumi.StringInput) ContactOutput {
   379  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Contact {
   380  		return vs[0].(map[string]*Contact)[vs[1].(string)]
   381  	}).(ContactOutput)
   382  }
   383  
   384  func init() {
   385  	pulumi.RegisterInputType(reflect.TypeOf((*ContactInput)(nil)).Elem(), &Contact{})
   386  	pulumi.RegisterInputType(reflect.TypeOf((*ContactArrayInput)(nil)).Elem(), ContactArray{})
   387  	pulumi.RegisterInputType(reflect.TypeOf((*ContactMapInput)(nil)).Elem(), ContactMap{})
   388  	pulumi.RegisterOutputType(ContactOutput{})
   389  	pulumi.RegisterOutputType(ContactArrayOutput{})
   390  	pulumi.RegisterOutputType(ContactMapOutput{})
   391  }