github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/quicksight/namespace.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 quicksight
     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 QuickSight Namespace.
    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/quicksight"
    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 := quicksight.NewNamespace(ctx, "example", &quicksight.NamespaceArgs{
    35  //				Namespace: pulumi.String("example"),
    36  //			})
    37  //			if err != nil {
    38  //				return err
    39  //			}
    40  //			return nil
    41  //		})
    42  //	}
    43  //
    44  // ```
    45  // <!--End PulumiCodeChooser -->
    46  //
    47  // ## Import
    48  //
    49  // Using `pulumi import`, import QuickSight Namespace using the AWS account ID and namespace separated by commas (`,`). For example:
    50  //
    51  // ```sh
    52  // $ pulumi import aws:quicksight/namespace:Namespace example 123456789012,example
    53  // ```
    54  type Namespace struct {
    55  	pulumi.CustomResourceState
    56  
    57  	// ARN of the Namespace.
    58  	Arn pulumi.StringOutput `pulumi:"arn"`
    59  	// AWS account ID.
    60  	AwsAccountId pulumi.StringOutput `pulumi:"awsAccountId"`
    61  	// Namespace AWS Region.
    62  	CapacityRegion pulumi.StringOutput `pulumi:"capacityRegion"`
    63  	// Creation status of the namespace.
    64  	CreationStatus pulumi.StringOutput `pulumi:"creationStatus"`
    65  	// User identity directory type. Defaults to `QUICKSIGHT`, the only current valid value.
    66  	IdentityStore pulumi.StringOutput `pulumi:"identityStore"`
    67  	// Name of the namespace.
    68  	//
    69  	// The following arguments are optional:
    70  	Namespace pulumi.StringOutput `pulumi:"namespace"`
    71  	// Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    72  	Tags pulumi.StringMapOutput `pulumi:"tags"`
    73  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
    74  	//
    75  	// Deprecated: Please use `tags` instead.
    76  	TagsAll  pulumi.StringMapOutput     `pulumi:"tagsAll"`
    77  	Timeouts NamespaceTimeoutsPtrOutput `pulumi:"timeouts"`
    78  }
    79  
    80  // NewNamespace registers a new resource with the given unique name, arguments, and options.
    81  func NewNamespace(ctx *pulumi.Context,
    82  	name string, args *NamespaceArgs, opts ...pulumi.ResourceOption) (*Namespace, error) {
    83  	if args == nil {
    84  		return nil, errors.New("missing one or more required arguments")
    85  	}
    86  
    87  	if args.Namespace == nil {
    88  		return nil, errors.New("invalid value for required argument 'Namespace'")
    89  	}
    90  	opts = internal.PkgResourceDefaultOpts(opts)
    91  	var resource Namespace
    92  	err := ctx.RegisterResource("aws:quicksight/namespace:Namespace", name, args, &resource, opts...)
    93  	if err != nil {
    94  		return nil, err
    95  	}
    96  	return &resource, nil
    97  }
    98  
    99  // GetNamespace gets an existing Namespace resource's state with the given name, ID, and optional
   100  // state properties that are used to uniquely qualify the lookup (nil if not required).
   101  func GetNamespace(ctx *pulumi.Context,
   102  	name string, id pulumi.IDInput, state *NamespaceState, opts ...pulumi.ResourceOption) (*Namespace, error) {
   103  	var resource Namespace
   104  	err := ctx.ReadResource("aws:quicksight/namespace:Namespace", name, id, state, &resource, opts...)
   105  	if err != nil {
   106  		return nil, err
   107  	}
   108  	return &resource, nil
   109  }
   110  
   111  // Input properties used for looking up and filtering Namespace resources.
   112  type namespaceState struct {
   113  	// ARN of the Namespace.
   114  	Arn *string `pulumi:"arn"`
   115  	// AWS account ID.
   116  	AwsAccountId *string `pulumi:"awsAccountId"`
   117  	// Namespace AWS Region.
   118  	CapacityRegion *string `pulumi:"capacityRegion"`
   119  	// Creation status of the namespace.
   120  	CreationStatus *string `pulumi:"creationStatus"`
   121  	// User identity directory type. Defaults to `QUICKSIGHT`, the only current valid value.
   122  	IdentityStore *string `pulumi:"identityStore"`
   123  	// Name of the namespace.
   124  	//
   125  	// The following arguments are optional:
   126  	Namespace *string `pulumi:"namespace"`
   127  	// Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   128  	Tags map[string]string `pulumi:"tags"`
   129  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   130  	//
   131  	// Deprecated: Please use `tags` instead.
   132  	TagsAll  map[string]string  `pulumi:"tagsAll"`
   133  	Timeouts *NamespaceTimeouts `pulumi:"timeouts"`
   134  }
   135  
   136  type NamespaceState struct {
   137  	// ARN of the Namespace.
   138  	Arn pulumi.StringPtrInput
   139  	// AWS account ID.
   140  	AwsAccountId pulumi.StringPtrInput
   141  	// Namespace AWS Region.
   142  	CapacityRegion pulumi.StringPtrInput
   143  	// Creation status of the namespace.
   144  	CreationStatus pulumi.StringPtrInput
   145  	// User identity directory type. Defaults to `QUICKSIGHT`, the only current valid value.
   146  	IdentityStore pulumi.StringPtrInput
   147  	// Name of the namespace.
   148  	//
   149  	// The following arguments are optional:
   150  	Namespace pulumi.StringPtrInput
   151  	// Key-value map of resource tags. 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  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   154  	//
   155  	// Deprecated: Please use `tags` instead.
   156  	TagsAll  pulumi.StringMapInput
   157  	Timeouts NamespaceTimeoutsPtrInput
   158  }
   159  
   160  func (NamespaceState) ElementType() reflect.Type {
   161  	return reflect.TypeOf((*namespaceState)(nil)).Elem()
   162  }
   163  
   164  type namespaceArgs struct {
   165  	// AWS account ID.
   166  	AwsAccountId *string `pulumi:"awsAccountId"`
   167  	// User identity directory type. Defaults to `QUICKSIGHT`, the only current valid value.
   168  	IdentityStore *string `pulumi:"identityStore"`
   169  	// Name of the namespace.
   170  	//
   171  	// The following arguments are optional:
   172  	Namespace string `pulumi:"namespace"`
   173  	// Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   174  	Tags     map[string]string  `pulumi:"tags"`
   175  	Timeouts *NamespaceTimeouts `pulumi:"timeouts"`
   176  }
   177  
   178  // The set of arguments for constructing a Namespace resource.
   179  type NamespaceArgs struct {
   180  	// AWS account ID.
   181  	AwsAccountId pulumi.StringPtrInput
   182  	// User identity directory type. Defaults to `QUICKSIGHT`, the only current valid value.
   183  	IdentityStore pulumi.StringPtrInput
   184  	// Name of the namespace.
   185  	//
   186  	// The following arguments are optional:
   187  	Namespace pulumi.StringInput
   188  	// Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   189  	Tags     pulumi.StringMapInput
   190  	Timeouts NamespaceTimeoutsPtrInput
   191  }
   192  
   193  func (NamespaceArgs) ElementType() reflect.Type {
   194  	return reflect.TypeOf((*namespaceArgs)(nil)).Elem()
   195  }
   196  
   197  type NamespaceInput interface {
   198  	pulumi.Input
   199  
   200  	ToNamespaceOutput() NamespaceOutput
   201  	ToNamespaceOutputWithContext(ctx context.Context) NamespaceOutput
   202  }
   203  
   204  func (*Namespace) ElementType() reflect.Type {
   205  	return reflect.TypeOf((**Namespace)(nil)).Elem()
   206  }
   207  
   208  func (i *Namespace) ToNamespaceOutput() NamespaceOutput {
   209  	return i.ToNamespaceOutputWithContext(context.Background())
   210  }
   211  
   212  func (i *Namespace) ToNamespaceOutputWithContext(ctx context.Context) NamespaceOutput {
   213  	return pulumi.ToOutputWithContext(ctx, i).(NamespaceOutput)
   214  }
   215  
   216  // NamespaceArrayInput is an input type that accepts NamespaceArray and NamespaceArrayOutput values.
   217  // You can construct a concrete instance of `NamespaceArrayInput` via:
   218  //
   219  //	NamespaceArray{ NamespaceArgs{...} }
   220  type NamespaceArrayInput interface {
   221  	pulumi.Input
   222  
   223  	ToNamespaceArrayOutput() NamespaceArrayOutput
   224  	ToNamespaceArrayOutputWithContext(context.Context) NamespaceArrayOutput
   225  }
   226  
   227  type NamespaceArray []NamespaceInput
   228  
   229  func (NamespaceArray) ElementType() reflect.Type {
   230  	return reflect.TypeOf((*[]*Namespace)(nil)).Elem()
   231  }
   232  
   233  func (i NamespaceArray) ToNamespaceArrayOutput() NamespaceArrayOutput {
   234  	return i.ToNamespaceArrayOutputWithContext(context.Background())
   235  }
   236  
   237  func (i NamespaceArray) ToNamespaceArrayOutputWithContext(ctx context.Context) NamespaceArrayOutput {
   238  	return pulumi.ToOutputWithContext(ctx, i).(NamespaceArrayOutput)
   239  }
   240  
   241  // NamespaceMapInput is an input type that accepts NamespaceMap and NamespaceMapOutput values.
   242  // You can construct a concrete instance of `NamespaceMapInput` via:
   243  //
   244  //	NamespaceMap{ "key": NamespaceArgs{...} }
   245  type NamespaceMapInput interface {
   246  	pulumi.Input
   247  
   248  	ToNamespaceMapOutput() NamespaceMapOutput
   249  	ToNamespaceMapOutputWithContext(context.Context) NamespaceMapOutput
   250  }
   251  
   252  type NamespaceMap map[string]NamespaceInput
   253  
   254  func (NamespaceMap) ElementType() reflect.Type {
   255  	return reflect.TypeOf((*map[string]*Namespace)(nil)).Elem()
   256  }
   257  
   258  func (i NamespaceMap) ToNamespaceMapOutput() NamespaceMapOutput {
   259  	return i.ToNamespaceMapOutputWithContext(context.Background())
   260  }
   261  
   262  func (i NamespaceMap) ToNamespaceMapOutputWithContext(ctx context.Context) NamespaceMapOutput {
   263  	return pulumi.ToOutputWithContext(ctx, i).(NamespaceMapOutput)
   264  }
   265  
   266  type NamespaceOutput struct{ *pulumi.OutputState }
   267  
   268  func (NamespaceOutput) ElementType() reflect.Type {
   269  	return reflect.TypeOf((**Namespace)(nil)).Elem()
   270  }
   271  
   272  func (o NamespaceOutput) ToNamespaceOutput() NamespaceOutput {
   273  	return o
   274  }
   275  
   276  func (o NamespaceOutput) ToNamespaceOutputWithContext(ctx context.Context) NamespaceOutput {
   277  	return o
   278  }
   279  
   280  // ARN of the Namespace.
   281  func (o NamespaceOutput) Arn() pulumi.StringOutput {
   282  	return o.ApplyT(func(v *Namespace) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   283  }
   284  
   285  // AWS account ID.
   286  func (o NamespaceOutput) AwsAccountId() pulumi.StringOutput {
   287  	return o.ApplyT(func(v *Namespace) pulumi.StringOutput { return v.AwsAccountId }).(pulumi.StringOutput)
   288  }
   289  
   290  // Namespace AWS Region.
   291  func (o NamespaceOutput) CapacityRegion() pulumi.StringOutput {
   292  	return o.ApplyT(func(v *Namespace) pulumi.StringOutput { return v.CapacityRegion }).(pulumi.StringOutput)
   293  }
   294  
   295  // Creation status of the namespace.
   296  func (o NamespaceOutput) CreationStatus() pulumi.StringOutput {
   297  	return o.ApplyT(func(v *Namespace) pulumi.StringOutput { return v.CreationStatus }).(pulumi.StringOutput)
   298  }
   299  
   300  // User identity directory type. Defaults to `QUICKSIGHT`, the only current valid value.
   301  func (o NamespaceOutput) IdentityStore() pulumi.StringOutput {
   302  	return o.ApplyT(func(v *Namespace) pulumi.StringOutput { return v.IdentityStore }).(pulumi.StringOutput)
   303  }
   304  
   305  // Name of the namespace.
   306  //
   307  // The following arguments are optional:
   308  func (o NamespaceOutput) Namespace() pulumi.StringOutput {
   309  	return o.ApplyT(func(v *Namespace) pulumi.StringOutput { return v.Namespace }).(pulumi.StringOutput)
   310  }
   311  
   312  // Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   313  func (o NamespaceOutput) Tags() pulumi.StringMapOutput {
   314  	return o.ApplyT(func(v *Namespace) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   315  }
   316  
   317  // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   318  //
   319  // Deprecated: Please use `tags` instead.
   320  func (o NamespaceOutput) TagsAll() pulumi.StringMapOutput {
   321  	return o.ApplyT(func(v *Namespace) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   322  }
   323  
   324  func (o NamespaceOutput) Timeouts() NamespaceTimeoutsPtrOutput {
   325  	return o.ApplyT(func(v *Namespace) NamespaceTimeoutsPtrOutput { return v.Timeouts }).(NamespaceTimeoutsPtrOutput)
   326  }
   327  
   328  type NamespaceArrayOutput struct{ *pulumi.OutputState }
   329  
   330  func (NamespaceArrayOutput) ElementType() reflect.Type {
   331  	return reflect.TypeOf((*[]*Namespace)(nil)).Elem()
   332  }
   333  
   334  func (o NamespaceArrayOutput) ToNamespaceArrayOutput() NamespaceArrayOutput {
   335  	return o
   336  }
   337  
   338  func (o NamespaceArrayOutput) ToNamespaceArrayOutputWithContext(ctx context.Context) NamespaceArrayOutput {
   339  	return o
   340  }
   341  
   342  func (o NamespaceArrayOutput) Index(i pulumi.IntInput) NamespaceOutput {
   343  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Namespace {
   344  		return vs[0].([]*Namespace)[vs[1].(int)]
   345  	}).(NamespaceOutput)
   346  }
   347  
   348  type NamespaceMapOutput struct{ *pulumi.OutputState }
   349  
   350  func (NamespaceMapOutput) ElementType() reflect.Type {
   351  	return reflect.TypeOf((*map[string]*Namespace)(nil)).Elem()
   352  }
   353  
   354  func (o NamespaceMapOutput) ToNamespaceMapOutput() NamespaceMapOutput {
   355  	return o
   356  }
   357  
   358  func (o NamespaceMapOutput) ToNamespaceMapOutputWithContext(ctx context.Context) NamespaceMapOutput {
   359  	return o
   360  }
   361  
   362  func (o NamespaceMapOutput) MapIndex(k pulumi.StringInput) NamespaceOutput {
   363  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Namespace {
   364  		return vs[0].(map[string]*Namespace)[vs[1].(string)]
   365  	}).(NamespaceOutput)
   366  }
   367  
   368  func init() {
   369  	pulumi.RegisterInputType(reflect.TypeOf((*NamespaceInput)(nil)).Elem(), &Namespace{})
   370  	pulumi.RegisterInputType(reflect.TypeOf((*NamespaceArrayInput)(nil)).Elem(), NamespaceArray{})
   371  	pulumi.RegisterInputType(reflect.TypeOf((*NamespaceMapInput)(nil)).Elem(), NamespaceMap{})
   372  	pulumi.RegisterOutputType(NamespaceOutput{})
   373  	pulumi.RegisterOutputType(NamespaceArrayOutput{})
   374  	pulumi.RegisterOutputType(NamespaceMapOutput{})
   375  }