github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/cleanrooms/configuredTable.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 cleanrooms
     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 AWS Clean Rooms configured table. Configured tables are used to represent references to existing tables in the AWS Glue Data Catalog.
    16  //
    17  // ## Example Usage
    18  //
    19  // ### Configured table with tags
    20  //
    21  // <!--Start PulumiCodeChooser -->
    22  // ```go
    23  // package main
    24  //
    25  // import (
    26  //
    27  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/cleanrooms"
    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 := cleanrooms.NewConfiguredTable(ctx, "test_configured_table", &cleanrooms.ConfiguredTableArgs{
    35  //				Name:           pulumi.String("pulumi-example-table"),
    36  //				Description:    pulumi.String("I made this table with Pulumi!"),
    37  //				AnalysisMethod: pulumi.String("DIRECT_QUERY"),
    38  //				AllowedColumns: pulumi.StringArray{
    39  //					pulumi.String("column1"),
    40  //					pulumi.String("column2"),
    41  //					pulumi.String("column3"),
    42  //				},
    43  //				TableReference: &cleanrooms.ConfiguredTableTableReferenceArgs{
    44  //					DatabaseName: pulumi.String("example_database"),
    45  //					TableName:    pulumi.String("example_table"),
    46  //				},
    47  //				Tags: pulumi.StringMap{
    48  //					"Project": pulumi.String("Pulumi"),
    49  //				},
    50  //			})
    51  //			if err != nil {
    52  //				return err
    53  //			}
    54  //			return nil
    55  //		})
    56  //	}
    57  //
    58  // ```
    59  // <!--End PulumiCodeChooser -->
    60  //
    61  // ## Import
    62  //
    63  // Using `pulumi import`, import `aws_cleanrooms_configured_table` using the `id`. For example:
    64  //
    65  // ```sh
    66  // $ pulumi import aws:cleanrooms/configuredTable:ConfiguredTable table 1234abcd-12ab-34cd-56ef-1234567890ab
    67  // ```
    68  type ConfiguredTable struct {
    69  	pulumi.CustomResourceState
    70  
    71  	// The columns of the references table which will be included in the configured table.
    72  	AllowedColumns pulumi.StringArrayOutput `pulumi:"allowedColumns"`
    73  	// The analysis method for the configured table. The only valid value is currently `DIRECT_QUERY`.
    74  	AnalysisMethod pulumi.StringOutput `pulumi:"analysisMethod"`
    75  	// The ARN of the configured table.
    76  	Arn pulumi.StringOutput `pulumi:"arn"`
    77  	// The date and time the configured table was created.
    78  	CreateTime pulumi.StringOutput `pulumi:"createTime"`
    79  	// A description for the configured table.
    80  	Description pulumi.StringPtrOutput `pulumi:"description"`
    81  	// The name of the configured table.
    82  	Name pulumi.StringOutput `pulumi:"name"`
    83  	// A reference to the AWS Glue table which will be used to create the configured table.
    84  	// * `table_reference.database_name` - (Required - Forces new resource) - The name of the AWS Glue database which contains the table.
    85  	// * `table_reference.table_name` - (Required - Forces new resource) - The name of the AWS Glue table which will be used to create the configured table.
    86  	TableReference ConfiguredTableTableReferenceOutput `pulumi:"tableReference"`
    87  	// Key value pairs which tag the configured table.
    88  	Tags pulumi.StringMapOutput `pulumi:"tags"`
    89  	// Deprecated: Please use `tags` instead.
    90  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
    91  	// The date and time the configured table was last updated.
    92  	UpdateTime pulumi.StringOutput `pulumi:"updateTime"`
    93  }
    94  
    95  // NewConfiguredTable registers a new resource with the given unique name, arguments, and options.
    96  func NewConfiguredTable(ctx *pulumi.Context,
    97  	name string, args *ConfiguredTableArgs, opts ...pulumi.ResourceOption) (*ConfiguredTable, error) {
    98  	if args == nil {
    99  		return nil, errors.New("missing one or more required arguments")
   100  	}
   101  
   102  	if args.AllowedColumns == nil {
   103  		return nil, errors.New("invalid value for required argument 'AllowedColumns'")
   104  	}
   105  	if args.AnalysisMethod == nil {
   106  		return nil, errors.New("invalid value for required argument 'AnalysisMethod'")
   107  	}
   108  	if args.TableReference == nil {
   109  		return nil, errors.New("invalid value for required argument 'TableReference'")
   110  	}
   111  	opts = internal.PkgResourceDefaultOpts(opts)
   112  	var resource ConfiguredTable
   113  	err := ctx.RegisterResource("aws:cleanrooms/configuredTable:ConfiguredTable", name, args, &resource, opts...)
   114  	if err != nil {
   115  		return nil, err
   116  	}
   117  	return &resource, nil
   118  }
   119  
   120  // GetConfiguredTable gets an existing ConfiguredTable resource's state with the given name, ID, and optional
   121  // state properties that are used to uniquely qualify the lookup (nil if not required).
   122  func GetConfiguredTable(ctx *pulumi.Context,
   123  	name string, id pulumi.IDInput, state *ConfiguredTableState, opts ...pulumi.ResourceOption) (*ConfiguredTable, error) {
   124  	var resource ConfiguredTable
   125  	err := ctx.ReadResource("aws:cleanrooms/configuredTable:ConfiguredTable", name, id, state, &resource, opts...)
   126  	if err != nil {
   127  		return nil, err
   128  	}
   129  	return &resource, nil
   130  }
   131  
   132  // Input properties used for looking up and filtering ConfiguredTable resources.
   133  type configuredTableState struct {
   134  	// The columns of the references table which will be included in the configured table.
   135  	AllowedColumns []string `pulumi:"allowedColumns"`
   136  	// The analysis method for the configured table. The only valid value is currently `DIRECT_QUERY`.
   137  	AnalysisMethod *string `pulumi:"analysisMethod"`
   138  	// The ARN of the configured table.
   139  	Arn *string `pulumi:"arn"`
   140  	// The date and time the configured table was created.
   141  	CreateTime *string `pulumi:"createTime"`
   142  	// A description for the configured table.
   143  	Description *string `pulumi:"description"`
   144  	// The name of the configured table.
   145  	Name *string `pulumi:"name"`
   146  	// A reference to the AWS Glue table which will be used to create the configured table.
   147  	// * `table_reference.database_name` - (Required - Forces new resource) - The name of the AWS Glue database which contains the table.
   148  	// * `table_reference.table_name` - (Required - Forces new resource) - The name of the AWS Glue table which will be used to create the configured table.
   149  	TableReference *ConfiguredTableTableReference `pulumi:"tableReference"`
   150  	// Key value pairs which tag the configured table.
   151  	Tags map[string]string `pulumi:"tags"`
   152  	// Deprecated: Please use `tags` instead.
   153  	TagsAll map[string]string `pulumi:"tagsAll"`
   154  	// The date and time the configured table was last updated.
   155  	UpdateTime *string `pulumi:"updateTime"`
   156  }
   157  
   158  type ConfiguredTableState struct {
   159  	// The columns of the references table which will be included in the configured table.
   160  	AllowedColumns pulumi.StringArrayInput
   161  	// The analysis method for the configured table. The only valid value is currently `DIRECT_QUERY`.
   162  	AnalysisMethod pulumi.StringPtrInput
   163  	// The ARN of the configured table.
   164  	Arn pulumi.StringPtrInput
   165  	// The date and time the configured table was created.
   166  	CreateTime pulumi.StringPtrInput
   167  	// A description for the configured table.
   168  	Description pulumi.StringPtrInput
   169  	// The name of the configured table.
   170  	Name pulumi.StringPtrInput
   171  	// A reference to the AWS Glue table which will be used to create the configured table.
   172  	// * `table_reference.database_name` - (Required - Forces new resource) - The name of the AWS Glue database which contains the table.
   173  	// * `table_reference.table_name` - (Required - Forces new resource) - The name of the AWS Glue table which will be used to create the configured table.
   174  	TableReference ConfiguredTableTableReferencePtrInput
   175  	// Key value pairs which tag the configured table.
   176  	Tags pulumi.StringMapInput
   177  	// Deprecated: Please use `tags` instead.
   178  	TagsAll pulumi.StringMapInput
   179  	// The date and time the configured table was last updated.
   180  	UpdateTime pulumi.StringPtrInput
   181  }
   182  
   183  func (ConfiguredTableState) ElementType() reflect.Type {
   184  	return reflect.TypeOf((*configuredTableState)(nil)).Elem()
   185  }
   186  
   187  type configuredTableArgs struct {
   188  	// The columns of the references table which will be included in the configured table.
   189  	AllowedColumns []string `pulumi:"allowedColumns"`
   190  	// The analysis method for the configured table. The only valid value is currently `DIRECT_QUERY`.
   191  	AnalysisMethod string `pulumi:"analysisMethod"`
   192  	// A description for the configured table.
   193  	Description *string `pulumi:"description"`
   194  	// The name of the configured table.
   195  	Name *string `pulumi:"name"`
   196  	// A reference to the AWS Glue table which will be used to create the configured table.
   197  	// * `table_reference.database_name` - (Required - Forces new resource) - The name of the AWS Glue database which contains the table.
   198  	// * `table_reference.table_name` - (Required - Forces new resource) - The name of the AWS Glue table which will be used to create the configured table.
   199  	TableReference ConfiguredTableTableReference `pulumi:"tableReference"`
   200  	// Key value pairs which tag the configured table.
   201  	Tags map[string]string `pulumi:"tags"`
   202  }
   203  
   204  // The set of arguments for constructing a ConfiguredTable resource.
   205  type ConfiguredTableArgs struct {
   206  	// The columns of the references table which will be included in the configured table.
   207  	AllowedColumns pulumi.StringArrayInput
   208  	// The analysis method for the configured table. The only valid value is currently `DIRECT_QUERY`.
   209  	AnalysisMethod pulumi.StringInput
   210  	// A description for the configured table.
   211  	Description pulumi.StringPtrInput
   212  	// The name of the configured table.
   213  	Name pulumi.StringPtrInput
   214  	// A reference to the AWS Glue table which will be used to create the configured table.
   215  	// * `table_reference.database_name` - (Required - Forces new resource) - The name of the AWS Glue database which contains the table.
   216  	// * `table_reference.table_name` - (Required - Forces new resource) - The name of the AWS Glue table which will be used to create the configured table.
   217  	TableReference ConfiguredTableTableReferenceInput
   218  	// Key value pairs which tag the configured table.
   219  	Tags pulumi.StringMapInput
   220  }
   221  
   222  func (ConfiguredTableArgs) ElementType() reflect.Type {
   223  	return reflect.TypeOf((*configuredTableArgs)(nil)).Elem()
   224  }
   225  
   226  type ConfiguredTableInput interface {
   227  	pulumi.Input
   228  
   229  	ToConfiguredTableOutput() ConfiguredTableOutput
   230  	ToConfiguredTableOutputWithContext(ctx context.Context) ConfiguredTableOutput
   231  }
   232  
   233  func (*ConfiguredTable) ElementType() reflect.Type {
   234  	return reflect.TypeOf((**ConfiguredTable)(nil)).Elem()
   235  }
   236  
   237  func (i *ConfiguredTable) ToConfiguredTableOutput() ConfiguredTableOutput {
   238  	return i.ToConfiguredTableOutputWithContext(context.Background())
   239  }
   240  
   241  func (i *ConfiguredTable) ToConfiguredTableOutputWithContext(ctx context.Context) ConfiguredTableOutput {
   242  	return pulumi.ToOutputWithContext(ctx, i).(ConfiguredTableOutput)
   243  }
   244  
   245  // ConfiguredTableArrayInput is an input type that accepts ConfiguredTableArray and ConfiguredTableArrayOutput values.
   246  // You can construct a concrete instance of `ConfiguredTableArrayInput` via:
   247  //
   248  //	ConfiguredTableArray{ ConfiguredTableArgs{...} }
   249  type ConfiguredTableArrayInput interface {
   250  	pulumi.Input
   251  
   252  	ToConfiguredTableArrayOutput() ConfiguredTableArrayOutput
   253  	ToConfiguredTableArrayOutputWithContext(context.Context) ConfiguredTableArrayOutput
   254  }
   255  
   256  type ConfiguredTableArray []ConfiguredTableInput
   257  
   258  func (ConfiguredTableArray) ElementType() reflect.Type {
   259  	return reflect.TypeOf((*[]*ConfiguredTable)(nil)).Elem()
   260  }
   261  
   262  func (i ConfiguredTableArray) ToConfiguredTableArrayOutput() ConfiguredTableArrayOutput {
   263  	return i.ToConfiguredTableArrayOutputWithContext(context.Background())
   264  }
   265  
   266  func (i ConfiguredTableArray) ToConfiguredTableArrayOutputWithContext(ctx context.Context) ConfiguredTableArrayOutput {
   267  	return pulumi.ToOutputWithContext(ctx, i).(ConfiguredTableArrayOutput)
   268  }
   269  
   270  // ConfiguredTableMapInput is an input type that accepts ConfiguredTableMap and ConfiguredTableMapOutput values.
   271  // You can construct a concrete instance of `ConfiguredTableMapInput` via:
   272  //
   273  //	ConfiguredTableMap{ "key": ConfiguredTableArgs{...} }
   274  type ConfiguredTableMapInput interface {
   275  	pulumi.Input
   276  
   277  	ToConfiguredTableMapOutput() ConfiguredTableMapOutput
   278  	ToConfiguredTableMapOutputWithContext(context.Context) ConfiguredTableMapOutput
   279  }
   280  
   281  type ConfiguredTableMap map[string]ConfiguredTableInput
   282  
   283  func (ConfiguredTableMap) ElementType() reflect.Type {
   284  	return reflect.TypeOf((*map[string]*ConfiguredTable)(nil)).Elem()
   285  }
   286  
   287  func (i ConfiguredTableMap) ToConfiguredTableMapOutput() ConfiguredTableMapOutput {
   288  	return i.ToConfiguredTableMapOutputWithContext(context.Background())
   289  }
   290  
   291  func (i ConfiguredTableMap) ToConfiguredTableMapOutputWithContext(ctx context.Context) ConfiguredTableMapOutput {
   292  	return pulumi.ToOutputWithContext(ctx, i).(ConfiguredTableMapOutput)
   293  }
   294  
   295  type ConfiguredTableOutput struct{ *pulumi.OutputState }
   296  
   297  func (ConfiguredTableOutput) ElementType() reflect.Type {
   298  	return reflect.TypeOf((**ConfiguredTable)(nil)).Elem()
   299  }
   300  
   301  func (o ConfiguredTableOutput) ToConfiguredTableOutput() ConfiguredTableOutput {
   302  	return o
   303  }
   304  
   305  func (o ConfiguredTableOutput) ToConfiguredTableOutputWithContext(ctx context.Context) ConfiguredTableOutput {
   306  	return o
   307  }
   308  
   309  // The columns of the references table which will be included in the configured table.
   310  func (o ConfiguredTableOutput) AllowedColumns() pulumi.StringArrayOutput {
   311  	return o.ApplyT(func(v *ConfiguredTable) pulumi.StringArrayOutput { return v.AllowedColumns }).(pulumi.StringArrayOutput)
   312  }
   313  
   314  // The analysis method for the configured table. The only valid value is currently `DIRECT_QUERY`.
   315  func (o ConfiguredTableOutput) AnalysisMethod() pulumi.StringOutput {
   316  	return o.ApplyT(func(v *ConfiguredTable) pulumi.StringOutput { return v.AnalysisMethod }).(pulumi.StringOutput)
   317  }
   318  
   319  // The ARN of the configured table.
   320  func (o ConfiguredTableOutput) Arn() pulumi.StringOutput {
   321  	return o.ApplyT(func(v *ConfiguredTable) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   322  }
   323  
   324  // The date and time the configured table was created.
   325  func (o ConfiguredTableOutput) CreateTime() pulumi.StringOutput {
   326  	return o.ApplyT(func(v *ConfiguredTable) pulumi.StringOutput { return v.CreateTime }).(pulumi.StringOutput)
   327  }
   328  
   329  // A description for the configured table.
   330  func (o ConfiguredTableOutput) Description() pulumi.StringPtrOutput {
   331  	return o.ApplyT(func(v *ConfiguredTable) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
   332  }
   333  
   334  // The name of the configured table.
   335  func (o ConfiguredTableOutput) Name() pulumi.StringOutput {
   336  	return o.ApplyT(func(v *ConfiguredTable) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
   337  }
   338  
   339  // A reference to the AWS Glue table which will be used to create the configured table.
   340  // * `table_reference.database_name` - (Required - Forces new resource) - The name of the AWS Glue database which contains the table.
   341  // * `table_reference.table_name` - (Required - Forces new resource) - The name of the AWS Glue table which will be used to create the configured table.
   342  func (o ConfiguredTableOutput) TableReference() ConfiguredTableTableReferenceOutput {
   343  	return o.ApplyT(func(v *ConfiguredTable) ConfiguredTableTableReferenceOutput { return v.TableReference }).(ConfiguredTableTableReferenceOutput)
   344  }
   345  
   346  // Key value pairs which tag the configured table.
   347  func (o ConfiguredTableOutput) Tags() pulumi.StringMapOutput {
   348  	return o.ApplyT(func(v *ConfiguredTable) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   349  }
   350  
   351  // Deprecated: Please use `tags` instead.
   352  func (o ConfiguredTableOutput) TagsAll() pulumi.StringMapOutput {
   353  	return o.ApplyT(func(v *ConfiguredTable) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   354  }
   355  
   356  // The date and time the configured table was last updated.
   357  func (o ConfiguredTableOutput) UpdateTime() pulumi.StringOutput {
   358  	return o.ApplyT(func(v *ConfiguredTable) pulumi.StringOutput { return v.UpdateTime }).(pulumi.StringOutput)
   359  }
   360  
   361  type ConfiguredTableArrayOutput struct{ *pulumi.OutputState }
   362  
   363  func (ConfiguredTableArrayOutput) ElementType() reflect.Type {
   364  	return reflect.TypeOf((*[]*ConfiguredTable)(nil)).Elem()
   365  }
   366  
   367  func (o ConfiguredTableArrayOutput) ToConfiguredTableArrayOutput() ConfiguredTableArrayOutput {
   368  	return o
   369  }
   370  
   371  func (o ConfiguredTableArrayOutput) ToConfiguredTableArrayOutputWithContext(ctx context.Context) ConfiguredTableArrayOutput {
   372  	return o
   373  }
   374  
   375  func (o ConfiguredTableArrayOutput) Index(i pulumi.IntInput) ConfiguredTableOutput {
   376  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ConfiguredTable {
   377  		return vs[0].([]*ConfiguredTable)[vs[1].(int)]
   378  	}).(ConfiguredTableOutput)
   379  }
   380  
   381  type ConfiguredTableMapOutput struct{ *pulumi.OutputState }
   382  
   383  func (ConfiguredTableMapOutput) ElementType() reflect.Type {
   384  	return reflect.TypeOf((*map[string]*ConfiguredTable)(nil)).Elem()
   385  }
   386  
   387  func (o ConfiguredTableMapOutput) ToConfiguredTableMapOutput() ConfiguredTableMapOutput {
   388  	return o
   389  }
   390  
   391  func (o ConfiguredTableMapOutput) ToConfiguredTableMapOutputWithContext(ctx context.Context) ConfiguredTableMapOutput {
   392  	return o
   393  }
   394  
   395  func (o ConfiguredTableMapOutput) MapIndex(k pulumi.StringInput) ConfiguredTableOutput {
   396  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ConfiguredTable {
   397  		return vs[0].(map[string]*ConfiguredTable)[vs[1].(string)]
   398  	}).(ConfiguredTableOutput)
   399  }
   400  
   401  func init() {
   402  	pulumi.RegisterInputType(reflect.TypeOf((*ConfiguredTableInput)(nil)).Elem(), &ConfiguredTable{})
   403  	pulumi.RegisterInputType(reflect.TypeOf((*ConfiguredTableArrayInput)(nil)).Elem(), ConfiguredTableArray{})
   404  	pulumi.RegisterInputType(reflect.TypeOf((*ConfiguredTableMapInput)(nil)).Elem(), ConfiguredTableMap{})
   405  	pulumi.RegisterOutputType(ConfiguredTableOutput{})
   406  	pulumi.RegisterOutputType(ConfiguredTableArrayOutput{})
   407  	pulumi.RegisterOutputType(ConfiguredTableMapOutput{})
   408  }