github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/quicksight/groupMembership.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 QuickSight Group Membership
    16  //
    17  // ## Example Usage
    18  //
    19  // <!--Start PulumiCodeChooser -->
    20  // ```go
    21  // package main
    22  //
    23  // import (
    24  //
    25  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/quicksight"
    26  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    27  //
    28  // )
    29  //
    30  //	func main() {
    31  //		pulumi.Run(func(ctx *pulumi.Context) error {
    32  //			_, err := quicksight.NewGroupMembership(ctx, "example", &quicksight.GroupMembershipArgs{
    33  //				GroupName:  pulumi.String("all-access-users"),
    34  //				MemberName: pulumi.String("john_smith"),
    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 QuickSight Group membership using the AWS account ID, namespace, group name and member name separated by `/`. For example:
    49  //
    50  // ```sh
    51  // $ pulumi import aws:quicksight/groupMembership:GroupMembership example 123456789123/default/all-access-users/john_smith
    52  // ```
    53  type GroupMembership struct {
    54  	pulumi.CustomResourceState
    55  
    56  	Arn pulumi.StringOutput `pulumi:"arn"`
    57  	// The ID for the AWS account that the group is in. Currently, you use the ID for the AWS account that contains your Amazon QuickSight account.
    58  	AwsAccountId pulumi.StringOutput `pulumi:"awsAccountId"`
    59  	// The name of the group in which the member will be added.
    60  	GroupName pulumi.StringOutput `pulumi:"groupName"`
    61  	// The name of the member to add to the group.
    62  	MemberName pulumi.StringOutput `pulumi:"memberName"`
    63  	// The namespace that you want the user to be a part of. Defaults to `default`.
    64  	Namespace pulumi.StringPtrOutput `pulumi:"namespace"`
    65  }
    66  
    67  // NewGroupMembership registers a new resource with the given unique name, arguments, and options.
    68  func NewGroupMembership(ctx *pulumi.Context,
    69  	name string, args *GroupMembershipArgs, opts ...pulumi.ResourceOption) (*GroupMembership, error) {
    70  	if args == nil {
    71  		return nil, errors.New("missing one or more required arguments")
    72  	}
    73  
    74  	if args.GroupName == nil {
    75  		return nil, errors.New("invalid value for required argument 'GroupName'")
    76  	}
    77  	if args.MemberName == nil {
    78  		return nil, errors.New("invalid value for required argument 'MemberName'")
    79  	}
    80  	opts = internal.PkgResourceDefaultOpts(opts)
    81  	var resource GroupMembership
    82  	err := ctx.RegisterResource("aws:quicksight/groupMembership:GroupMembership", name, args, &resource, opts...)
    83  	if err != nil {
    84  		return nil, err
    85  	}
    86  	return &resource, nil
    87  }
    88  
    89  // GetGroupMembership gets an existing GroupMembership resource's state with the given name, ID, and optional
    90  // state properties that are used to uniquely qualify the lookup (nil if not required).
    91  func GetGroupMembership(ctx *pulumi.Context,
    92  	name string, id pulumi.IDInput, state *GroupMembershipState, opts ...pulumi.ResourceOption) (*GroupMembership, error) {
    93  	var resource GroupMembership
    94  	err := ctx.ReadResource("aws:quicksight/groupMembership:GroupMembership", name, id, state, &resource, opts...)
    95  	if err != nil {
    96  		return nil, err
    97  	}
    98  	return &resource, nil
    99  }
   100  
   101  // Input properties used for looking up and filtering GroupMembership resources.
   102  type groupMembershipState struct {
   103  	Arn *string `pulumi:"arn"`
   104  	// The ID for the AWS account that the group is in. Currently, you use the ID for the AWS account that contains your Amazon QuickSight account.
   105  	AwsAccountId *string `pulumi:"awsAccountId"`
   106  	// The name of the group in which the member will be added.
   107  	GroupName *string `pulumi:"groupName"`
   108  	// The name of the member to add to the group.
   109  	MemberName *string `pulumi:"memberName"`
   110  	// The namespace that you want the user to be a part of. Defaults to `default`.
   111  	Namespace *string `pulumi:"namespace"`
   112  }
   113  
   114  type GroupMembershipState struct {
   115  	Arn pulumi.StringPtrInput
   116  	// The ID for the AWS account that the group is in. Currently, you use the ID for the AWS account that contains your Amazon QuickSight account.
   117  	AwsAccountId pulumi.StringPtrInput
   118  	// The name of the group in which the member will be added.
   119  	GroupName pulumi.StringPtrInput
   120  	// The name of the member to add to the group.
   121  	MemberName pulumi.StringPtrInput
   122  	// The namespace that you want the user to be a part of. Defaults to `default`.
   123  	Namespace pulumi.StringPtrInput
   124  }
   125  
   126  func (GroupMembershipState) ElementType() reflect.Type {
   127  	return reflect.TypeOf((*groupMembershipState)(nil)).Elem()
   128  }
   129  
   130  type groupMembershipArgs struct {
   131  	// The ID for the AWS account that the group is in. Currently, you use the ID for the AWS account that contains your Amazon QuickSight account.
   132  	AwsAccountId *string `pulumi:"awsAccountId"`
   133  	// The name of the group in which the member will be added.
   134  	GroupName string `pulumi:"groupName"`
   135  	// The name of the member to add to the group.
   136  	MemberName string `pulumi:"memberName"`
   137  	// The namespace that you want the user to be a part of. Defaults to `default`.
   138  	Namespace *string `pulumi:"namespace"`
   139  }
   140  
   141  // The set of arguments for constructing a GroupMembership resource.
   142  type GroupMembershipArgs struct {
   143  	// The ID for the AWS account that the group is in. Currently, you use the ID for the AWS account that contains your Amazon QuickSight account.
   144  	AwsAccountId pulumi.StringPtrInput
   145  	// The name of the group in which the member will be added.
   146  	GroupName pulumi.StringInput
   147  	// The name of the member to add to the group.
   148  	MemberName pulumi.StringInput
   149  	// The namespace that you want the user to be a part of. Defaults to `default`.
   150  	Namespace pulumi.StringPtrInput
   151  }
   152  
   153  func (GroupMembershipArgs) ElementType() reflect.Type {
   154  	return reflect.TypeOf((*groupMembershipArgs)(nil)).Elem()
   155  }
   156  
   157  type GroupMembershipInput interface {
   158  	pulumi.Input
   159  
   160  	ToGroupMembershipOutput() GroupMembershipOutput
   161  	ToGroupMembershipOutputWithContext(ctx context.Context) GroupMembershipOutput
   162  }
   163  
   164  func (*GroupMembership) ElementType() reflect.Type {
   165  	return reflect.TypeOf((**GroupMembership)(nil)).Elem()
   166  }
   167  
   168  func (i *GroupMembership) ToGroupMembershipOutput() GroupMembershipOutput {
   169  	return i.ToGroupMembershipOutputWithContext(context.Background())
   170  }
   171  
   172  func (i *GroupMembership) ToGroupMembershipOutputWithContext(ctx context.Context) GroupMembershipOutput {
   173  	return pulumi.ToOutputWithContext(ctx, i).(GroupMembershipOutput)
   174  }
   175  
   176  // GroupMembershipArrayInput is an input type that accepts GroupMembershipArray and GroupMembershipArrayOutput values.
   177  // You can construct a concrete instance of `GroupMembershipArrayInput` via:
   178  //
   179  //	GroupMembershipArray{ GroupMembershipArgs{...} }
   180  type GroupMembershipArrayInput interface {
   181  	pulumi.Input
   182  
   183  	ToGroupMembershipArrayOutput() GroupMembershipArrayOutput
   184  	ToGroupMembershipArrayOutputWithContext(context.Context) GroupMembershipArrayOutput
   185  }
   186  
   187  type GroupMembershipArray []GroupMembershipInput
   188  
   189  func (GroupMembershipArray) ElementType() reflect.Type {
   190  	return reflect.TypeOf((*[]*GroupMembership)(nil)).Elem()
   191  }
   192  
   193  func (i GroupMembershipArray) ToGroupMembershipArrayOutput() GroupMembershipArrayOutput {
   194  	return i.ToGroupMembershipArrayOutputWithContext(context.Background())
   195  }
   196  
   197  func (i GroupMembershipArray) ToGroupMembershipArrayOutputWithContext(ctx context.Context) GroupMembershipArrayOutput {
   198  	return pulumi.ToOutputWithContext(ctx, i).(GroupMembershipArrayOutput)
   199  }
   200  
   201  // GroupMembershipMapInput is an input type that accepts GroupMembershipMap and GroupMembershipMapOutput values.
   202  // You can construct a concrete instance of `GroupMembershipMapInput` via:
   203  //
   204  //	GroupMembershipMap{ "key": GroupMembershipArgs{...} }
   205  type GroupMembershipMapInput interface {
   206  	pulumi.Input
   207  
   208  	ToGroupMembershipMapOutput() GroupMembershipMapOutput
   209  	ToGroupMembershipMapOutputWithContext(context.Context) GroupMembershipMapOutput
   210  }
   211  
   212  type GroupMembershipMap map[string]GroupMembershipInput
   213  
   214  func (GroupMembershipMap) ElementType() reflect.Type {
   215  	return reflect.TypeOf((*map[string]*GroupMembership)(nil)).Elem()
   216  }
   217  
   218  func (i GroupMembershipMap) ToGroupMembershipMapOutput() GroupMembershipMapOutput {
   219  	return i.ToGroupMembershipMapOutputWithContext(context.Background())
   220  }
   221  
   222  func (i GroupMembershipMap) ToGroupMembershipMapOutputWithContext(ctx context.Context) GroupMembershipMapOutput {
   223  	return pulumi.ToOutputWithContext(ctx, i).(GroupMembershipMapOutput)
   224  }
   225  
   226  type GroupMembershipOutput struct{ *pulumi.OutputState }
   227  
   228  func (GroupMembershipOutput) ElementType() reflect.Type {
   229  	return reflect.TypeOf((**GroupMembership)(nil)).Elem()
   230  }
   231  
   232  func (o GroupMembershipOutput) ToGroupMembershipOutput() GroupMembershipOutput {
   233  	return o
   234  }
   235  
   236  func (o GroupMembershipOutput) ToGroupMembershipOutputWithContext(ctx context.Context) GroupMembershipOutput {
   237  	return o
   238  }
   239  
   240  func (o GroupMembershipOutput) Arn() pulumi.StringOutput {
   241  	return o.ApplyT(func(v *GroupMembership) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   242  }
   243  
   244  // The ID for the AWS account that the group is in. Currently, you use the ID for the AWS account that contains your Amazon QuickSight account.
   245  func (o GroupMembershipOutput) AwsAccountId() pulumi.StringOutput {
   246  	return o.ApplyT(func(v *GroupMembership) pulumi.StringOutput { return v.AwsAccountId }).(pulumi.StringOutput)
   247  }
   248  
   249  // The name of the group in which the member will be added.
   250  func (o GroupMembershipOutput) GroupName() pulumi.StringOutput {
   251  	return o.ApplyT(func(v *GroupMembership) pulumi.StringOutput { return v.GroupName }).(pulumi.StringOutput)
   252  }
   253  
   254  // The name of the member to add to the group.
   255  func (o GroupMembershipOutput) MemberName() pulumi.StringOutput {
   256  	return o.ApplyT(func(v *GroupMembership) pulumi.StringOutput { return v.MemberName }).(pulumi.StringOutput)
   257  }
   258  
   259  // The namespace that you want the user to be a part of. Defaults to `default`.
   260  func (o GroupMembershipOutput) Namespace() pulumi.StringPtrOutput {
   261  	return o.ApplyT(func(v *GroupMembership) pulumi.StringPtrOutput { return v.Namespace }).(pulumi.StringPtrOutput)
   262  }
   263  
   264  type GroupMembershipArrayOutput struct{ *pulumi.OutputState }
   265  
   266  func (GroupMembershipArrayOutput) ElementType() reflect.Type {
   267  	return reflect.TypeOf((*[]*GroupMembership)(nil)).Elem()
   268  }
   269  
   270  func (o GroupMembershipArrayOutput) ToGroupMembershipArrayOutput() GroupMembershipArrayOutput {
   271  	return o
   272  }
   273  
   274  func (o GroupMembershipArrayOutput) ToGroupMembershipArrayOutputWithContext(ctx context.Context) GroupMembershipArrayOutput {
   275  	return o
   276  }
   277  
   278  func (o GroupMembershipArrayOutput) Index(i pulumi.IntInput) GroupMembershipOutput {
   279  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *GroupMembership {
   280  		return vs[0].([]*GroupMembership)[vs[1].(int)]
   281  	}).(GroupMembershipOutput)
   282  }
   283  
   284  type GroupMembershipMapOutput struct{ *pulumi.OutputState }
   285  
   286  func (GroupMembershipMapOutput) ElementType() reflect.Type {
   287  	return reflect.TypeOf((*map[string]*GroupMembership)(nil)).Elem()
   288  }
   289  
   290  func (o GroupMembershipMapOutput) ToGroupMembershipMapOutput() GroupMembershipMapOutput {
   291  	return o
   292  }
   293  
   294  func (o GroupMembershipMapOutput) ToGroupMembershipMapOutputWithContext(ctx context.Context) GroupMembershipMapOutput {
   295  	return o
   296  }
   297  
   298  func (o GroupMembershipMapOutput) MapIndex(k pulumi.StringInput) GroupMembershipOutput {
   299  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *GroupMembership {
   300  		return vs[0].(map[string]*GroupMembership)[vs[1].(string)]
   301  	}).(GroupMembershipOutput)
   302  }
   303  
   304  func init() {
   305  	pulumi.RegisterInputType(reflect.TypeOf((*GroupMembershipInput)(nil)).Elem(), &GroupMembership{})
   306  	pulumi.RegisterInputType(reflect.TypeOf((*GroupMembershipArrayInput)(nil)).Elem(), GroupMembershipArray{})
   307  	pulumi.RegisterInputType(reflect.TypeOf((*GroupMembershipMapInput)(nil)).Elem(), GroupMembershipMap{})
   308  	pulumi.RegisterOutputType(GroupMembershipOutput{})
   309  	pulumi.RegisterOutputType(GroupMembershipArrayOutput{})
   310  	pulumi.RegisterOutputType(GroupMembershipMapOutput{})
   311  }