github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/keyspaces/keyspace.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 keyspaces
     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  // Provides a Keyspaces Keyspace.
    15  //
    16  // More information about keyspaces can be found in the [Keyspaces User Guide](https://docs.aws.amazon.com/keyspaces/latest/devguide/what-is-keyspaces.html).
    17  //
    18  // ## Example Usage
    19  //
    20  // <!--Start PulumiCodeChooser -->
    21  // ```go
    22  // package main
    23  //
    24  // import (
    25  //
    26  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/keyspaces"
    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 := keyspaces.NewKeyspace(ctx, "example", &keyspaces.KeyspaceArgs{
    34  //				Name: pulumi.String("my_keyspace"),
    35  //			})
    36  //			if err != nil {
    37  //				return err
    38  //			}
    39  //			return nil
    40  //		})
    41  //	}
    42  //
    43  // ```
    44  // <!--End PulumiCodeChooser -->
    45  //
    46  // ## Import
    47  //
    48  // Using `pulumi import`, import a keyspace using the `name`. For example:
    49  //
    50  // ```sh
    51  // $ pulumi import aws:keyspaces/keyspace:Keyspace example my_keyspace
    52  // ```
    53  type Keyspace struct {
    54  	pulumi.CustomResourceState
    55  
    56  	// The ARN of the keyspace.
    57  	Arn pulumi.StringOutput `pulumi:"arn"`
    58  	// The name of the keyspace to be created.
    59  	//
    60  	// The following arguments are optional:
    61  	Name pulumi.StringOutput `pulumi:"name"`
    62  	// 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.
    63  	Tags pulumi.StringMapOutput `pulumi:"tags"`
    64  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
    65  	//
    66  	// Deprecated: Please use `tags` instead.
    67  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
    68  }
    69  
    70  // NewKeyspace registers a new resource with the given unique name, arguments, and options.
    71  func NewKeyspace(ctx *pulumi.Context,
    72  	name string, args *KeyspaceArgs, opts ...pulumi.ResourceOption) (*Keyspace, error) {
    73  	if args == nil {
    74  		args = &KeyspaceArgs{}
    75  	}
    76  
    77  	opts = internal.PkgResourceDefaultOpts(opts)
    78  	var resource Keyspace
    79  	err := ctx.RegisterResource("aws:keyspaces/keyspace:Keyspace", name, args, &resource, opts...)
    80  	if err != nil {
    81  		return nil, err
    82  	}
    83  	return &resource, nil
    84  }
    85  
    86  // GetKeyspace gets an existing Keyspace resource's state with the given name, ID, and optional
    87  // state properties that are used to uniquely qualify the lookup (nil if not required).
    88  func GetKeyspace(ctx *pulumi.Context,
    89  	name string, id pulumi.IDInput, state *KeyspaceState, opts ...pulumi.ResourceOption) (*Keyspace, error) {
    90  	var resource Keyspace
    91  	err := ctx.ReadResource("aws:keyspaces/keyspace:Keyspace", name, id, state, &resource, opts...)
    92  	if err != nil {
    93  		return nil, err
    94  	}
    95  	return &resource, nil
    96  }
    97  
    98  // Input properties used for looking up and filtering Keyspace resources.
    99  type keyspaceState struct {
   100  	// The ARN of the keyspace.
   101  	Arn *string `pulumi:"arn"`
   102  	// The name of the keyspace to be created.
   103  	//
   104  	// The following arguments are optional:
   105  	Name *string `pulumi:"name"`
   106  	// 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.
   107  	Tags map[string]string `pulumi:"tags"`
   108  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   109  	//
   110  	// Deprecated: Please use `tags` instead.
   111  	TagsAll map[string]string `pulumi:"tagsAll"`
   112  }
   113  
   114  type KeyspaceState struct {
   115  	// The ARN of the keyspace.
   116  	Arn pulumi.StringPtrInput
   117  	// The name of the keyspace to be created.
   118  	//
   119  	// The following arguments are optional:
   120  	Name pulumi.StringPtrInput
   121  	// 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.
   122  	Tags pulumi.StringMapInput
   123  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   124  	//
   125  	// Deprecated: Please use `tags` instead.
   126  	TagsAll pulumi.StringMapInput
   127  }
   128  
   129  func (KeyspaceState) ElementType() reflect.Type {
   130  	return reflect.TypeOf((*keyspaceState)(nil)).Elem()
   131  }
   132  
   133  type keyspaceArgs struct {
   134  	// The name of the keyspace to be created.
   135  	//
   136  	// The following arguments are optional:
   137  	Name *string `pulumi:"name"`
   138  	// 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.
   139  	Tags map[string]string `pulumi:"tags"`
   140  }
   141  
   142  // The set of arguments for constructing a Keyspace resource.
   143  type KeyspaceArgs struct {
   144  	// The name of the keyspace to be created.
   145  	//
   146  	// The following arguments are optional:
   147  	Name pulumi.StringPtrInput
   148  	// 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.
   149  	Tags pulumi.StringMapInput
   150  }
   151  
   152  func (KeyspaceArgs) ElementType() reflect.Type {
   153  	return reflect.TypeOf((*keyspaceArgs)(nil)).Elem()
   154  }
   155  
   156  type KeyspaceInput interface {
   157  	pulumi.Input
   158  
   159  	ToKeyspaceOutput() KeyspaceOutput
   160  	ToKeyspaceOutputWithContext(ctx context.Context) KeyspaceOutput
   161  }
   162  
   163  func (*Keyspace) ElementType() reflect.Type {
   164  	return reflect.TypeOf((**Keyspace)(nil)).Elem()
   165  }
   166  
   167  func (i *Keyspace) ToKeyspaceOutput() KeyspaceOutput {
   168  	return i.ToKeyspaceOutputWithContext(context.Background())
   169  }
   170  
   171  func (i *Keyspace) ToKeyspaceOutputWithContext(ctx context.Context) KeyspaceOutput {
   172  	return pulumi.ToOutputWithContext(ctx, i).(KeyspaceOutput)
   173  }
   174  
   175  // KeyspaceArrayInput is an input type that accepts KeyspaceArray and KeyspaceArrayOutput values.
   176  // You can construct a concrete instance of `KeyspaceArrayInput` via:
   177  //
   178  //	KeyspaceArray{ KeyspaceArgs{...} }
   179  type KeyspaceArrayInput interface {
   180  	pulumi.Input
   181  
   182  	ToKeyspaceArrayOutput() KeyspaceArrayOutput
   183  	ToKeyspaceArrayOutputWithContext(context.Context) KeyspaceArrayOutput
   184  }
   185  
   186  type KeyspaceArray []KeyspaceInput
   187  
   188  func (KeyspaceArray) ElementType() reflect.Type {
   189  	return reflect.TypeOf((*[]*Keyspace)(nil)).Elem()
   190  }
   191  
   192  func (i KeyspaceArray) ToKeyspaceArrayOutput() KeyspaceArrayOutput {
   193  	return i.ToKeyspaceArrayOutputWithContext(context.Background())
   194  }
   195  
   196  func (i KeyspaceArray) ToKeyspaceArrayOutputWithContext(ctx context.Context) KeyspaceArrayOutput {
   197  	return pulumi.ToOutputWithContext(ctx, i).(KeyspaceArrayOutput)
   198  }
   199  
   200  // KeyspaceMapInput is an input type that accepts KeyspaceMap and KeyspaceMapOutput values.
   201  // You can construct a concrete instance of `KeyspaceMapInput` via:
   202  //
   203  //	KeyspaceMap{ "key": KeyspaceArgs{...} }
   204  type KeyspaceMapInput interface {
   205  	pulumi.Input
   206  
   207  	ToKeyspaceMapOutput() KeyspaceMapOutput
   208  	ToKeyspaceMapOutputWithContext(context.Context) KeyspaceMapOutput
   209  }
   210  
   211  type KeyspaceMap map[string]KeyspaceInput
   212  
   213  func (KeyspaceMap) ElementType() reflect.Type {
   214  	return reflect.TypeOf((*map[string]*Keyspace)(nil)).Elem()
   215  }
   216  
   217  func (i KeyspaceMap) ToKeyspaceMapOutput() KeyspaceMapOutput {
   218  	return i.ToKeyspaceMapOutputWithContext(context.Background())
   219  }
   220  
   221  func (i KeyspaceMap) ToKeyspaceMapOutputWithContext(ctx context.Context) KeyspaceMapOutput {
   222  	return pulumi.ToOutputWithContext(ctx, i).(KeyspaceMapOutput)
   223  }
   224  
   225  type KeyspaceOutput struct{ *pulumi.OutputState }
   226  
   227  func (KeyspaceOutput) ElementType() reflect.Type {
   228  	return reflect.TypeOf((**Keyspace)(nil)).Elem()
   229  }
   230  
   231  func (o KeyspaceOutput) ToKeyspaceOutput() KeyspaceOutput {
   232  	return o
   233  }
   234  
   235  func (o KeyspaceOutput) ToKeyspaceOutputWithContext(ctx context.Context) KeyspaceOutput {
   236  	return o
   237  }
   238  
   239  // The ARN of the keyspace.
   240  func (o KeyspaceOutput) Arn() pulumi.StringOutput {
   241  	return o.ApplyT(func(v *Keyspace) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   242  }
   243  
   244  // The name of the keyspace to be created.
   245  //
   246  // The following arguments are optional:
   247  func (o KeyspaceOutput) Name() pulumi.StringOutput {
   248  	return o.ApplyT(func(v *Keyspace) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
   249  }
   250  
   251  // 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.
   252  func (o KeyspaceOutput) Tags() pulumi.StringMapOutput {
   253  	return o.ApplyT(func(v *Keyspace) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   254  }
   255  
   256  // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   257  //
   258  // Deprecated: Please use `tags` instead.
   259  func (o KeyspaceOutput) TagsAll() pulumi.StringMapOutput {
   260  	return o.ApplyT(func(v *Keyspace) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   261  }
   262  
   263  type KeyspaceArrayOutput struct{ *pulumi.OutputState }
   264  
   265  func (KeyspaceArrayOutput) ElementType() reflect.Type {
   266  	return reflect.TypeOf((*[]*Keyspace)(nil)).Elem()
   267  }
   268  
   269  func (o KeyspaceArrayOutput) ToKeyspaceArrayOutput() KeyspaceArrayOutput {
   270  	return o
   271  }
   272  
   273  func (o KeyspaceArrayOutput) ToKeyspaceArrayOutputWithContext(ctx context.Context) KeyspaceArrayOutput {
   274  	return o
   275  }
   276  
   277  func (o KeyspaceArrayOutput) Index(i pulumi.IntInput) KeyspaceOutput {
   278  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Keyspace {
   279  		return vs[0].([]*Keyspace)[vs[1].(int)]
   280  	}).(KeyspaceOutput)
   281  }
   282  
   283  type KeyspaceMapOutput struct{ *pulumi.OutputState }
   284  
   285  func (KeyspaceMapOutput) ElementType() reflect.Type {
   286  	return reflect.TypeOf((*map[string]*Keyspace)(nil)).Elem()
   287  }
   288  
   289  func (o KeyspaceMapOutput) ToKeyspaceMapOutput() KeyspaceMapOutput {
   290  	return o
   291  }
   292  
   293  func (o KeyspaceMapOutput) ToKeyspaceMapOutputWithContext(ctx context.Context) KeyspaceMapOutput {
   294  	return o
   295  }
   296  
   297  func (o KeyspaceMapOutput) MapIndex(k pulumi.StringInput) KeyspaceOutput {
   298  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Keyspace {
   299  		return vs[0].(map[string]*Keyspace)[vs[1].(string)]
   300  	}).(KeyspaceOutput)
   301  }
   302  
   303  func init() {
   304  	pulumi.RegisterInputType(reflect.TypeOf((*KeyspaceInput)(nil)).Elem(), &Keyspace{})
   305  	pulumi.RegisterInputType(reflect.TypeOf((*KeyspaceArrayInput)(nil)).Elem(), KeyspaceArray{})
   306  	pulumi.RegisterInputType(reflect.TypeOf((*KeyspaceMapInput)(nil)).Elem(), KeyspaceMap{})
   307  	pulumi.RegisterOutputType(KeyspaceOutput{})
   308  	pulumi.RegisterOutputType(KeyspaceArrayOutput{})
   309  	pulumi.RegisterOutputType(KeyspaceMapOutput{})
   310  }