github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/quicksight/folderMembership.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 Folder Membership.
    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.NewFolderMembership(ctx, "example", &quicksight.FolderMembershipArgs{
    35  //				FolderId:   pulumi.Any(exampleAwsQuicksightFolder.FolderId),
    36  //				MemberType: pulumi.String("DATASET"),
    37  //				MemberId:   pulumi.Any(exampleAwsQuicksightDataSet.DataSetId),
    38  //			})
    39  //			if err != nil {
    40  //				return err
    41  //			}
    42  //			return nil
    43  //		})
    44  //	}
    45  //
    46  // ```
    47  // <!--End PulumiCodeChooser -->
    48  //
    49  // ## Import
    50  //
    51  // Using `pulumi import`, import QuickSight Folder Membership using the AWS account ID, folder ID, member type, and member ID separated by commas (`,`). For example:
    52  //
    53  // ```sh
    54  // $ pulumi import aws:quicksight/folderMembership:FolderMembership example 123456789012,example-folder,DATASET,example-dataset
    55  // ```
    56  type FolderMembership struct {
    57  	pulumi.CustomResourceState
    58  
    59  	// AWS account ID.
    60  	AwsAccountId pulumi.StringOutput `pulumi:"awsAccountId"`
    61  	// Identifier for the folder.
    62  	FolderId pulumi.StringOutput `pulumi:"folderId"`
    63  	// ID of the asset (the dashboard, analysis, or dataset).
    64  	MemberId pulumi.StringOutput `pulumi:"memberId"`
    65  	// Type of the member. Valid values are `ANALYSIS`, `DASHBOARD`, and `DATASET`.
    66  	//
    67  	// The following arguments are optional:
    68  	MemberType pulumi.StringOutput `pulumi:"memberType"`
    69  }
    70  
    71  // NewFolderMembership registers a new resource with the given unique name, arguments, and options.
    72  func NewFolderMembership(ctx *pulumi.Context,
    73  	name string, args *FolderMembershipArgs, opts ...pulumi.ResourceOption) (*FolderMembership, error) {
    74  	if args == nil {
    75  		return nil, errors.New("missing one or more required arguments")
    76  	}
    77  
    78  	if args.FolderId == nil {
    79  		return nil, errors.New("invalid value for required argument 'FolderId'")
    80  	}
    81  	if args.MemberId == nil {
    82  		return nil, errors.New("invalid value for required argument 'MemberId'")
    83  	}
    84  	if args.MemberType == nil {
    85  		return nil, errors.New("invalid value for required argument 'MemberType'")
    86  	}
    87  	opts = internal.PkgResourceDefaultOpts(opts)
    88  	var resource FolderMembership
    89  	err := ctx.RegisterResource("aws:quicksight/folderMembership:FolderMembership", name, args, &resource, opts...)
    90  	if err != nil {
    91  		return nil, err
    92  	}
    93  	return &resource, nil
    94  }
    95  
    96  // GetFolderMembership gets an existing FolderMembership resource's state with the given name, ID, and optional
    97  // state properties that are used to uniquely qualify the lookup (nil if not required).
    98  func GetFolderMembership(ctx *pulumi.Context,
    99  	name string, id pulumi.IDInput, state *FolderMembershipState, opts ...pulumi.ResourceOption) (*FolderMembership, error) {
   100  	var resource FolderMembership
   101  	err := ctx.ReadResource("aws:quicksight/folderMembership:FolderMembership", name, id, state, &resource, opts...)
   102  	if err != nil {
   103  		return nil, err
   104  	}
   105  	return &resource, nil
   106  }
   107  
   108  // Input properties used for looking up and filtering FolderMembership resources.
   109  type folderMembershipState struct {
   110  	// AWS account ID.
   111  	AwsAccountId *string `pulumi:"awsAccountId"`
   112  	// Identifier for the folder.
   113  	FolderId *string `pulumi:"folderId"`
   114  	// ID of the asset (the dashboard, analysis, or dataset).
   115  	MemberId *string `pulumi:"memberId"`
   116  	// Type of the member. Valid values are `ANALYSIS`, `DASHBOARD`, and `DATASET`.
   117  	//
   118  	// The following arguments are optional:
   119  	MemberType *string `pulumi:"memberType"`
   120  }
   121  
   122  type FolderMembershipState struct {
   123  	// AWS account ID.
   124  	AwsAccountId pulumi.StringPtrInput
   125  	// Identifier for the folder.
   126  	FolderId pulumi.StringPtrInput
   127  	// ID of the asset (the dashboard, analysis, or dataset).
   128  	MemberId pulumi.StringPtrInput
   129  	// Type of the member. Valid values are `ANALYSIS`, `DASHBOARD`, and `DATASET`.
   130  	//
   131  	// The following arguments are optional:
   132  	MemberType pulumi.StringPtrInput
   133  }
   134  
   135  func (FolderMembershipState) ElementType() reflect.Type {
   136  	return reflect.TypeOf((*folderMembershipState)(nil)).Elem()
   137  }
   138  
   139  type folderMembershipArgs struct {
   140  	// AWS account ID.
   141  	AwsAccountId *string `pulumi:"awsAccountId"`
   142  	// Identifier for the folder.
   143  	FolderId string `pulumi:"folderId"`
   144  	// ID of the asset (the dashboard, analysis, or dataset).
   145  	MemberId string `pulumi:"memberId"`
   146  	// Type of the member. Valid values are `ANALYSIS`, `DASHBOARD`, and `DATASET`.
   147  	//
   148  	// The following arguments are optional:
   149  	MemberType string `pulumi:"memberType"`
   150  }
   151  
   152  // The set of arguments for constructing a FolderMembership resource.
   153  type FolderMembershipArgs struct {
   154  	// AWS account ID.
   155  	AwsAccountId pulumi.StringPtrInput
   156  	// Identifier for the folder.
   157  	FolderId pulumi.StringInput
   158  	// ID of the asset (the dashboard, analysis, or dataset).
   159  	MemberId pulumi.StringInput
   160  	// Type of the member. Valid values are `ANALYSIS`, `DASHBOARD`, and `DATASET`.
   161  	//
   162  	// The following arguments are optional:
   163  	MemberType pulumi.StringInput
   164  }
   165  
   166  func (FolderMembershipArgs) ElementType() reflect.Type {
   167  	return reflect.TypeOf((*folderMembershipArgs)(nil)).Elem()
   168  }
   169  
   170  type FolderMembershipInput interface {
   171  	pulumi.Input
   172  
   173  	ToFolderMembershipOutput() FolderMembershipOutput
   174  	ToFolderMembershipOutputWithContext(ctx context.Context) FolderMembershipOutput
   175  }
   176  
   177  func (*FolderMembership) ElementType() reflect.Type {
   178  	return reflect.TypeOf((**FolderMembership)(nil)).Elem()
   179  }
   180  
   181  func (i *FolderMembership) ToFolderMembershipOutput() FolderMembershipOutput {
   182  	return i.ToFolderMembershipOutputWithContext(context.Background())
   183  }
   184  
   185  func (i *FolderMembership) ToFolderMembershipOutputWithContext(ctx context.Context) FolderMembershipOutput {
   186  	return pulumi.ToOutputWithContext(ctx, i).(FolderMembershipOutput)
   187  }
   188  
   189  // FolderMembershipArrayInput is an input type that accepts FolderMembershipArray and FolderMembershipArrayOutput values.
   190  // You can construct a concrete instance of `FolderMembershipArrayInput` via:
   191  //
   192  //	FolderMembershipArray{ FolderMembershipArgs{...} }
   193  type FolderMembershipArrayInput interface {
   194  	pulumi.Input
   195  
   196  	ToFolderMembershipArrayOutput() FolderMembershipArrayOutput
   197  	ToFolderMembershipArrayOutputWithContext(context.Context) FolderMembershipArrayOutput
   198  }
   199  
   200  type FolderMembershipArray []FolderMembershipInput
   201  
   202  func (FolderMembershipArray) ElementType() reflect.Type {
   203  	return reflect.TypeOf((*[]*FolderMembership)(nil)).Elem()
   204  }
   205  
   206  func (i FolderMembershipArray) ToFolderMembershipArrayOutput() FolderMembershipArrayOutput {
   207  	return i.ToFolderMembershipArrayOutputWithContext(context.Background())
   208  }
   209  
   210  func (i FolderMembershipArray) ToFolderMembershipArrayOutputWithContext(ctx context.Context) FolderMembershipArrayOutput {
   211  	return pulumi.ToOutputWithContext(ctx, i).(FolderMembershipArrayOutput)
   212  }
   213  
   214  // FolderMembershipMapInput is an input type that accepts FolderMembershipMap and FolderMembershipMapOutput values.
   215  // You can construct a concrete instance of `FolderMembershipMapInput` via:
   216  //
   217  //	FolderMembershipMap{ "key": FolderMembershipArgs{...} }
   218  type FolderMembershipMapInput interface {
   219  	pulumi.Input
   220  
   221  	ToFolderMembershipMapOutput() FolderMembershipMapOutput
   222  	ToFolderMembershipMapOutputWithContext(context.Context) FolderMembershipMapOutput
   223  }
   224  
   225  type FolderMembershipMap map[string]FolderMembershipInput
   226  
   227  func (FolderMembershipMap) ElementType() reflect.Type {
   228  	return reflect.TypeOf((*map[string]*FolderMembership)(nil)).Elem()
   229  }
   230  
   231  func (i FolderMembershipMap) ToFolderMembershipMapOutput() FolderMembershipMapOutput {
   232  	return i.ToFolderMembershipMapOutputWithContext(context.Background())
   233  }
   234  
   235  func (i FolderMembershipMap) ToFolderMembershipMapOutputWithContext(ctx context.Context) FolderMembershipMapOutput {
   236  	return pulumi.ToOutputWithContext(ctx, i).(FolderMembershipMapOutput)
   237  }
   238  
   239  type FolderMembershipOutput struct{ *pulumi.OutputState }
   240  
   241  func (FolderMembershipOutput) ElementType() reflect.Type {
   242  	return reflect.TypeOf((**FolderMembership)(nil)).Elem()
   243  }
   244  
   245  func (o FolderMembershipOutput) ToFolderMembershipOutput() FolderMembershipOutput {
   246  	return o
   247  }
   248  
   249  func (o FolderMembershipOutput) ToFolderMembershipOutputWithContext(ctx context.Context) FolderMembershipOutput {
   250  	return o
   251  }
   252  
   253  // AWS account ID.
   254  func (o FolderMembershipOutput) AwsAccountId() pulumi.StringOutput {
   255  	return o.ApplyT(func(v *FolderMembership) pulumi.StringOutput { return v.AwsAccountId }).(pulumi.StringOutput)
   256  }
   257  
   258  // Identifier for the folder.
   259  func (o FolderMembershipOutput) FolderId() pulumi.StringOutput {
   260  	return o.ApplyT(func(v *FolderMembership) pulumi.StringOutput { return v.FolderId }).(pulumi.StringOutput)
   261  }
   262  
   263  // ID of the asset (the dashboard, analysis, or dataset).
   264  func (o FolderMembershipOutput) MemberId() pulumi.StringOutput {
   265  	return o.ApplyT(func(v *FolderMembership) pulumi.StringOutput { return v.MemberId }).(pulumi.StringOutput)
   266  }
   267  
   268  // Type of the member. Valid values are `ANALYSIS`, `DASHBOARD`, and `DATASET`.
   269  //
   270  // The following arguments are optional:
   271  func (o FolderMembershipOutput) MemberType() pulumi.StringOutput {
   272  	return o.ApplyT(func(v *FolderMembership) pulumi.StringOutput { return v.MemberType }).(pulumi.StringOutput)
   273  }
   274  
   275  type FolderMembershipArrayOutput struct{ *pulumi.OutputState }
   276  
   277  func (FolderMembershipArrayOutput) ElementType() reflect.Type {
   278  	return reflect.TypeOf((*[]*FolderMembership)(nil)).Elem()
   279  }
   280  
   281  func (o FolderMembershipArrayOutput) ToFolderMembershipArrayOutput() FolderMembershipArrayOutput {
   282  	return o
   283  }
   284  
   285  func (o FolderMembershipArrayOutput) ToFolderMembershipArrayOutputWithContext(ctx context.Context) FolderMembershipArrayOutput {
   286  	return o
   287  }
   288  
   289  func (o FolderMembershipArrayOutput) Index(i pulumi.IntInput) FolderMembershipOutput {
   290  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *FolderMembership {
   291  		return vs[0].([]*FolderMembership)[vs[1].(int)]
   292  	}).(FolderMembershipOutput)
   293  }
   294  
   295  type FolderMembershipMapOutput struct{ *pulumi.OutputState }
   296  
   297  func (FolderMembershipMapOutput) ElementType() reflect.Type {
   298  	return reflect.TypeOf((*map[string]*FolderMembership)(nil)).Elem()
   299  }
   300  
   301  func (o FolderMembershipMapOutput) ToFolderMembershipMapOutput() FolderMembershipMapOutput {
   302  	return o
   303  }
   304  
   305  func (o FolderMembershipMapOutput) ToFolderMembershipMapOutputWithContext(ctx context.Context) FolderMembershipMapOutput {
   306  	return o
   307  }
   308  
   309  func (o FolderMembershipMapOutput) MapIndex(k pulumi.StringInput) FolderMembershipOutput {
   310  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *FolderMembership {
   311  		return vs[0].(map[string]*FolderMembership)[vs[1].(string)]
   312  	}).(FolderMembershipOutput)
   313  }
   314  
   315  func init() {
   316  	pulumi.RegisterInputType(reflect.TypeOf((*FolderMembershipInput)(nil)).Elem(), &FolderMembership{})
   317  	pulumi.RegisterInputType(reflect.TypeOf((*FolderMembershipArrayInput)(nil)).Elem(), FolderMembershipArray{})
   318  	pulumi.RegisterInputType(reflect.TypeOf((*FolderMembershipMapInput)(nil)).Elem(), FolderMembershipMap{})
   319  	pulumi.RegisterOutputType(FolderMembershipOutput{})
   320  	pulumi.RegisterOutputType(FolderMembershipArrayOutput{})
   321  	pulumi.RegisterOutputType(FolderMembershipMapOutput{})
   322  }