github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/ssmcontacts/getContact.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  	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
    11  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    12  )
    13  
    14  // Data source for managing an AWS SSM Contact.
    15  //
    16  // ## Example Usage
    17  //
    18  // ### Basic Usage
    19  //
    20  // <!--Start PulumiCodeChooser -->
    21  // ```go
    22  // package main
    23  //
    24  // import (
    25  //
    26  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ssmcontacts"
    27  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    28  //
    29  // )
    30  //
    31  //	func main() {
    32  //		pulumi.Run(func(ctx *pulumi.Context) error {
    33  //			_, err := ssmcontacts.LookupContact(ctx, &ssmcontacts.LookupContactArgs{
    34  //				Arn: "arn:aws:ssm-contacts:us-west-2:123456789012:contact/contactalias",
    35  //			}, nil)
    36  //			if err != nil {
    37  //				return err
    38  //			}
    39  //			return nil
    40  //		})
    41  //	}
    42  //
    43  // ```
    44  // <!--End PulumiCodeChooser -->
    45  func LookupContact(ctx *pulumi.Context, args *LookupContactArgs, opts ...pulumi.InvokeOption) (*LookupContactResult, error) {
    46  	opts = internal.PkgInvokeDefaultOpts(opts)
    47  	var rv LookupContactResult
    48  	err := ctx.Invoke("aws:ssmcontacts/getContact:getContact", args, &rv, opts...)
    49  	if err != nil {
    50  		return nil, err
    51  	}
    52  	return &rv, nil
    53  }
    54  
    55  // A collection of arguments for invoking getContact.
    56  type LookupContactArgs struct {
    57  	// The Amazon Resource Name (ARN) of the contact or escalation plan.
    58  	Arn string `pulumi:"arn"`
    59  	// Map of tags to assign to the resource.
    60  	Tags map[string]string `pulumi:"tags"`
    61  }
    62  
    63  // A collection of values returned by getContact.
    64  type LookupContactResult struct {
    65  	// A unique and identifiable alias of the contact or escalation plan.
    66  	Alias string `pulumi:"alias"`
    67  	Arn   string `pulumi:"arn"`
    68  	// Full friendly name of the contact or escalation plan.
    69  	DisplayName string `pulumi:"displayName"`
    70  	// The provider-assigned unique ID for this managed resource.
    71  	Id string `pulumi:"id"`
    72  	// Map of tags to assign to the resource.
    73  	Tags map[string]string `pulumi:"tags"`
    74  	// The type of contact engaged. A single contact is type `PERSONAL` and an escalation plan is type `ESCALATION`.
    75  	Type string `pulumi:"type"`
    76  }
    77  
    78  func LookupContactOutput(ctx *pulumi.Context, args LookupContactOutputArgs, opts ...pulumi.InvokeOption) LookupContactResultOutput {
    79  	return pulumi.ToOutputWithContext(context.Background(), args).
    80  		ApplyT(func(v interface{}) (LookupContactResult, error) {
    81  			args := v.(LookupContactArgs)
    82  			r, err := LookupContact(ctx, &args, opts...)
    83  			var s LookupContactResult
    84  			if r != nil {
    85  				s = *r
    86  			}
    87  			return s, err
    88  		}).(LookupContactResultOutput)
    89  }
    90  
    91  // A collection of arguments for invoking getContact.
    92  type LookupContactOutputArgs struct {
    93  	// The Amazon Resource Name (ARN) of the contact or escalation plan.
    94  	Arn pulumi.StringInput `pulumi:"arn"`
    95  	// Map of tags to assign to the resource.
    96  	Tags pulumi.StringMapInput `pulumi:"tags"`
    97  }
    98  
    99  func (LookupContactOutputArgs) ElementType() reflect.Type {
   100  	return reflect.TypeOf((*LookupContactArgs)(nil)).Elem()
   101  }
   102  
   103  // A collection of values returned by getContact.
   104  type LookupContactResultOutput struct{ *pulumi.OutputState }
   105  
   106  func (LookupContactResultOutput) ElementType() reflect.Type {
   107  	return reflect.TypeOf((*LookupContactResult)(nil)).Elem()
   108  }
   109  
   110  func (o LookupContactResultOutput) ToLookupContactResultOutput() LookupContactResultOutput {
   111  	return o
   112  }
   113  
   114  func (o LookupContactResultOutput) ToLookupContactResultOutputWithContext(ctx context.Context) LookupContactResultOutput {
   115  	return o
   116  }
   117  
   118  // A unique and identifiable alias of the contact or escalation plan.
   119  func (o LookupContactResultOutput) Alias() pulumi.StringOutput {
   120  	return o.ApplyT(func(v LookupContactResult) string { return v.Alias }).(pulumi.StringOutput)
   121  }
   122  
   123  func (o LookupContactResultOutput) Arn() pulumi.StringOutput {
   124  	return o.ApplyT(func(v LookupContactResult) string { return v.Arn }).(pulumi.StringOutput)
   125  }
   126  
   127  // Full friendly name of the contact or escalation plan.
   128  func (o LookupContactResultOutput) DisplayName() pulumi.StringOutput {
   129  	return o.ApplyT(func(v LookupContactResult) string { return v.DisplayName }).(pulumi.StringOutput)
   130  }
   131  
   132  // The provider-assigned unique ID for this managed resource.
   133  func (o LookupContactResultOutput) Id() pulumi.StringOutput {
   134  	return o.ApplyT(func(v LookupContactResult) string { return v.Id }).(pulumi.StringOutput)
   135  }
   136  
   137  // Map of tags to assign to the resource.
   138  func (o LookupContactResultOutput) Tags() pulumi.StringMapOutput {
   139  	return o.ApplyT(func(v LookupContactResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput)
   140  }
   141  
   142  // The type of contact engaged. A single contact is type `PERSONAL` and an escalation plan is type `ESCALATION`.
   143  func (o LookupContactResultOutput) Type() pulumi.StringOutput {
   144  	return o.ApplyT(func(v LookupContactResult) string { return v.Type }).(pulumi.StringOutput)
   145  }
   146  
   147  func init() {
   148  	pulumi.RegisterOutputType(LookupContactResultOutput{})
   149  }