github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/oam/sink.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 oam
     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  // Resource for managing an AWS CloudWatch Observability Access Manager Sink.
    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/oam"
    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 := oam.NewSink(ctx, "example", &oam.SinkArgs{
    34  //				Name: pulumi.String("ExampleSink"),
    35  //				Tags: pulumi.StringMap{
    36  //					"Env": pulumi.String("prod"),
    37  //				},
    38  //			})
    39  //			if err != nil {
    40  //				return err
    41  //			}
    42  //			return nil
    43  //		})
    44  //	}
    45  //
    46  // ```
    47  // <!--End PulumiCodeChooser -->
    48  //
    49  // ## Import
    50  //
    51  // Using `pulumi import`, import CloudWatch Observability Access Manager Sink using the `arn`. For example:
    52  //
    53  // ```sh
    54  // $ pulumi import aws:oam/sink:Sink example arn:aws:oam:us-west-2:123456789012:sink/sink-id
    55  // ```
    56  type Sink struct {
    57  	pulumi.CustomResourceState
    58  
    59  	// ARN of the Sink.
    60  	Arn pulumi.StringOutput `pulumi:"arn"`
    61  	// Name for the sink.
    62  	//
    63  	// The following arguments are optional:
    64  	Name pulumi.StringOutput `pulumi:"name"`
    65  	// ID string that AWS generated as part of the sink ARN.
    66  	SinkId pulumi.StringOutput `pulumi:"sinkId"`
    67  	// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    68  	Tags pulumi.StringMapOutput `pulumi:"tags"`
    69  	// Deprecated: Please use `tags` instead.
    70  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
    71  }
    72  
    73  // NewSink registers a new resource with the given unique name, arguments, and options.
    74  func NewSink(ctx *pulumi.Context,
    75  	name string, args *SinkArgs, opts ...pulumi.ResourceOption) (*Sink, error) {
    76  	if args == nil {
    77  		args = &SinkArgs{}
    78  	}
    79  
    80  	opts = internal.PkgResourceDefaultOpts(opts)
    81  	var resource Sink
    82  	err := ctx.RegisterResource("aws:oam/sink:Sink", name, args, &resource, opts...)
    83  	if err != nil {
    84  		return nil, err
    85  	}
    86  	return &resource, nil
    87  }
    88  
    89  // GetSink gets an existing Sink resource's state with the given name, ID, and optional
    90  // state properties that are used to uniquely qualify the lookup (nil if not required).
    91  func GetSink(ctx *pulumi.Context,
    92  	name string, id pulumi.IDInput, state *SinkState, opts ...pulumi.ResourceOption) (*Sink, error) {
    93  	var resource Sink
    94  	err := ctx.ReadResource("aws:oam/sink:Sink", name, id, state, &resource, opts...)
    95  	if err != nil {
    96  		return nil, err
    97  	}
    98  	return &resource, nil
    99  }
   100  
   101  // Input properties used for looking up and filtering Sink resources.
   102  type sinkState struct {
   103  	// ARN of the Sink.
   104  	Arn *string `pulumi:"arn"`
   105  	// Name for the sink.
   106  	//
   107  	// The following arguments are optional:
   108  	Name *string `pulumi:"name"`
   109  	// ID string that AWS generated as part of the sink ARN.
   110  	SinkId *string `pulumi:"sinkId"`
   111  	// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   112  	Tags map[string]string `pulumi:"tags"`
   113  	// Deprecated: Please use `tags` instead.
   114  	TagsAll map[string]string `pulumi:"tagsAll"`
   115  }
   116  
   117  type SinkState struct {
   118  	// ARN of the Sink.
   119  	Arn pulumi.StringPtrInput
   120  	// Name for the sink.
   121  	//
   122  	// The following arguments are optional:
   123  	Name pulumi.StringPtrInput
   124  	// ID string that AWS generated as part of the sink ARN.
   125  	SinkId pulumi.StringPtrInput
   126  	// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   127  	Tags pulumi.StringMapInput
   128  	// Deprecated: Please use `tags` instead.
   129  	TagsAll pulumi.StringMapInput
   130  }
   131  
   132  func (SinkState) ElementType() reflect.Type {
   133  	return reflect.TypeOf((*sinkState)(nil)).Elem()
   134  }
   135  
   136  type sinkArgs struct {
   137  	// Name for the sink.
   138  	//
   139  	// The following arguments are optional:
   140  	Name *string `pulumi:"name"`
   141  	// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   142  	Tags map[string]string `pulumi:"tags"`
   143  }
   144  
   145  // The set of arguments for constructing a Sink resource.
   146  type SinkArgs struct {
   147  	// Name for the sink.
   148  	//
   149  	// The following arguments are optional:
   150  	Name pulumi.StringPtrInput
   151  	// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   152  	Tags pulumi.StringMapInput
   153  }
   154  
   155  func (SinkArgs) ElementType() reflect.Type {
   156  	return reflect.TypeOf((*sinkArgs)(nil)).Elem()
   157  }
   158  
   159  type SinkInput interface {
   160  	pulumi.Input
   161  
   162  	ToSinkOutput() SinkOutput
   163  	ToSinkOutputWithContext(ctx context.Context) SinkOutput
   164  }
   165  
   166  func (*Sink) ElementType() reflect.Type {
   167  	return reflect.TypeOf((**Sink)(nil)).Elem()
   168  }
   169  
   170  func (i *Sink) ToSinkOutput() SinkOutput {
   171  	return i.ToSinkOutputWithContext(context.Background())
   172  }
   173  
   174  func (i *Sink) ToSinkOutputWithContext(ctx context.Context) SinkOutput {
   175  	return pulumi.ToOutputWithContext(ctx, i).(SinkOutput)
   176  }
   177  
   178  // SinkArrayInput is an input type that accepts SinkArray and SinkArrayOutput values.
   179  // You can construct a concrete instance of `SinkArrayInput` via:
   180  //
   181  //	SinkArray{ SinkArgs{...} }
   182  type SinkArrayInput interface {
   183  	pulumi.Input
   184  
   185  	ToSinkArrayOutput() SinkArrayOutput
   186  	ToSinkArrayOutputWithContext(context.Context) SinkArrayOutput
   187  }
   188  
   189  type SinkArray []SinkInput
   190  
   191  func (SinkArray) ElementType() reflect.Type {
   192  	return reflect.TypeOf((*[]*Sink)(nil)).Elem()
   193  }
   194  
   195  func (i SinkArray) ToSinkArrayOutput() SinkArrayOutput {
   196  	return i.ToSinkArrayOutputWithContext(context.Background())
   197  }
   198  
   199  func (i SinkArray) ToSinkArrayOutputWithContext(ctx context.Context) SinkArrayOutput {
   200  	return pulumi.ToOutputWithContext(ctx, i).(SinkArrayOutput)
   201  }
   202  
   203  // SinkMapInput is an input type that accepts SinkMap and SinkMapOutput values.
   204  // You can construct a concrete instance of `SinkMapInput` via:
   205  //
   206  //	SinkMap{ "key": SinkArgs{...} }
   207  type SinkMapInput interface {
   208  	pulumi.Input
   209  
   210  	ToSinkMapOutput() SinkMapOutput
   211  	ToSinkMapOutputWithContext(context.Context) SinkMapOutput
   212  }
   213  
   214  type SinkMap map[string]SinkInput
   215  
   216  func (SinkMap) ElementType() reflect.Type {
   217  	return reflect.TypeOf((*map[string]*Sink)(nil)).Elem()
   218  }
   219  
   220  func (i SinkMap) ToSinkMapOutput() SinkMapOutput {
   221  	return i.ToSinkMapOutputWithContext(context.Background())
   222  }
   223  
   224  func (i SinkMap) ToSinkMapOutputWithContext(ctx context.Context) SinkMapOutput {
   225  	return pulumi.ToOutputWithContext(ctx, i).(SinkMapOutput)
   226  }
   227  
   228  type SinkOutput struct{ *pulumi.OutputState }
   229  
   230  func (SinkOutput) ElementType() reflect.Type {
   231  	return reflect.TypeOf((**Sink)(nil)).Elem()
   232  }
   233  
   234  func (o SinkOutput) ToSinkOutput() SinkOutput {
   235  	return o
   236  }
   237  
   238  func (o SinkOutput) ToSinkOutputWithContext(ctx context.Context) SinkOutput {
   239  	return o
   240  }
   241  
   242  // ARN of the Sink.
   243  func (o SinkOutput) Arn() pulumi.StringOutput {
   244  	return o.ApplyT(func(v *Sink) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   245  }
   246  
   247  // Name for the sink.
   248  //
   249  // The following arguments are optional:
   250  func (o SinkOutput) Name() pulumi.StringOutput {
   251  	return o.ApplyT(func(v *Sink) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
   252  }
   253  
   254  // ID string that AWS generated as part of the sink ARN.
   255  func (o SinkOutput) SinkId() pulumi.StringOutput {
   256  	return o.ApplyT(func(v *Sink) pulumi.StringOutput { return v.SinkId }).(pulumi.StringOutput)
   257  }
   258  
   259  // A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   260  func (o SinkOutput) Tags() pulumi.StringMapOutput {
   261  	return o.ApplyT(func(v *Sink) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   262  }
   263  
   264  // Deprecated: Please use `tags` instead.
   265  func (o SinkOutput) TagsAll() pulumi.StringMapOutput {
   266  	return o.ApplyT(func(v *Sink) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   267  }
   268  
   269  type SinkArrayOutput struct{ *pulumi.OutputState }
   270  
   271  func (SinkArrayOutput) ElementType() reflect.Type {
   272  	return reflect.TypeOf((*[]*Sink)(nil)).Elem()
   273  }
   274  
   275  func (o SinkArrayOutput) ToSinkArrayOutput() SinkArrayOutput {
   276  	return o
   277  }
   278  
   279  func (o SinkArrayOutput) ToSinkArrayOutputWithContext(ctx context.Context) SinkArrayOutput {
   280  	return o
   281  }
   282  
   283  func (o SinkArrayOutput) Index(i pulumi.IntInput) SinkOutput {
   284  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Sink {
   285  		return vs[0].([]*Sink)[vs[1].(int)]
   286  	}).(SinkOutput)
   287  }
   288  
   289  type SinkMapOutput struct{ *pulumi.OutputState }
   290  
   291  func (SinkMapOutput) ElementType() reflect.Type {
   292  	return reflect.TypeOf((*map[string]*Sink)(nil)).Elem()
   293  }
   294  
   295  func (o SinkMapOutput) ToSinkMapOutput() SinkMapOutput {
   296  	return o
   297  }
   298  
   299  func (o SinkMapOutput) ToSinkMapOutputWithContext(ctx context.Context) SinkMapOutput {
   300  	return o
   301  }
   302  
   303  func (o SinkMapOutput) MapIndex(k pulumi.StringInput) SinkOutput {
   304  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Sink {
   305  		return vs[0].(map[string]*Sink)[vs[1].(string)]
   306  	}).(SinkOutput)
   307  }
   308  
   309  func init() {
   310  	pulumi.RegisterInputType(reflect.TypeOf((*SinkInput)(nil)).Elem(), &Sink{})
   311  	pulumi.RegisterInputType(reflect.TypeOf((*SinkArrayInput)(nil)).Elem(), SinkArray{})
   312  	pulumi.RegisterInputType(reflect.TypeOf((*SinkMapInput)(nil)).Elem(), SinkMap{})
   313  	pulumi.RegisterOutputType(SinkOutput{})
   314  	pulumi.RegisterOutputType(SinkArrayOutput{})
   315  	pulumi.RegisterOutputType(SinkMapOutput{})
   316  }