github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/finspace/kxDatabase.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 finspace
     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 FinSpace Kx Database.
    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/finspace"
    28  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/kms"
    29  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    30  //
    31  // )
    32  //
    33  //	func main() {
    34  //		pulumi.Run(func(ctx *pulumi.Context) error {
    35  //			example, err := kms.NewKey(ctx, "example", &kms.KeyArgs{
    36  //				Description:          pulumi.String("Example KMS Key"),
    37  //				DeletionWindowInDays: pulumi.Int(7),
    38  //			})
    39  //			if err != nil {
    40  //				return err
    41  //			}
    42  //			exampleKxEnvironment, err := finspace.NewKxEnvironment(ctx, "example", &finspace.KxEnvironmentArgs{
    43  //				Name:     pulumi.String("my-tf-kx-environment"),
    44  //				KmsKeyId: example.Arn,
    45  //			})
    46  //			if err != nil {
    47  //				return err
    48  //			}
    49  //			_, err = finspace.NewKxDatabase(ctx, "example", &finspace.KxDatabaseArgs{
    50  //				EnvironmentId: exampleKxEnvironment.ID(),
    51  //				Name:          pulumi.String("my-tf-kx-database"),
    52  //				Description:   pulumi.String("Example database description"),
    53  //			})
    54  //			if err != nil {
    55  //				return err
    56  //			}
    57  //			return nil
    58  //		})
    59  //	}
    60  //
    61  // ```
    62  // <!--End PulumiCodeChooser -->
    63  //
    64  // ## Import
    65  //
    66  // Using `pulumi import`, import an AWS FinSpace Kx Database using the `id` (environment ID and database name, comma-delimited). For example:
    67  //
    68  // ```sh
    69  // $ pulumi import aws:finspace/kxDatabase:KxDatabase example n3ceo7wqxoxcti5tujqwzs,my-tf-kx-database
    70  // ```
    71  type KxDatabase struct {
    72  	pulumi.CustomResourceState
    73  
    74  	// Amazon Resource Name (ARN) identifier of the KX database.
    75  	Arn pulumi.StringOutput `pulumi:"arn"`
    76  	// Timestamp at which the databse is created in FinSpace. Value determined as epoch time in seconds. For example, the value for Monday, November 1, 2021 12:00:00 PM UTC is specified as 1635768000.
    77  	CreatedTimestamp pulumi.StringOutput `pulumi:"createdTimestamp"`
    78  	// Description of the KX database.
    79  	Description pulumi.StringPtrOutput `pulumi:"description"`
    80  	// Unique identifier for the KX environment.
    81  	EnvironmentId pulumi.StringOutput `pulumi:"environmentId"`
    82  	// Last timestamp at which the database was updated in FinSpace. Value determined as epoch time in seconds. For example, the value for Monday, November 1, 2021 12:00:00 PM UTC is specified as 1635768000.
    83  	LastModifiedTimestamp pulumi.StringOutput `pulumi:"lastModifiedTimestamp"`
    84  	// Name of the KX database.
    85  	//
    86  	// The following arguments are optional:
    87  	Name pulumi.StringOutput `pulumi:"name"`
    88  	// Key-value mapping of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    89  	Tags pulumi.StringMapOutput `pulumi:"tags"`
    90  	// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
    91  	//
    92  	// Deprecated: Please use `tags` instead.
    93  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
    94  }
    95  
    96  // NewKxDatabase registers a new resource with the given unique name, arguments, and options.
    97  func NewKxDatabase(ctx *pulumi.Context,
    98  	name string, args *KxDatabaseArgs, opts ...pulumi.ResourceOption) (*KxDatabase, error) {
    99  	if args == nil {
   100  		return nil, errors.New("missing one or more required arguments")
   101  	}
   102  
   103  	if args.EnvironmentId == nil {
   104  		return nil, errors.New("invalid value for required argument 'EnvironmentId'")
   105  	}
   106  	opts = internal.PkgResourceDefaultOpts(opts)
   107  	var resource KxDatabase
   108  	err := ctx.RegisterResource("aws:finspace/kxDatabase:KxDatabase", name, args, &resource, opts...)
   109  	if err != nil {
   110  		return nil, err
   111  	}
   112  	return &resource, nil
   113  }
   114  
   115  // GetKxDatabase gets an existing KxDatabase resource's state with the given name, ID, and optional
   116  // state properties that are used to uniquely qualify the lookup (nil if not required).
   117  func GetKxDatabase(ctx *pulumi.Context,
   118  	name string, id pulumi.IDInput, state *KxDatabaseState, opts ...pulumi.ResourceOption) (*KxDatabase, error) {
   119  	var resource KxDatabase
   120  	err := ctx.ReadResource("aws:finspace/kxDatabase:KxDatabase", name, id, state, &resource, opts...)
   121  	if err != nil {
   122  		return nil, err
   123  	}
   124  	return &resource, nil
   125  }
   126  
   127  // Input properties used for looking up and filtering KxDatabase resources.
   128  type kxDatabaseState struct {
   129  	// Amazon Resource Name (ARN) identifier of the KX database.
   130  	Arn *string `pulumi:"arn"`
   131  	// Timestamp at which the databse is created in FinSpace. Value determined as epoch time in seconds. For example, the value for Monday, November 1, 2021 12:00:00 PM UTC is specified as 1635768000.
   132  	CreatedTimestamp *string `pulumi:"createdTimestamp"`
   133  	// Description of the KX database.
   134  	Description *string `pulumi:"description"`
   135  	// Unique identifier for the KX environment.
   136  	EnvironmentId *string `pulumi:"environmentId"`
   137  	// Last timestamp at which the database was updated in FinSpace. Value determined as epoch time in seconds. For example, the value for Monday, November 1, 2021 12:00:00 PM UTC is specified as 1635768000.
   138  	LastModifiedTimestamp *string `pulumi:"lastModifiedTimestamp"`
   139  	// Name of the KX database.
   140  	//
   141  	// The following arguments are optional:
   142  	Name *string `pulumi:"name"`
   143  	// Key-value mapping of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   144  	Tags map[string]string `pulumi:"tags"`
   145  	// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   146  	//
   147  	// Deprecated: Please use `tags` instead.
   148  	TagsAll map[string]string `pulumi:"tagsAll"`
   149  }
   150  
   151  type KxDatabaseState struct {
   152  	// Amazon Resource Name (ARN) identifier of the KX database.
   153  	Arn pulumi.StringPtrInput
   154  	// Timestamp at which the databse is created in FinSpace. Value determined as epoch time in seconds. For example, the value for Monday, November 1, 2021 12:00:00 PM UTC is specified as 1635768000.
   155  	CreatedTimestamp pulumi.StringPtrInput
   156  	// Description of the KX database.
   157  	Description pulumi.StringPtrInput
   158  	// Unique identifier for the KX environment.
   159  	EnvironmentId pulumi.StringPtrInput
   160  	// Last timestamp at which the database was updated in FinSpace. Value determined as epoch time in seconds. For example, the value for Monday, November 1, 2021 12:00:00 PM UTC is specified as 1635768000.
   161  	LastModifiedTimestamp pulumi.StringPtrInput
   162  	// Name of the KX database.
   163  	//
   164  	// The following arguments are optional:
   165  	Name pulumi.StringPtrInput
   166  	// Key-value mapping of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   167  	Tags pulumi.StringMapInput
   168  	// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   169  	//
   170  	// Deprecated: Please use `tags` instead.
   171  	TagsAll pulumi.StringMapInput
   172  }
   173  
   174  func (KxDatabaseState) ElementType() reflect.Type {
   175  	return reflect.TypeOf((*kxDatabaseState)(nil)).Elem()
   176  }
   177  
   178  type kxDatabaseArgs struct {
   179  	// Description of the KX database.
   180  	Description *string `pulumi:"description"`
   181  	// Unique identifier for the KX environment.
   182  	EnvironmentId string `pulumi:"environmentId"`
   183  	// Name of the KX database.
   184  	//
   185  	// The following arguments are optional:
   186  	Name *string `pulumi:"name"`
   187  	// Key-value mapping of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   188  	Tags map[string]string `pulumi:"tags"`
   189  }
   190  
   191  // The set of arguments for constructing a KxDatabase resource.
   192  type KxDatabaseArgs struct {
   193  	// Description of the KX database.
   194  	Description pulumi.StringPtrInput
   195  	// Unique identifier for the KX environment.
   196  	EnvironmentId pulumi.StringInput
   197  	// Name of the KX database.
   198  	//
   199  	// The following arguments are optional:
   200  	Name pulumi.StringPtrInput
   201  	// Key-value mapping of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   202  	Tags pulumi.StringMapInput
   203  }
   204  
   205  func (KxDatabaseArgs) ElementType() reflect.Type {
   206  	return reflect.TypeOf((*kxDatabaseArgs)(nil)).Elem()
   207  }
   208  
   209  type KxDatabaseInput interface {
   210  	pulumi.Input
   211  
   212  	ToKxDatabaseOutput() KxDatabaseOutput
   213  	ToKxDatabaseOutputWithContext(ctx context.Context) KxDatabaseOutput
   214  }
   215  
   216  func (*KxDatabase) ElementType() reflect.Type {
   217  	return reflect.TypeOf((**KxDatabase)(nil)).Elem()
   218  }
   219  
   220  func (i *KxDatabase) ToKxDatabaseOutput() KxDatabaseOutput {
   221  	return i.ToKxDatabaseOutputWithContext(context.Background())
   222  }
   223  
   224  func (i *KxDatabase) ToKxDatabaseOutputWithContext(ctx context.Context) KxDatabaseOutput {
   225  	return pulumi.ToOutputWithContext(ctx, i).(KxDatabaseOutput)
   226  }
   227  
   228  // KxDatabaseArrayInput is an input type that accepts KxDatabaseArray and KxDatabaseArrayOutput values.
   229  // You can construct a concrete instance of `KxDatabaseArrayInput` via:
   230  //
   231  //	KxDatabaseArray{ KxDatabaseArgs{...} }
   232  type KxDatabaseArrayInput interface {
   233  	pulumi.Input
   234  
   235  	ToKxDatabaseArrayOutput() KxDatabaseArrayOutput
   236  	ToKxDatabaseArrayOutputWithContext(context.Context) KxDatabaseArrayOutput
   237  }
   238  
   239  type KxDatabaseArray []KxDatabaseInput
   240  
   241  func (KxDatabaseArray) ElementType() reflect.Type {
   242  	return reflect.TypeOf((*[]*KxDatabase)(nil)).Elem()
   243  }
   244  
   245  func (i KxDatabaseArray) ToKxDatabaseArrayOutput() KxDatabaseArrayOutput {
   246  	return i.ToKxDatabaseArrayOutputWithContext(context.Background())
   247  }
   248  
   249  func (i KxDatabaseArray) ToKxDatabaseArrayOutputWithContext(ctx context.Context) KxDatabaseArrayOutput {
   250  	return pulumi.ToOutputWithContext(ctx, i).(KxDatabaseArrayOutput)
   251  }
   252  
   253  // KxDatabaseMapInput is an input type that accepts KxDatabaseMap and KxDatabaseMapOutput values.
   254  // You can construct a concrete instance of `KxDatabaseMapInput` via:
   255  //
   256  //	KxDatabaseMap{ "key": KxDatabaseArgs{...} }
   257  type KxDatabaseMapInput interface {
   258  	pulumi.Input
   259  
   260  	ToKxDatabaseMapOutput() KxDatabaseMapOutput
   261  	ToKxDatabaseMapOutputWithContext(context.Context) KxDatabaseMapOutput
   262  }
   263  
   264  type KxDatabaseMap map[string]KxDatabaseInput
   265  
   266  func (KxDatabaseMap) ElementType() reflect.Type {
   267  	return reflect.TypeOf((*map[string]*KxDatabase)(nil)).Elem()
   268  }
   269  
   270  func (i KxDatabaseMap) ToKxDatabaseMapOutput() KxDatabaseMapOutput {
   271  	return i.ToKxDatabaseMapOutputWithContext(context.Background())
   272  }
   273  
   274  func (i KxDatabaseMap) ToKxDatabaseMapOutputWithContext(ctx context.Context) KxDatabaseMapOutput {
   275  	return pulumi.ToOutputWithContext(ctx, i).(KxDatabaseMapOutput)
   276  }
   277  
   278  type KxDatabaseOutput struct{ *pulumi.OutputState }
   279  
   280  func (KxDatabaseOutput) ElementType() reflect.Type {
   281  	return reflect.TypeOf((**KxDatabase)(nil)).Elem()
   282  }
   283  
   284  func (o KxDatabaseOutput) ToKxDatabaseOutput() KxDatabaseOutput {
   285  	return o
   286  }
   287  
   288  func (o KxDatabaseOutput) ToKxDatabaseOutputWithContext(ctx context.Context) KxDatabaseOutput {
   289  	return o
   290  }
   291  
   292  // Amazon Resource Name (ARN) identifier of the KX database.
   293  func (o KxDatabaseOutput) Arn() pulumi.StringOutput {
   294  	return o.ApplyT(func(v *KxDatabase) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   295  }
   296  
   297  // Timestamp at which the databse is created in FinSpace. Value determined as epoch time in seconds. For example, the value for Monday, November 1, 2021 12:00:00 PM UTC is specified as 1635768000.
   298  func (o KxDatabaseOutput) CreatedTimestamp() pulumi.StringOutput {
   299  	return o.ApplyT(func(v *KxDatabase) pulumi.StringOutput { return v.CreatedTimestamp }).(pulumi.StringOutput)
   300  }
   301  
   302  // Description of the KX database.
   303  func (o KxDatabaseOutput) Description() pulumi.StringPtrOutput {
   304  	return o.ApplyT(func(v *KxDatabase) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
   305  }
   306  
   307  // Unique identifier for the KX environment.
   308  func (o KxDatabaseOutput) EnvironmentId() pulumi.StringOutput {
   309  	return o.ApplyT(func(v *KxDatabase) pulumi.StringOutput { return v.EnvironmentId }).(pulumi.StringOutput)
   310  }
   311  
   312  // Last timestamp at which the database was updated in FinSpace. Value determined as epoch time in seconds. For example, the value for Monday, November 1, 2021 12:00:00 PM UTC is specified as 1635768000.
   313  func (o KxDatabaseOutput) LastModifiedTimestamp() pulumi.StringOutput {
   314  	return o.ApplyT(func(v *KxDatabase) pulumi.StringOutput { return v.LastModifiedTimestamp }).(pulumi.StringOutput)
   315  }
   316  
   317  // Name of the KX database.
   318  //
   319  // The following arguments are optional:
   320  func (o KxDatabaseOutput) Name() pulumi.StringOutput {
   321  	return o.ApplyT(func(v *KxDatabase) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
   322  }
   323  
   324  // Key-value mapping of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   325  func (o KxDatabaseOutput) Tags() pulumi.StringMapOutput {
   326  	return o.ApplyT(func(v *KxDatabase) 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 KxDatabaseOutput) TagsAll() pulumi.StringMapOutput {
   333  	return o.ApplyT(func(v *KxDatabase) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   334  }
   335  
   336  type KxDatabaseArrayOutput struct{ *pulumi.OutputState }
   337  
   338  func (KxDatabaseArrayOutput) ElementType() reflect.Type {
   339  	return reflect.TypeOf((*[]*KxDatabase)(nil)).Elem()
   340  }
   341  
   342  func (o KxDatabaseArrayOutput) ToKxDatabaseArrayOutput() KxDatabaseArrayOutput {
   343  	return o
   344  }
   345  
   346  func (o KxDatabaseArrayOutput) ToKxDatabaseArrayOutputWithContext(ctx context.Context) KxDatabaseArrayOutput {
   347  	return o
   348  }
   349  
   350  func (o KxDatabaseArrayOutput) Index(i pulumi.IntInput) KxDatabaseOutput {
   351  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *KxDatabase {
   352  		return vs[0].([]*KxDatabase)[vs[1].(int)]
   353  	}).(KxDatabaseOutput)
   354  }
   355  
   356  type KxDatabaseMapOutput struct{ *pulumi.OutputState }
   357  
   358  func (KxDatabaseMapOutput) ElementType() reflect.Type {
   359  	return reflect.TypeOf((*map[string]*KxDatabase)(nil)).Elem()
   360  }
   361  
   362  func (o KxDatabaseMapOutput) ToKxDatabaseMapOutput() KxDatabaseMapOutput {
   363  	return o
   364  }
   365  
   366  func (o KxDatabaseMapOutput) ToKxDatabaseMapOutputWithContext(ctx context.Context) KxDatabaseMapOutput {
   367  	return o
   368  }
   369  
   370  func (o KxDatabaseMapOutput) MapIndex(k pulumi.StringInput) KxDatabaseOutput {
   371  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *KxDatabase {
   372  		return vs[0].(map[string]*KxDatabase)[vs[1].(string)]
   373  	}).(KxDatabaseOutput)
   374  }
   375  
   376  func init() {
   377  	pulumi.RegisterInputType(reflect.TypeOf((*KxDatabaseInput)(nil)).Elem(), &KxDatabase{})
   378  	pulumi.RegisterInputType(reflect.TypeOf((*KxDatabaseArrayInput)(nil)).Elem(), KxDatabaseArray{})
   379  	pulumi.RegisterInputType(reflect.TypeOf((*KxDatabaseMapInput)(nil)).Elem(), KxDatabaseMap{})
   380  	pulumi.RegisterOutputType(KxDatabaseOutput{})
   381  	pulumi.RegisterOutputType(KxDatabaseArrayOutput{})
   382  	pulumi.RegisterOutputType(KxDatabaseMapOutput{})
   383  }