github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/quicksight/folder.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 a QuickSight Folder.
    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.NewFolder(ctx, "example", &quicksight.FolderArgs{
    35  //				FolderId: pulumi.String("example-id"),
    36  //				Name:     pulumi.String("example-name"),
    37  //			})
    38  //			if err != nil {
    39  //				return err
    40  //			}
    41  //			return nil
    42  //		})
    43  //	}
    44  //
    45  // ```
    46  // <!--End PulumiCodeChooser -->
    47  //
    48  // ### With Permissions
    49  //
    50  // <!--Start PulumiCodeChooser -->
    51  // ```go
    52  // package main
    53  //
    54  // import (
    55  //
    56  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/quicksight"
    57  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    58  //
    59  // )
    60  //
    61  //	func main() {
    62  //		pulumi.Run(func(ctx *pulumi.Context) error {
    63  //			_, err := quicksight.NewFolder(ctx, "example", &quicksight.FolderArgs{
    64  //				FolderId: pulumi.String("example-id"),
    65  //				Name:     pulumi.String("example-name"),
    66  //				Permissions: quicksight.FolderPermissionArray{
    67  //					&quicksight.FolderPermissionArgs{
    68  //						Actions: pulumi.StringArray{
    69  //							pulumi.String("quicksight:CreateFolder"),
    70  //							pulumi.String("quicksight:DescribeFolder"),
    71  //							pulumi.String("quicksight:UpdateFolder"),
    72  //							pulumi.String("quicksight:DeleteFolder"),
    73  //							pulumi.String("quicksight:CreateFolderMembership"),
    74  //							pulumi.String("quicksight:DeleteFolderMembership"),
    75  //							pulumi.String("quicksight:DescribeFolderPermissions"),
    76  //							pulumi.String("quicksight:UpdateFolderPermissions"),
    77  //						},
    78  //						Principal: pulumi.Any(exampleAwsQuicksightUser.Arn),
    79  //					},
    80  //				},
    81  //			})
    82  //			if err != nil {
    83  //				return err
    84  //			}
    85  //			return nil
    86  //		})
    87  //	}
    88  //
    89  // ```
    90  // <!--End PulumiCodeChooser -->
    91  //
    92  // ### With Parent Folder
    93  //
    94  // <!--Start PulumiCodeChooser -->
    95  // ```go
    96  // package main
    97  //
    98  // import (
    99  //
   100  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/quicksight"
   101  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
   102  //
   103  // )
   104  //
   105  //	func main() {
   106  //		pulumi.Run(func(ctx *pulumi.Context) error {
   107  //			parent, err := quicksight.NewFolder(ctx, "parent", &quicksight.FolderArgs{
   108  //				FolderId: pulumi.String("parent-id"),
   109  //				Name:     pulumi.String("parent-name"),
   110  //			})
   111  //			if err != nil {
   112  //				return err
   113  //			}
   114  //			_, err = quicksight.NewFolder(ctx, "example", &quicksight.FolderArgs{
   115  //				FolderId:        pulumi.String("example-id"),
   116  //				Name:            pulumi.String("example-name"),
   117  //				ParentFolderArn: parent.Arn,
   118  //			})
   119  //			if err != nil {
   120  //				return err
   121  //			}
   122  //			return nil
   123  //		})
   124  //	}
   125  //
   126  // ```
   127  // <!--End PulumiCodeChooser -->
   128  //
   129  // ## Import
   130  //
   131  // Using `pulumi import`, import a QuickSight folder using the AWS account ID and folder ID name separated by a comma (`,`). For example:
   132  //
   133  // ```sh
   134  // $ pulumi import aws:quicksight/folder:Folder example 123456789012,example-id
   135  // ```
   136  type Folder struct {
   137  	pulumi.CustomResourceState
   138  
   139  	// ARN of the folder.
   140  	Arn pulumi.StringOutput `pulumi:"arn"`
   141  	// AWS account ID.
   142  	AwsAccountId pulumi.StringOutput `pulumi:"awsAccountId"`
   143  	// The time that the folder was created.
   144  	CreatedTime pulumi.StringOutput `pulumi:"createdTime"`
   145  	// Identifier for the folder.
   146  	FolderId pulumi.StringOutput `pulumi:"folderId"`
   147  	// An array of ancestor ARN strings for the folder. Empty for root-level folders.
   148  	FolderPaths pulumi.StringArrayOutput `pulumi:"folderPaths"`
   149  	// The type of folder. By default, it is `SHARED`. Valid values are: `SHARED`.
   150  	FolderType pulumi.StringPtrOutput `pulumi:"folderType"`
   151  	// The time that the folder was last updated.
   152  	LastUpdatedTime pulumi.StringOutput `pulumi:"lastUpdatedTime"`
   153  	// Display name for the folder.
   154  	//
   155  	// The following arguments are optional:
   156  	Name pulumi.StringOutput `pulumi:"name"`
   157  	// The Amazon Resource Name (ARN) for the parent folder. If not set, creates a root-level folder.
   158  	ParentFolderArn pulumi.StringPtrOutput `pulumi:"parentFolderArn"`
   159  	// A set of resource permissions on the folder. Maximum of 64 items. See permissions.
   160  	Permissions FolderPermissionArrayOutput `pulumi:"permissions"`
   161  	// 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.
   162  	Tags pulumi.StringMapOutput `pulumi:"tags"`
   163  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   164  	//
   165  	// Deprecated: Please use `tags` instead.
   166  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
   167  }
   168  
   169  // NewFolder registers a new resource with the given unique name, arguments, and options.
   170  func NewFolder(ctx *pulumi.Context,
   171  	name string, args *FolderArgs, opts ...pulumi.ResourceOption) (*Folder, error) {
   172  	if args == nil {
   173  		return nil, errors.New("missing one or more required arguments")
   174  	}
   175  
   176  	if args.FolderId == nil {
   177  		return nil, errors.New("invalid value for required argument 'FolderId'")
   178  	}
   179  	opts = internal.PkgResourceDefaultOpts(opts)
   180  	var resource Folder
   181  	err := ctx.RegisterResource("aws:quicksight/folder:Folder", name, args, &resource, opts...)
   182  	if err != nil {
   183  		return nil, err
   184  	}
   185  	return &resource, nil
   186  }
   187  
   188  // GetFolder gets an existing Folder resource's state with the given name, ID, and optional
   189  // state properties that are used to uniquely qualify the lookup (nil if not required).
   190  func GetFolder(ctx *pulumi.Context,
   191  	name string, id pulumi.IDInput, state *FolderState, opts ...pulumi.ResourceOption) (*Folder, error) {
   192  	var resource Folder
   193  	err := ctx.ReadResource("aws:quicksight/folder:Folder", name, id, state, &resource, opts...)
   194  	if err != nil {
   195  		return nil, err
   196  	}
   197  	return &resource, nil
   198  }
   199  
   200  // Input properties used for looking up and filtering Folder resources.
   201  type folderState struct {
   202  	// ARN of the folder.
   203  	Arn *string `pulumi:"arn"`
   204  	// AWS account ID.
   205  	AwsAccountId *string `pulumi:"awsAccountId"`
   206  	// The time that the folder was created.
   207  	CreatedTime *string `pulumi:"createdTime"`
   208  	// Identifier for the folder.
   209  	FolderId *string `pulumi:"folderId"`
   210  	// An array of ancestor ARN strings for the folder. Empty for root-level folders.
   211  	FolderPaths []string `pulumi:"folderPaths"`
   212  	// The type of folder. By default, it is `SHARED`. Valid values are: `SHARED`.
   213  	FolderType *string `pulumi:"folderType"`
   214  	// The time that the folder was last updated.
   215  	LastUpdatedTime *string `pulumi:"lastUpdatedTime"`
   216  	// Display name for the folder.
   217  	//
   218  	// The following arguments are optional:
   219  	Name *string `pulumi:"name"`
   220  	// The Amazon Resource Name (ARN) for the parent folder. If not set, creates a root-level folder.
   221  	ParentFolderArn *string `pulumi:"parentFolderArn"`
   222  	// A set of resource permissions on the folder. Maximum of 64 items. See permissions.
   223  	Permissions []FolderPermission `pulumi:"permissions"`
   224  	// 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.
   225  	Tags map[string]string `pulumi:"tags"`
   226  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   227  	//
   228  	// Deprecated: Please use `tags` instead.
   229  	TagsAll map[string]string `pulumi:"tagsAll"`
   230  }
   231  
   232  type FolderState struct {
   233  	// ARN of the folder.
   234  	Arn pulumi.StringPtrInput
   235  	// AWS account ID.
   236  	AwsAccountId pulumi.StringPtrInput
   237  	// The time that the folder was created.
   238  	CreatedTime pulumi.StringPtrInput
   239  	// Identifier for the folder.
   240  	FolderId pulumi.StringPtrInput
   241  	// An array of ancestor ARN strings for the folder. Empty for root-level folders.
   242  	FolderPaths pulumi.StringArrayInput
   243  	// The type of folder. By default, it is `SHARED`. Valid values are: `SHARED`.
   244  	FolderType pulumi.StringPtrInput
   245  	// The time that the folder was last updated.
   246  	LastUpdatedTime pulumi.StringPtrInput
   247  	// Display name for the folder.
   248  	//
   249  	// The following arguments are optional:
   250  	Name pulumi.StringPtrInput
   251  	// The Amazon Resource Name (ARN) for the parent folder. If not set, creates a root-level folder.
   252  	ParentFolderArn pulumi.StringPtrInput
   253  	// A set of resource permissions on the folder. Maximum of 64 items. See permissions.
   254  	Permissions FolderPermissionArrayInput
   255  	// 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.
   256  	Tags pulumi.StringMapInput
   257  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   258  	//
   259  	// Deprecated: Please use `tags` instead.
   260  	TagsAll pulumi.StringMapInput
   261  }
   262  
   263  func (FolderState) ElementType() reflect.Type {
   264  	return reflect.TypeOf((*folderState)(nil)).Elem()
   265  }
   266  
   267  type folderArgs struct {
   268  	// AWS account ID.
   269  	AwsAccountId *string `pulumi:"awsAccountId"`
   270  	// Identifier for the folder.
   271  	FolderId string `pulumi:"folderId"`
   272  	// The type of folder. By default, it is `SHARED`. Valid values are: `SHARED`.
   273  	FolderType *string `pulumi:"folderType"`
   274  	// Display name for the folder.
   275  	//
   276  	// The following arguments are optional:
   277  	Name *string `pulumi:"name"`
   278  	// The Amazon Resource Name (ARN) for the parent folder. If not set, creates a root-level folder.
   279  	ParentFolderArn *string `pulumi:"parentFolderArn"`
   280  	// A set of resource permissions on the folder. Maximum of 64 items. See permissions.
   281  	Permissions []FolderPermission `pulumi:"permissions"`
   282  	// 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.
   283  	Tags map[string]string `pulumi:"tags"`
   284  }
   285  
   286  // The set of arguments for constructing a Folder resource.
   287  type FolderArgs struct {
   288  	// AWS account ID.
   289  	AwsAccountId pulumi.StringPtrInput
   290  	// Identifier for the folder.
   291  	FolderId pulumi.StringInput
   292  	// The type of folder. By default, it is `SHARED`. Valid values are: `SHARED`.
   293  	FolderType pulumi.StringPtrInput
   294  	// Display name for the folder.
   295  	//
   296  	// The following arguments are optional:
   297  	Name pulumi.StringPtrInput
   298  	// The Amazon Resource Name (ARN) for the parent folder. If not set, creates a root-level folder.
   299  	ParentFolderArn pulumi.StringPtrInput
   300  	// A set of resource permissions on the folder. Maximum of 64 items. See permissions.
   301  	Permissions FolderPermissionArrayInput
   302  	// 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.
   303  	Tags pulumi.StringMapInput
   304  }
   305  
   306  func (FolderArgs) ElementType() reflect.Type {
   307  	return reflect.TypeOf((*folderArgs)(nil)).Elem()
   308  }
   309  
   310  type FolderInput interface {
   311  	pulumi.Input
   312  
   313  	ToFolderOutput() FolderOutput
   314  	ToFolderOutputWithContext(ctx context.Context) FolderOutput
   315  }
   316  
   317  func (*Folder) ElementType() reflect.Type {
   318  	return reflect.TypeOf((**Folder)(nil)).Elem()
   319  }
   320  
   321  func (i *Folder) ToFolderOutput() FolderOutput {
   322  	return i.ToFolderOutputWithContext(context.Background())
   323  }
   324  
   325  func (i *Folder) ToFolderOutputWithContext(ctx context.Context) FolderOutput {
   326  	return pulumi.ToOutputWithContext(ctx, i).(FolderOutput)
   327  }
   328  
   329  // FolderArrayInput is an input type that accepts FolderArray and FolderArrayOutput values.
   330  // You can construct a concrete instance of `FolderArrayInput` via:
   331  //
   332  //	FolderArray{ FolderArgs{...} }
   333  type FolderArrayInput interface {
   334  	pulumi.Input
   335  
   336  	ToFolderArrayOutput() FolderArrayOutput
   337  	ToFolderArrayOutputWithContext(context.Context) FolderArrayOutput
   338  }
   339  
   340  type FolderArray []FolderInput
   341  
   342  func (FolderArray) ElementType() reflect.Type {
   343  	return reflect.TypeOf((*[]*Folder)(nil)).Elem()
   344  }
   345  
   346  func (i FolderArray) ToFolderArrayOutput() FolderArrayOutput {
   347  	return i.ToFolderArrayOutputWithContext(context.Background())
   348  }
   349  
   350  func (i FolderArray) ToFolderArrayOutputWithContext(ctx context.Context) FolderArrayOutput {
   351  	return pulumi.ToOutputWithContext(ctx, i).(FolderArrayOutput)
   352  }
   353  
   354  // FolderMapInput is an input type that accepts FolderMap and FolderMapOutput values.
   355  // You can construct a concrete instance of `FolderMapInput` via:
   356  //
   357  //	FolderMap{ "key": FolderArgs{...} }
   358  type FolderMapInput interface {
   359  	pulumi.Input
   360  
   361  	ToFolderMapOutput() FolderMapOutput
   362  	ToFolderMapOutputWithContext(context.Context) FolderMapOutput
   363  }
   364  
   365  type FolderMap map[string]FolderInput
   366  
   367  func (FolderMap) ElementType() reflect.Type {
   368  	return reflect.TypeOf((*map[string]*Folder)(nil)).Elem()
   369  }
   370  
   371  func (i FolderMap) ToFolderMapOutput() FolderMapOutput {
   372  	return i.ToFolderMapOutputWithContext(context.Background())
   373  }
   374  
   375  func (i FolderMap) ToFolderMapOutputWithContext(ctx context.Context) FolderMapOutput {
   376  	return pulumi.ToOutputWithContext(ctx, i).(FolderMapOutput)
   377  }
   378  
   379  type FolderOutput struct{ *pulumi.OutputState }
   380  
   381  func (FolderOutput) ElementType() reflect.Type {
   382  	return reflect.TypeOf((**Folder)(nil)).Elem()
   383  }
   384  
   385  func (o FolderOutput) ToFolderOutput() FolderOutput {
   386  	return o
   387  }
   388  
   389  func (o FolderOutput) ToFolderOutputWithContext(ctx context.Context) FolderOutput {
   390  	return o
   391  }
   392  
   393  // ARN of the folder.
   394  func (o FolderOutput) Arn() pulumi.StringOutput {
   395  	return o.ApplyT(func(v *Folder) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   396  }
   397  
   398  // AWS account ID.
   399  func (o FolderOutput) AwsAccountId() pulumi.StringOutput {
   400  	return o.ApplyT(func(v *Folder) pulumi.StringOutput { return v.AwsAccountId }).(pulumi.StringOutput)
   401  }
   402  
   403  // The time that the folder was created.
   404  func (o FolderOutput) CreatedTime() pulumi.StringOutput {
   405  	return o.ApplyT(func(v *Folder) pulumi.StringOutput { return v.CreatedTime }).(pulumi.StringOutput)
   406  }
   407  
   408  // Identifier for the folder.
   409  func (o FolderOutput) FolderId() pulumi.StringOutput {
   410  	return o.ApplyT(func(v *Folder) pulumi.StringOutput { return v.FolderId }).(pulumi.StringOutput)
   411  }
   412  
   413  // An array of ancestor ARN strings for the folder. Empty for root-level folders.
   414  func (o FolderOutput) FolderPaths() pulumi.StringArrayOutput {
   415  	return o.ApplyT(func(v *Folder) pulumi.StringArrayOutput { return v.FolderPaths }).(pulumi.StringArrayOutput)
   416  }
   417  
   418  // The type of folder. By default, it is `SHARED`. Valid values are: `SHARED`.
   419  func (o FolderOutput) FolderType() pulumi.StringPtrOutput {
   420  	return o.ApplyT(func(v *Folder) pulumi.StringPtrOutput { return v.FolderType }).(pulumi.StringPtrOutput)
   421  }
   422  
   423  // The time that the folder was last updated.
   424  func (o FolderOutput) LastUpdatedTime() pulumi.StringOutput {
   425  	return o.ApplyT(func(v *Folder) pulumi.StringOutput { return v.LastUpdatedTime }).(pulumi.StringOutput)
   426  }
   427  
   428  // Display name for the folder.
   429  //
   430  // The following arguments are optional:
   431  func (o FolderOutput) Name() pulumi.StringOutput {
   432  	return o.ApplyT(func(v *Folder) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
   433  }
   434  
   435  // The Amazon Resource Name (ARN) for the parent folder. If not set, creates a root-level folder.
   436  func (o FolderOutput) ParentFolderArn() pulumi.StringPtrOutput {
   437  	return o.ApplyT(func(v *Folder) pulumi.StringPtrOutput { return v.ParentFolderArn }).(pulumi.StringPtrOutput)
   438  }
   439  
   440  // A set of resource permissions on the folder. Maximum of 64 items. See permissions.
   441  func (o FolderOutput) Permissions() FolderPermissionArrayOutput {
   442  	return o.ApplyT(func(v *Folder) FolderPermissionArrayOutput { return v.Permissions }).(FolderPermissionArrayOutput)
   443  }
   444  
   445  // 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.
   446  func (o FolderOutput) Tags() pulumi.StringMapOutput {
   447  	return o.ApplyT(func(v *Folder) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   448  }
   449  
   450  // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   451  //
   452  // Deprecated: Please use `tags` instead.
   453  func (o FolderOutput) TagsAll() pulumi.StringMapOutput {
   454  	return o.ApplyT(func(v *Folder) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   455  }
   456  
   457  type FolderArrayOutput struct{ *pulumi.OutputState }
   458  
   459  func (FolderArrayOutput) ElementType() reflect.Type {
   460  	return reflect.TypeOf((*[]*Folder)(nil)).Elem()
   461  }
   462  
   463  func (o FolderArrayOutput) ToFolderArrayOutput() FolderArrayOutput {
   464  	return o
   465  }
   466  
   467  func (o FolderArrayOutput) ToFolderArrayOutputWithContext(ctx context.Context) FolderArrayOutput {
   468  	return o
   469  }
   470  
   471  func (o FolderArrayOutput) Index(i pulumi.IntInput) FolderOutput {
   472  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Folder {
   473  		return vs[0].([]*Folder)[vs[1].(int)]
   474  	}).(FolderOutput)
   475  }
   476  
   477  type FolderMapOutput struct{ *pulumi.OutputState }
   478  
   479  func (FolderMapOutput) ElementType() reflect.Type {
   480  	return reflect.TypeOf((*map[string]*Folder)(nil)).Elem()
   481  }
   482  
   483  func (o FolderMapOutput) ToFolderMapOutput() FolderMapOutput {
   484  	return o
   485  }
   486  
   487  func (o FolderMapOutput) ToFolderMapOutputWithContext(ctx context.Context) FolderMapOutput {
   488  	return o
   489  }
   490  
   491  func (o FolderMapOutput) MapIndex(k pulumi.StringInput) FolderOutput {
   492  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Folder {
   493  		return vs[0].(map[string]*Folder)[vs[1].(string)]
   494  	}).(FolderOutput)
   495  }
   496  
   497  func init() {
   498  	pulumi.RegisterInputType(reflect.TypeOf((*FolderInput)(nil)).Elem(), &Folder{})
   499  	pulumi.RegisterInputType(reflect.TypeOf((*FolderArrayInput)(nil)).Elem(), FolderArray{})
   500  	pulumi.RegisterInputType(reflect.TypeOf((*FolderMapInput)(nil)).Elem(), FolderMap{})
   501  	pulumi.RegisterOutputType(FolderOutput{})
   502  	pulumi.RegisterOutputType(FolderArrayOutput{})
   503  	pulumi.RegisterOutputType(FolderMapOutput{})
   504  }