github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/dynamodb/contributorInsights.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 dynamodb
     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  // Provides a DynamoDB contributor insights resource
    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/dynamodb"
    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 := dynamodb.NewContributorInsights(ctx, "test", &dynamodb.ContributorInsightsArgs{
    33  //				TableName: pulumi.String("ExampleTableName"),
    34  //			})
    35  //			if err != nil {
    36  //				return err
    37  //			}
    38  //			return nil
    39  //		})
    40  //	}
    41  //
    42  // ```
    43  // <!--End PulumiCodeChooser -->
    44  //
    45  // ## Import
    46  //
    47  // Using `pulumi import`, import `aws_dynamodb_contributor_insights` using the format `name:table_name/index:index_name`, followed by the account number. For example:
    48  //
    49  // ```sh
    50  // $ pulumi import aws:dynamodb/contributorInsights:ContributorInsights test name:ExampleTableName/index:ExampleIndexName/123456789012
    51  // ```
    52  type ContributorInsights struct {
    53  	pulumi.CustomResourceState
    54  
    55  	// The global secondary index name
    56  	IndexName pulumi.StringPtrOutput `pulumi:"indexName"`
    57  	// The name of the table to enable contributor insights
    58  	TableName pulumi.StringOutput `pulumi:"tableName"`
    59  }
    60  
    61  // NewContributorInsights registers a new resource with the given unique name, arguments, and options.
    62  func NewContributorInsights(ctx *pulumi.Context,
    63  	name string, args *ContributorInsightsArgs, opts ...pulumi.ResourceOption) (*ContributorInsights, error) {
    64  	if args == nil {
    65  		return nil, errors.New("missing one or more required arguments")
    66  	}
    67  
    68  	if args.TableName == nil {
    69  		return nil, errors.New("invalid value for required argument 'TableName'")
    70  	}
    71  	opts = internal.PkgResourceDefaultOpts(opts)
    72  	var resource ContributorInsights
    73  	err := ctx.RegisterResource("aws:dynamodb/contributorInsights:ContributorInsights", name, args, &resource, opts...)
    74  	if err != nil {
    75  		return nil, err
    76  	}
    77  	return &resource, nil
    78  }
    79  
    80  // GetContributorInsights gets an existing ContributorInsights resource's state with the given name, ID, and optional
    81  // state properties that are used to uniquely qualify the lookup (nil if not required).
    82  func GetContributorInsights(ctx *pulumi.Context,
    83  	name string, id pulumi.IDInput, state *ContributorInsightsState, opts ...pulumi.ResourceOption) (*ContributorInsights, error) {
    84  	var resource ContributorInsights
    85  	err := ctx.ReadResource("aws:dynamodb/contributorInsights:ContributorInsights", name, id, state, &resource, opts...)
    86  	if err != nil {
    87  		return nil, err
    88  	}
    89  	return &resource, nil
    90  }
    91  
    92  // Input properties used for looking up and filtering ContributorInsights resources.
    93  type contributorInsightsState struct {
    94  	// The global secondary index name
    95  	IndexName *string `pulumi:"indexName"`
    96  	// The name of the table to enable contributor insights
    97  	TableName *string `pulumi:"tableName"`
    98  }
    99  
   100  type ContributorInsightsState struct {
   101  	// The global secondary index name
   102  	IndexName pulumi.StringPtrInput
   103  	// The name of the table to enable contributor insights
   104  	TableName pulumi.StringPtrInput
   105  }
   106  
   107  func (ContributorInsightsState) ElementType() reflect.Type {
   108  	return reflect.TypeOf((*contributorInsightsState)(nil)).Elem()
   109  }
   110  
   111  type contributorInsightsArgs struct {
   112  	// The global secondary index name
   113  	IndexName *string `pulumi:"indexName"`
   114  	// The name of the table to enable contributor insights
   115  	TableName string `pulumi:"tableName"`
   116  }
   117  
   118  // The set of arguments for constructing a ContributorInsights resource.
   119  type ContributorInsightsArgs struct {
   120  	// The global secondary index name
   121  	IndexName pulumi.StringPtrInput
   122  	// The name of the table to enable contributor insights
   123  	TableName pulumi.StringInput
   124  }
   125  
   126  func (ContributorInsightsArgs) ElementType() reflect.Type {
   127  	return reflect.TypeOf((*contributorInsightsArgs)(nil)).Elem()
   128  }
   129  
   130  type ContributorInsightsInput interface {
   131  	pulumi.Input
   132  
   133  	ToContributorInsightsOutput() ContributorInsightsOutput
   134  	ToContributorInsightsOutputWithContext(ctx context.Context) ContributorInsightsOutput
   135  }
   136  
   137  func (*ContributorInsights) ElementType() reflect.Type {
   138  	return reflect.TypeOf((**ContributorInsights)(nil)).Elem()
   139  }
   140  
   141  func (i *ContributorInsights) ToContributorInsightsOutput() ContributorInsightsOutput {
   142  	return i.ToContributorInsightsOutputWithContext(context.Background())
   143  }
   144  
   145  func (i *ContributorInsights) ToContributorInsightsOutputWithContext(ctx context.Context) ContributorInsightsOutput {
   146  	return pulumi.ToOutputWithContext(ctx, i).(ContributorInsightsOutput)
   147  }
   148  
   149  // ContributorInsightsArrayInput is an input type that accepts ContributorInsightsArray and ContributorInsightsArrayOutput values.
   150  // You can construct a concrete instance of `ContributorInsightsArrayInput` via:
   151  //
   152  //	ContributorInsightsArray{ ContributorInsightsArgs{...} }
   153  type ContributorInsightsArrayInput interface {
   154  	pulumi.Input
   155  
   156  	ToContributorInsightsArrayOutput() ContributorInsightsArrayOutput
   157  	ToContributorInsightsArrayOutputWithContext(context.Context) ContributorInsightsArrayOutput
   158  }
   159  
   160  type ContributorInsightsArray []ContributorInsightsInput
   161  
   162  func (ContributorInsightsArray) ElementType() reflect.Type {
   163  	return reflect.TypeOf((*[]*ContributorInsights)(nil)).Elem()
   164  }
   165  
   166  func (i ContributorInsightsArray) ToContributorInsightsArrayOutput() ContributorInsightsArrayOutput {
   167  	return i.ToContributorInsightsArrayOutputWithContext(context.Background())
   168  }
   169  
   170  func (i ContributorInsightsArray) ToContributorInsightsArrayOutputWithContext(ctx context.Context) ContributorInsightsArrayOutput {
   171  	return pulumi.ToOutputWithContext(ctx, i).(ContributorInsightsArrayOutput)
   172  }
   173  
   174  // ContributorInsightsMapInput is an input type that accepts ContributorInsightsMap and ContributorInsightsMapOutput values.
   175  // You can construct a concrete instance of `ContributorInsightsMapInput` via:
   176  //
   177  //	ContributorInsightsMap{ "key": ContributorInsightsArgs{...} }
   178  type ContributorInsightsMapInput interface {
   179  	pulumi.Input
   180  
   181  	ToContributorInsightsMapOutput() ContributorInsightsMapOutput
   182  	ToContributorInsightsMapOutputWithContext(context.Context) ContributorInsightsMapOutput
   183  }
   184  
   185  type ContributorInsightsMap map[string]ContributorInsightsInput
   186  
   187  func (ContributorInsightsMap) ElementType() reflect.Type {
   188  	return reflect.TypeOf((*map[string]*ContributorInsights)(nil)).Elem()
   189  }
   190  
   191  func (i ContributorInsightsMap) ToContributorInsightsMapOutput() ContributorInsightsMapOutput {
   192  	return i.ToContributorInsightsMapOutputWithContext(context.Background())
   193  }
   194  
   195  func (i ContributorInsightsMap) ToContributorInsightsMapOutputWithContext(ctx context.Context) ContributorInsightsMapOutput {
   196  	return pulumi.ToOutputWithContext(ctx, i).(ContributorInsightsMapOutput)
   197  }
   198  
   199  type ContributorInsightsOutput struct{ *pulumi.OutputState }
   200  
   201  func (ContributorInsightsOutput) ElementType() reflect.Type {
   202  	return reflect.TypeOf((**ContributorInsights)(nil)).Elem()
   203  }
   204  
   205  func (o ContributorInsightsOutput) ToContributorInsightsOutput() ContributorInsightsOutput {
   206  	return o
   207  }
   208  
   209  func (o ContributorInsightsOutput) ToContributorInsightsOutputWithContext(ctx context.Context) ContributorInsightsOutput {
   210  	return o
   211  }
   212  
   213  // The global secondary index name
   214  func (o ContributorInsightsOutput) IndexName() pulumi.StringPtrOutput {
   215  	return o.ApplyT(func(v *ContributorInsights) pulumi.StringPtrOutput { return v.IndexName }).(pulumi.StringPtrOutput)
   216  }
   217  
   218  // The name of the table to enable contributor insights
   219  func (o ContributorInsightsOutput) TableName() pulumi.StringOutput {
   220  	return o.ApplyT(func(v *ContributorInsights) pulumi.StringOutput { return v.TableName }).(pulumi.StringOutput)
   221  }
   222  
   223  type ContributorInsightsArrayOutput struct{ *pulumi.OutputState }
   224  
   225  func (ContributorInsightsArrayOutput) ElementType() reflect.Type {
   226  	return reflect.TypeOf((*[]*ContributorInsights)(nil)).Elem()
   227  }
   228  
   229  func (o ContributorInsightsArrayOutput) ToContributorInsightsArrayOutput() ContributorInsightsArrayOutput {
   230  	return o
   231  }
   232  
   233  func (o ContributorInsightsArrayOutput) ToContributorInsightsArrayOutputWithContext(ctx context.Context) ContributorInsightsArrayOutput {
   234  	return o
   235  }
   236  
   237  func (o ContributorInsightsArrayOutput) Index(i pulumi.IntInput) ContributorInsightsOutput {
   238  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ContributorInsights {
   239  		return vs[0].([]*ContributorInsights)[vs[1].(int)]
   240  	}).(ContributorInsightsOutput)
   241  }
   242  
   243  type ContributorInsightsMapOutput struct{ *pulumi.OutputState }
   244  
   245  func (ContributorInsightsMapOutput) ElementType() reflect.Type {
   246  	return reflect.TypeOf((*map[string]*ContributorInsights)(nil)).Elem()
   247  }
   248  
   249  func (o ContributorInsightsMapOutput) ToContributorInsightsMapOutput() ContributorInsightsMapOutput {
   250  	return o
   251  }
   252  
   253  func (o ContributorInsightsMapOutput) ToContributorInsightsMapOutputWithContext(ctx context.Context) ContributorInsightsMapOutput {
   254  	return o
   255  }
   256  
   257  func (o ContributorInsightsMapOutput) MapIndex(k pulumi.StringInput) ContributorInsightsOutput {
   258  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ContributorInsights {
   259  		return vs[0].(map[string]*ContributorInsights)[vs[1].(string)]
   260  	}).(ContributorInsightsOutput)
   261  }
   262  
   263  func init() {
   264  	pulumi.RegisterInputType(reflect.TypeOf((*ContributorInsightsInput)(nil)).Elem(), &ContributorInsights{})
   265  	pulumi.RegisterInputType(reflect.TypeOf((*ContributorInsightsArrayInput)(nil)).Elem(), ContributorInsightsArray{})
   266  	pulumi.RegisterInputType(reflect.TypeOf((*ContributorInsightsMapInput)(nil)).Elem(), ContributorInsightsMap{})
   267  	pulumi.RegisterOutputType(ContributorInsightsOutput{})
   268  	pulumi.RegisterOutputType(ContributorInsightsArrayOutput{})
   269  	pulumi.RegisterOutputType(ContributorInsightsMapOutput{})
   270  }