github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/connect/userHierarchyGroup.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 connect
     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  // Provides an Amazon Connect User Hierarchy Group resource. For more information see
    16  // [Amazon Connect: Getting Started](https://docs.aws.amazon.com/connect/latest/adminguide/amazon-connect-get-started.html)
    17  //
    18  // > **NOTE:** The User Hierarchy Structure must be created before creating a User Hierarchy Group.
    19  //
    20  // ## Example Usage
    21  //
    22  // ### Basic
    23  //
    24  // <!--Start PulumiCodeChooser -->
    25  // ```go
    26  // package main
    27  //
    28  // import (
    29  //
    30  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/connect"
    31  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    32  //
    33  // )
    34  //
    35  //	func main() {
    36  //		pulumi.Run(func(ctx *pulumi.Context) error {
    37  //			_, err := connect.NewUserHierarchyGroup(ctx, "example", &connect.UserHierarchyGroupArgs{
    38  //				InstanceId: pulumi.String("aaaaaaaa-bbbb-cccc-dddd-111111111111"),
    39  //				Name:       pulumi.String("example"),
    40  //				Tags: pulumi.StringMap{
    41  //					"Name": pulumi.String("Example User Hierarchy Group"),
    42  //				},
    43  //			})
    44  //			if err != nil {
    45  //				return err
    46  //			}
    47  //			return nil
    48  //		})
    49  //	}
    50  //
    51  // ```
    52  // <!--End PulumiCodeChooser -->
    53  //
    54  // ### With a parent group
    55  //
    56  // <!--Start PulumiCodeChooser -->
    57  // ```go
    58  // package main
    59  //
    60  // import (
    61  //
    62  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/connect"
    63  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    64  //
    65  // )
    66  //
    67  //	func main() {
    68  //		pulumi.Run(func(ctx *pulumi.Context) error {
    69  //			parent, err := connect.NewUserHierarchyGroup(ctx, "parent", &connect.UserHierarchyGroupArgs{
    70  //				InstanceId: pulumi.String("aaaaaaaa-bbbb-cccc-dddd-111111111111"),
    71  //				Name:       pulumi.String("parent"),
    72  //				Tags: pulumi.StringMap{
    73  //					"Name": pulumi.String("Example User Hierarchy Group Parent"),
    74  //				},
    75  //			})
    76  //			if err != nil {
    77  //				return err
    78  //			}
    79  //			_, err = connect.NewUserHierarchyGroup(ctx, "child", &connect.UserHierarchyGroupArgs{
    80  //				InstanceId:    pulumi.String("aaaaaaaa-bbbb-cccc-dddd-111111111111"),
    81  //				Name:          pulumi.String("child"),
    82  //				ParentGroupId: parent.HierarchyGroupId,
    83  //				Tags: pulumi.StringMap{
    84  //					"Name": pulumi.String("Example User Hierarchy Group Child"),
    85  //				},
    86  //			})
    87  //			if err != nil {
    88  //				return err
    89  //			}
    90  //			return nil
    91  //		})
    92  //	}
    93  //
    94  // ```
    95  // <!--End PulumiCodeChooser -->
    96  //
    97  // ## Import
    98  //
    99  // Using `pulumi import`, import Amazon Connect User Hierarchy Groups using the `instance_id` and `hierarchy_group_id` separated by a colon (`:`). For example:
   100  //
   101  // ```sh
   102  // $ pulumi import aws:connect/userHierarchyGroup:UserHierarchyGroup example f1288a1f-6193-445a-b47e-af739b2:c1d4e5f6-1b3c-1b3c-1b3c-c1d4e5f6c1d4e5
   103  // ```
   104  type UserHierarchyGroup struct {
   105  	pulumi.CustomResourceState
   106  
   107  	// The Amazon Resource Name (ARN) of the hierarchy group.
   108  	Arn pulumi.StringOutput `pulumi:"arn"`
   109  	// The identifier for the hierarchy group.
   110  	HierarchyGroupId pulumi.StringOutput `pulumi:"hierarchyGroupId"`
   111  	// A block that contains information about the levels in the hierarchy group. The `hierarchyPath` block is documented below.
   112  	HierarchyPaths UserHierarchyGroupHierarchyPathArrayOutput `pulumi:"hierarchyPaths"`
   113  	// Specifies the identifier of the hosting Amazon Connect Instance.
   114  	InstanceId pulumi.StringOutput `pulumi:"instanceId"`
   115  	// The identifier of the level in the hierarchy group.
   116  	LevelId pulumi.StringOutput `pulumi:"levelId"`
   117  	// The name of the user hierarchy group. Must not be more than 100 characters.
   118  	Name pulumi.StringOutput `pulumi:"name"`
   119  	// The identifier for the parent hierarchy group. The user hierarchy is created at level one if the parent group ID is null.
   120  	ParentGroupId pulumi.StringPtrOutput `pulumi:"parentGroupId"`
   121  	// Tags to apply to the hierarchy group. If configured with a provider
   122  	// `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   123  	Tags pulumi.StringMapOutput `pulumi:"tags"`
   124  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   125  	//
   126  	// Deprecated: Please use `tags` instead.
   127  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
   128  }
   129  
   130  // NewUserHierarchyGroup registers a new resource with the given unique name, arguments, and options.
   131  func NewUserHierarchyGroup(ctx *pulumi.Context,
   132  	name string, args *UserHierarchyGroupArgs, opts ...pulumi.ResourceOption) (*UserHierarchyGroup, error) {
   133  	if args == nil {
   134  		return nil, errors.New("missing one or more required arguments")
   135  	}
   136  
   137  	if args.InstanceId == nil {
   138  		return nil, errors.New("invalid value for required argument 'InstanceId'")
   139  	}
   140  	opts = internal.PkgResourceDefaultOpts(opts)
   141  	var resource UserHierarchyGroup
   142  	err := ctx.RegisterResource("aws:connect/userHierarchyGroup:UserHierarchyGroup", name, args, &resource, opts...)
   143  	if err != nil {
   144  		return nil, err
   145  	}
   146  	return &resource, nil
   147  }
   148  
   149  // GetUserHierarchyGroup gets an existing UserHierarchyGroup resource's state with the given name, ID, and optional
   150  // state properties that are used to uniquely qualify the lookup (nil if not required).
   151  func GetUserHierarchyGroup(ctx *pulumi.Context,
   152  	name string, id pulumi.IDInput, state *UserHierarchyGroupState, opts ...pulumi.ResourceOption) (*UserHierarchyGroup, error) {
   153  	var resource UserHierarchyGroup
   154  	err := ctx.ReadResource("aws:connect/userHierarchyGroup:UserHierarchyGroup", name, id, state, &resource, opts...)
   155  	if err != nil {
   156  		return nil, err
   157  	}
   158  	return &resource, nil
   159  }
   160  
   161  // Input properties used for looking up and filtering UserHierarchyGroup resources.
   162  type userHierarchyGroupState struct {
   163  	// The Amazon Resource Name (ARN) of the hierarchy group.
   164  	Arn *string `pulumi:"arn"`
   165  	// The identifier for the hierarchy group.
   166  	HierarchyGroupId *string `pulumi:"hierarchyGroupId"`
   167  	// A block that contains information about the levels in the hierarchy group. The `hierarchyPath` block is documented below.
   168  	HierarchyPaths []UserHierarchyGroupHierarchyPath `pulumi:"hierarchyPaths"`
   169  	// Specifies the identifier of the hosting Amazon Connect Instance.
   170  	InstanceId *string `pulumi:"instanceId"`
   171  	// The identifier of the level in the hierarchy group.
   172  	LevelId *string `pulumi:"levelId"`
   173  	// The name of the user hierarchy group. Must not be more than 100 characters.
   174  	Name *string `pulumi:"name"`
   175  	// The identifier for the parent hierarchy group. The user hierarchy is created at level one if the parent group ID is null.
   176  	ParentGroupId *string `pulumi:"parentGroupId"`
   177  	// Tags to apply to the hierarchy group. If configured with a provider
   178  	// `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   179  	Tags map[string]string `pulumi:"tags"`
   180  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   181  	//
   182  	// Deprecated: Please use `tags` instead.
   183  	TagsAll map[string]string `pulumi:"tagsAll"`
   184  }
   185  
   186  type UserHierarchyGroupState struct {
   187  	// The Amazon Resource Name (ARN) of the hierarchy group.
   188  	Arn pulumi.StringPtrInput
   189  	// The identifier for the hierarchy group.
   190  	HierarchyGroupId pulumi.StringPtrInput
   191  	// A block that contains information about the levels in the hierarchy group. The `hierarchyPath` block is documented below.
   192  	HierarchyPaths UserHierarchyGroupHierarchyPathArrayInput
   193  	// Specifies the identifier of the hosting Amazon Connect Instance.
   194  	InstanceId pulumi.StringPtrInput
   195  	// The identifier of the level in the hierarchy group.
   196  	LevelId pulumi.StringPtrInput
   197  	// The name of the user hierarchy group. Must not be more than 100 characters.
   198  	Name pulumi.StringPtrInput
   199  	// The identifier for the parent hierarchy group. The user hierarchy is created at level one if the parent group ID is null.
   200  	ParentGroupId pulumi.StringPtrInput
   201  	// Tags to apply to the hierarchy group. If configured with a provider
   202  	// `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   203  	Tags pulumi.StringMapInput
   204  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   205  	//
   206  	// Deprecated: Please use `tags` instead.
   207  	TagsAll pulumi.StringMapInput
   208  }
   209  
   210  func (UserHierarchyGroupState) ElementType() reflect.Type {
   211  	return reflect.TypeOf((*userHierarchyGroupState)(nil)).Elem()
   212  }
   213  
   214  type userHierarchyGroupArgs struct {
   215  	// Specifies the identifier of the hosting Amazon Connect Instance.
   216  	InstanceId string `pulumi:"instanceId"`
   217  	// The name of the user hierarchy group. Must not be more than 100 characters.
   218  	Name *string `pulumi:"name"`
   219  	// The identifier for the parent hierarchy group. The user hierarchy is created at level one if the parent group ID is null.
   220  	ParentGroupId *string `pulumi:"parentGroupId"`
   221  	// Tags to apply to the hierarchy group. If configured with a provider
   222  	// `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   223  	Tags map[string]string `pulumi:"tags"`
   224  }
   225  
   226  // The set of arguments for constructing a UserHierarchyGroup resource.
   227  type UserHierarchyGroupArgs struct {
   228  	// Specifies the identifier of the hosting Amazon Connect Instance.
   229  	InstanceId pulumi.StringInput
   230  	// The name of the user hierarchy group. Must not be more than 100 characters.
   231  	Name pulumi.StringPtrInput
   232  	// The identifier for the parent hierarchy group. The user hierarchy is created at level one if the parent group ID is null.
   233  	ParentGroupId pulumi.StringPtrInput
   234  	// Tags to apply to the hierarchy group. If configured with a provider
   235  	// `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   236  	Tags pulumi.StringMapInput
   237  }
   238  
   239  func (UserHierarchyGroupArgs) ElementType() reflect.Type {
   240  	return reflect.TypeOf((*userHierarchyGroupArgs)(nil)).Elem()
   241  }
   242  
   243  type UserHierarchyGroupInput interface {
   244  	pulumi.Input
   245  
   246  	ToUserHierarchyGroupOutput() UserHierarchyGroupOutput
   247  	ToUserHierarchyGroupOutputWithContext(ctx context.Context) UserHierarchyGroupOutput
   248  }
   249  
   250  func (*UserHierarchyGroup) ElementType() reflect.Type {
   251  	return reflect.TypeOf((**UserHierarchyGroup)(nil)).Elem()
   252  }
   253  
   254  func (i *UserHierarchyGroup) ToUserHierarchyGroupOutput() UserHierarchyGroupOutput {
   255  	return i.ToUserHierarchyGroupOutputWithContext(context.Background())
   256  }
   257  
   258  func (i *UserHierarchyGroup) ToUserHierarchyGroupOutputWithContext(ctx context.Context) UserHierarchyGroupOutput {
   259  	return pulumi.ToOutputWithContext(ctx, i).(UserHierarchyGroupOutput)
   260  }
   261  
   262  // UserHierarchyGroupArrayInput is an input type that accepts UserHierarchyGroupArray and UserHierarchyGroupArrayOutput values.
   263  // You can construct a concrete instance of `UserHierarchyGroupArrayInput` via:
   264  //
   265  //	UserHierarchyGroupArray{ UserHierarchyGroupArgs{...} }
   266  type UserHierarchyGroupArrayInput interface {
   267  	pulumi.Input
   268  
   269  	ToUserHierarchyGroupArrayOutput() UserHierarchyGroupArrayOutput
   270  	ToUserHierarchyGroupArrayOutputWithContext(context.Context) UserHierarchyGroupArrayOutput
   271  }
   272  
   273  type UserHierarchyGroupArray []UserHierarchyGroupInput
   274  
   275  func (UserHierarchyGroupArray) ElementType() reflect.Type {
   276  	return reflect.TypeOf((*[]*UserHierarchyGroup)(nil)).Elem()
   277  }
   278  
   279  func (i UserHierarchyGroupArray) ToUserHierarchyGroupArrayOutput() UserHierarchyGroupArrayOutput {
   280  	return i.ToUserHierarchyGroupArrayOutputWithContext(context.Background())
   281  }
   282  
   283  func (i UserHierarchyGroupArray) ToUserHierarchyGroupArrayOutputWithContext(ctx context.Context) UserHierarchyGroupArrayOutput {
   284  	return pulumi.ToOutputWithContext(ctx, i).(UserHierarchyGroupArrayOutput)
   285  }
   286  
   287  // UserHierarchyGroupMapInput is an input type that accepts UserHierarchyGroupMap and UserHierarchyGroupMapOutput values.
   288  // You can construct a concrete instance of `UserHierarchyGroupMapInput` via:
   289  //
   290  //	UserHierarchyGroupMap{ "key": UserHierarchyGroupArgs{...} }
   291  type UserHierarchyGroupMapInput interface {
   292  	pulumi.Input
   293  
   294  	ToUserHierarchyGroupMapOutput() UserHierarchyGroupMapOutput
   295  	ToUserHierarchyGroupMapOutputWithContext(context.Context) UserHierarchyGroupMapOutput
   296  }
   297  
   298  type UserHierarchyGroupMap map[string]UserHierarchyGroupInput
   299  
   300  func (UserHierarchyGroupMap) ElementType() reflect.Type {
   301  	return reflect.TypeOf((*map[string]*UserHierarchyGroup)(nil)).Elem()
   302  }
   303  
   304  func (i UserHierarchyGroupMap) ToUserHierarchyGroupMapOutput() UserHierarchyGroupMapOutput {
   305  	return i.ToUserHierarchyGroupMapOutputWithContext(context.Background())
   306  }
   307  
   308  func (i UserHierarchyGroupMap) ToUserHierarchyGroupMapOutputWithContext(ctx context.Context) UserHierarchyGroupMapOutput {
   309  	return pulumi.ToOutputWithContext(ctx, i).(UserHierarchyGroupMapOutput)
   310  }
   311  
   312  type UserHierarchyGroupOutput struct{ *pulumi.OutputState }
   313  
   314  func (UserHierarchyGroupOutput) ElementType() reflect.Type {
   315  	return reflect.TypeOf((**UserHierarchyGroup)(nil)).Elem()
   316  }
   317  
   318  func (o UserHierarchyGroupOutput) ToUserHierarchyGroupOutput() UserHierarchyGroupOutput {
   319  	return o
   320  }
   321  
   322  func (o UserHierarchyGroupOutput) ToUserHierarchyGroupOutputWithContext(ctx context.Context) UserHierarchyGroupOutput {
   323  	return o
   324  }
   325  
   326  // The Amazon Resource Name (ARN) of the hierarchy group.
   327  func (o UserHierarchyGroupOutput) Arn() pulumi.StringOutput {
   328  	return o.ApplyT(func(v *UserHierarchyGroup) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   329  }
   330  
   331  // The identifier for the hierarchy group.
   332  func (o UserHierarchyGroupOutput) HierarchyGroupId() pulumi.StringOutput {
   333  	return o.ApplyT(func(v *UserHierarchyGroup) pulumi.StringOutput { return v.HierarchyGroupId }).(pulumi.StringOutput)
   334  }
   335  
   336  // A block that contains information about the levels in the hierarchy group. The `hierarchyPath` block is documented below.
   337  func (o UserHierarchyGroupOutput) HierarchyPaths() UserHierarchyGroupHierarchyPathArrayOutput {
   338  	return o.ApplyT(func(v *UserHierarchyGroup) UserHierarchyGroupHierarchyPathArrayOutput { return v.HierarchyPaths }).(UserHierarchyGroupHierarchyPathArrayOutput)
   339  }
   340  
   341  // Specifies the identifier of the hosting Amazon Connect Instance.
   342  func (o UserHierarchyGroupOutput) InstanceId() pulumi.StringOutput {
   343  	return o.ApplyT(func(v *UserHierarchyGroup) pulumi.StringOutput { return v.InstanceId }).(pulumi.StringOutput)
   344  }
   345  
   346  // The identifier of the level in the hierarchy group.
   347  func (o UserHierarchyGroupOutput) LevelId() pulumi.StringOutput {
   348  	return o.ApplyT(func(v *UserHierarchyGroup) pulumi.StringOutput { return v.LevelId }).(pulumi.StringOutput)
   349  }
   350  
   351  // The name of the user hierarchy group. Must not be more than 100 characters.
   352  func (o UserHierarchyGroupOutput) Name() pulumi.StringOutput {
   353  	return o.ApplyT(func(v *UserHierarchyGroup) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
   354  }
   355  
   356  // The identifier for the parent hierarchy group. The user hierarchy is created at level one if the parent group ID is null.
   357  func (o UserHierarchyGroupOutput) ParentGroupId() pulumi.StringPtrOutput {
   358  	return o.ApplyT(func(v *UserHierarchyGroup) pulumi.StringPtrOutput { return v.ParentGroupId }).(pulumi.StringPtrOutput)
   359  }
   360  
   361  // Tags to apply to the hierarchy group. If configured with a provider
   362  // `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   363  func (o UserHierarchyGroupOutput) Tags() pulumi.StringMapOutput {
   364  	return o.ApplyT(func(v *UserHierarchyGroup) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   365  }
   366  
   367  // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   368  //
   369  // Deprecated: Please use `tags` instead.
   370  func (o UserHierarchyGroupOutput) TagsAll() pulumi.StringMapOutput {
   371  	return o.ApplyT(func(v *UserHierarchyGroup) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   372  }
   373  
   374  type UserHierarchyGroupArrayOutput struct{ *pulumi.OutputState }
   375  
   376  func (UserHierarchyGroupArrayOutput) ElementType() reflect.Type {
   377  	return reflect.TypeOf((*[]*UserHierarchyGroup)(nil)).Elem()
   378  }
   379  
   380  func (o UserHierarchyGroupArrayOutput) ToUserHierarchyGroupArrayOutput() UserHierarchyGroupArrayOutput {
   381  	return o
   382  }
   383  
   384  func (o UserHierarchyGroupArrayOutput) ToUserHierarchyGroupArrayOutputWithContext(ctx context.Context) UserHierarchyGroupArrayOutput {
   385  	return o
   386  }
   387  
   388  func (o UserHierarchyGroupArrayOutput) Index(i pulumi.IntInput) UserHierarchyGroupOutput {
   389  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *UserHierarchyGroup {
   390  		return vs[0].([]*UserHierarchyGroup)[vs[1].(int)]
   391  	}).(UserHierarchyGroupOutput)
   392  }
   393  
   394  type UserHierarchyGroupMapOutput struct{ *pulumi.OutputState }
   395  
   396  func (UserHierarchyGroupMapOutput) ElementType() reflect.Type {
   397  	return reflect.TypeOf((*map[string]*UserHierarchyGroup)(nil)).Elem()
   398  }
   399  
   400  func (o UserHierarchyGroupMapOutput) ToUserHierarchyGroupMapOutput() UserHierarchyGroupMapOutput {
   401  	return o
   402  }
   403  
   404  func (o UserHierarchyGroupMapOutput) ToUserHierarchyGroupMapOutputWithContext(ctx context.Context) UserHierarchyGroupMapOutput {
   405  	return o
   406  }
   407  
   408  func (o UserHierarchyGroupMapOutput) MapIndex(k pulumi.StringInput) UserHierarchyGroupOutput {
   409  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *UserHierarchyGroup {
   410  		return vs[0].(map[string]*UserHierarchyGroup)[vs[1].(string)]
   411  	}).(UserHierarchyGroupOutput)
   412  }
   413  
   414  func init() {
   415  	pulumi.RegisterInputType(reflect.TypeOf((*UserHierarchyGroupInput)(nil)).Elem(), &UserHierarchyGroup{})
   416  	pulumi.RegisterInputType(reflect.TypeOf((*UserHierarchyGroupArrayInput)(nil)).Elem(), UserHierarchyGroupArray{})
   417  	pulumi.RegisterInputType(reflect.TypeOf((*UserHierarchyGroupMapInput)(nil)).Elem(), UserHierarchyGroupMap{})
   418  	pulumi.RegisterOutputType(UserHierarchyGroupOutput{})
   419  	pulumi.RegisterOutputType(UserHierarchyGroupArrayOutput{})
   420  	pulumi.RegisterOutputType(UserHierarchyGroupMapOutput{})
   421  }