github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/xray/group.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 xray
     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  // Creates and manages an AWS XRay Group.
    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/xray"
    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 := xray.NewGroup(ctx, "example", &xray.GroupArgs{
    33  //				GroupName:        pulumi.String("example"),
    34  //				FilterExpression: pulumi.String("responsetime > 5"),
    35  //				InsightsConfiguration: &xray.GroupInsightsConfigurationArgs{
    36  //					InsightsEnabled:      pulumi.Bool(true),
    37  //					NotificationsEnabled: pulumi.Bool(true),
    38  //				},
    39  //			})
    40  //			if err != nil {
    41  //				return err
    42  //			}
    43  //			return nil
    44  //		})
    45  //	}
    46  //
    47  // ```
    48  // <!--End PulumiCodeChooser -->
    49  //
    50  // ## Import
    51  //
    52  // Using `pulumi import`, import XRay Groups using the ARN. For example:
    53  //
    54  // ```sh
    55  // $ pulumi import aws:xray/group:Group example arn:aws:xray:us-west-2:1234567890:group/example-group/TNGX7SW5U6QY36T4ZMOUA3HVLBYCZTWDIOOXY3CJAXTHSS3YCWUA
    56  // ```
    57  type Group struct {
    58  	pulumi.CustomResourceState
    59  
    60  	// The ARN of the Group.
    61  	Arn pulumi.StringOutput `pulumi:"arn"`
    62  	// The filter expression defining criteria by which to group traces. more info can be found in official [docs](https://docs.aws.amazon.com/xray/latest/devguide/xray-console-filters.html).
    63  	FilterExpression pulumi.StringOutput `pulumi:"filterExpression"`
    64  	// The name of the group.
    65  	GroupName pulumi.StringOutput `pulumi:"groupName"`
    66  	// Configuration options for enabling insights.
    67  	InsightsConfiguration GroupInsightsConfigurationOutput `pulumi:"insightsConfiguration"`
    68  	// Key-value mapping of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level
    69  	Tags pulumi.StringMapOutput `pulumi:"tags"`
    70  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
    71  	//
    72  	// Deprecated: Please use `tags` instead.
    73  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
    74  }
    75  
    76  // NewGroup registers a new resource with the given unique name, arguments, and options.
    77  func NewGroup(ctx *pulumi.Context,
    78  	name string, args *GroupArgs, opts ...pulumi.ResourceOption) (*Group, error) {
    79  	if args == nil {
    80  		return nil, errors.New("missing one or more required arguments")
    81  	}
    82  
    83  	if args.FilterExpression == nil {
    84  		return nil, errors.New("invalid value for required argument 'FilterExpression'")
    85  	}
    86  	if args.GroupName == nil {
    87  		return nil, errors.New("invalid value for required argument 'GroupName'")
    88  	}
    89  	opts = internal.PkgResourceDefaultOpts(opts)
    90  	var resource Group
    91  	err := ctx.RegisterResource("aws:xray/group:Group", name, args, &resource, opts...)
    92  	if err != nil {
    93  		return nil, err
    94  	}
    95  	return &resource, nil
    96  }
    97  
    98  // GetGroup gets an existing Group resource's state with the given name, ID, and optional
    99  // state properties that are used to uniquely qualify the lookup (nil if not required).
   100  func GetGroup(ctx *pulumi.Context,
   101  	name string, id pulumi.IDInput, state *GroupState, opts ...pulumi.ResourceOption) (*Group, error) {
   102  	var resource Group
   103  	err := ctx.ReadResource("aws:xray/group:Group", name, id, state, &resource, opts...)
   104  	if err != nil {
   105  		return nil, err
   106  	}
   107  	return &resource, nil
   108  }
   109  
   110  // Input properties used for looking up and filtering Group resources.
   111  type groupState struct {
   112  	// The ARN of the Group.
   113  	Arn *string `pulumi:"arn"`
   114  	// The filter expression defining criteria by which to group traces. more info can be found in official [docs](https://docs.aws.amazon.com/xray/latest/devguide/xray-console-filters.html).
   115  	FilterExpression *string `pulumi:"filterExpression"`
   116  	// The name of the group.
   117  	GroupName *string `pulumi:"groupName"`
   118  	// Configuration options for enabling insights.
   119  	InsightsConfiguration *GroupInsightsConfiguration `pulumi:"insightsConfiguration"`
   120  	// Key-value mapping of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level
   121  	Tags map[string]string `pulumi:"tags"`
   122  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   123  	//
   124  	// Deprecated: Please use `tags` instead.
   125  	TagsAll map[string]string `pulumi:"tagsAll"`
   126  }
   127  
   128  type GroupState struct {
   129  	// The ARN of the Group.
   130  	Arn pulumi.StringPtrInput
   131  	// The filter expression defining criteria by which to group traces. more info can be found in official [docs](https://docs.aws.amazon.com/xray/latest/devguide/xray-console-filters.html).
   132  	FilterExpression pulumi.StringPtrInput
   133  	// The name of the group.
   134  	GroupName pulumi.StringPtrInput
   135  	// Configuration options for enabling insights.
   136  	InsightsConfiguration GroupInsightsConfigurationPtrInput
   137  	// Key-value mapping of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level
   138  	Tags pulumi.StringMapInput
   139  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   140  	//
   141  	// Deprecated: Please use `tags` instead.
   142  	TagsAll pulumi.StringMapInput
   143  }
   144  
   145  func (GroupState) ElementType() reflect.Type {
   146  	return reflect.TypeOf((*groupState)(nil)).Elem()
   147  }
   148  
   149  type groupArgs struct {
   150  	// The filter expression defining criteria by which to group traces. more info can be found in official [docs](https://docs.aws.amazon.com/xray/latest/devguide/xray-console-filters.html).
   151  	FilterExpression string `pulumi:"filterExpression"`
   152  	// The name of the group.
   153  	GroupName string `pulumi:"groupName"`
   154  	// Configuration options for enabling insights.
   155  	InsightsConfiguration *GroupInsightsConfiguration `pulumi:"insightsConfiguration"`
   156  	// Key-value mapping of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level
   157  	Tags map[string]string `pulumi:"tags"`
   158  }
   159  
   160  // The set of arguments for constructing a Group resource.
   161  type GroupArgs struct {
   162  	// The filter expression defining criteria by which to group traces. more info can be found in official [docs](https://docs.aws.amazon.com/xray/latest/devguide/xray-console-filters.html).
   163  	FilterExpression pulumi.StringInput
   164  	// The name of the group.
   165  	GroupName pulumi.StringInput
   166  	// Configuration options for enabling insights.
   167  	InsightsConfiguration GroupInsightsConfigurationPtrInput
   168  	// Key-value mapping of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level
   169  	Tags pulumi.StringMapInput
   170  }
   171  
   172  func (GroupArgs) ElementType() reflect.Type {
   173  	return reflect.TypeOf((*groupArgs)(nil)).Elem()
   174  }
   175  
   176  type GroupInput interface {
   177  	pulumi.Input
   178  
   179  	ToGroupOutput() GroupOutput
   180  	ToGroupOutputWithContext(ctx context.Context) GroupOutput
   181  }
   182  
   183  func (*Group) ElementType() reflect.Type {
   184  	return reflect.TypeOf((**Group)(nil)).Elem()
   185  }
   186  
   187  func (i *Group) ToGroupOutput() GroupOutput {
   188  	return i.ToGroupOutputWithContext(context.Background())
   189  }
   190  
   191  func (i *Group) ToGroupOutputWithContext(ctx context.Context) GroupOutput {
   192  	return pulumi.ToOutputWithContext(ctx, i).(GroupOutput)
   193  }
   194  
   195  // GroupArrayInput is an input type that accepts GroupArray and GroupArrayOutput values.
   196  // You can construct a concrete instance of `GroupArrayInput` via:
   197  //
   198  //	GroupArray{ GroupArgs{...} }
   199  type GroupArrayInput interface {
   200  	pulumi.Input
   201  
   202  	ToGroupArrayOutput() GroupArrayOutput
   203  	ToGroupArrayOutputWithContext(context.Context) GroupArrayOutput
   204  }
   205  
   206  type GroupArray []GroupInput
   207  
   208  func (GroupArray) ElementType() reflect.Type {
   209  	return reflect.TypeOf((*[]*Group)(nil)).Elem()
   210  }
   211  
   212  func (i GroupArray) ToGroupArrayOutput() GroupArrayOutput {
   213  	return i.ToGroupArrayOutputWithContext(context.Background())
   214  }
   215  
   216  func (i GroupArray) ToGroupArrayOutputWithContext(ctx context.Context) GroupArrayOutput {
   217  	return pulumi.ToOutputWithContext(ctx, i).(GroupArrayOutput)
   218  }
   219  
   220  // GroupMapInput is an input type that accepts GroupMap and GroupMapOutput values.
   221  // You can construct a concrete instance of `GroupMapInput` via:
   222  //
   223  //	GroupMap{ "key": GroupArgs{...} }
   224  type GroupMapInput interface {
   225  	pulumi.Input
   226  
   227  	ToGroupMapOutput() GroupMapOutput
   228  	ToGroupMapOutputWithContext(context.Context) GroupMapOutput
   229  }
   230  
   231  type GroupMap map[string]GroupInput
   232  
   233  func (GroupMap) ElementType() reflect.Type {
   234  	return reflect.TypeOf((*map[string]*Group)(nil)).Elem()
   235  }
   236  
   237  func (i GroupMap) ToGroupMapOutput() GroupMapOutput {
   238  	return i.ToGroupMapOutputWithContext(context.Background())
   239  }
   240  
   241  func (i GroupMap) ToGroupMapOutputWithContext(ctx context.Context) GroupMapOutput {
   242  	return pulumi.ToOutputWithContext(ctx, i).(GroupMapOutput)
   243  }
   244  
   245  type GroupOutput struct{ *pulumi.OutputState }
   246  
   247  func (GroupOutput) ElementType() reflect.Type {
   248  	return reflect.TypeOf((**Group)(nil)).Elem()
   249  }
   250  
   251  func (o GroupOutput) ToGroupOutput() GroupOutput {
   252  	return o
   253  }
   254  
   255  func (o GroupOutput) ToGroupOutputWithContext(ctx context.Context) GroupOutput {
   256  	return o
   257  }
   258  
   259  // The ARN of the Group.
   260  func (o GroupOutput) Arn() pulumi.StringOutput {
   261  	return o.ApplyT(func(v *Group) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   262  }
   263  
   264  // The filter expression defining criteria by which to group traces. more info can be found in official [docs](https://docs.aws.amazon.com/xray/latest/devguide/xray-console-filters.html).
   265  func (o GroupOutput) FilterExpression() pulumi.StringOutput {
   266  	return o.ApplyT(func(v *Group) pulumi.StringOutput { return v.FilterExpression }).(pulumi.StringOutput)
   267  }
   268  
   269  // The name of the group.
   270  func (o GroupOutput) GroupName() pulumi.StringOutput {
   271  	return o.ApplyT(func(v *Group) pulumi.StringOutput { return v.GroupName }).(pulumi.StringOutput)
   272  }
   273  
   274  // Configuration options for enabling insights.
   275  func (o GroupOutput) InsightsConfiguration() GroupInsightsConfigurationOutput {
   276  	return o.ApplyT(func(v *Group) GroupInsightsConfigurationOutput { return v.InsightsConfiguration }).(GroupInsightsConfigurationOutput)
   277  }
   278  
   279  // Key-value mapping of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level
   280  func (o GroupOutput) Tags() pulumi.StringMapOutput {
   281  	return o.ApplyT(func(v *Group) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   282  }
   283  
   284  // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   285  //
   286  // Deprecated: Please use `tags` instead.
   287  func (o GroupOutput) TagsAll() pulumi.StringMapOutput {
   288  	return o.ApplyT(func(v *Group) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   289  }
   290  
   291  type GroupArrayOutput struct{ *pulumi.OutputState }
   292  
   293  func (GroupArrayOutput) ElementType() reflect.Type {
   294  	return reflect.TypeOf((*[]*Group)(nil)).Elem()
   295  }
   296  
   297  func (o GroupArrayOutput) ToGroupArrayOutput() GroupArrayOutput {
   298  	return o
   299  }
   300  
   301  func (o GroupArrayOutput) ToGroupArrayOutputWithContext(ctx context.Context) GroupArrayOutput {
   302  	return o
   303  }
   304  
   305  func (o GroupArrayOutput) Index(i pulumi.IntInput) GroupOutput {
   306  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Group {
   307  		return vs[0].([]*Group)[vs[1].(int)]
   308  	}).(GroupOutput)
   309  }
   310  
   311  type GroupMapOutput struct{ *pulumi.OutputState }
   312  
   313  func (GroupMapOutput) ElementType() reflect.Type {
   314  	return reflect.TypeOf((*map[string]*Group)(nil)).Elem()
   315  }
   316  
   317  func (o GroupMapOutput) ToGroupMapOutput() GroupMapOutput {
   318  	return o
   319  }
   320  
   321  func (o GroupMapOutput) ToGroupMapOutputWithContext(ctx context.Context) GroupMapOutput {
   322  	return o
   323  }
   324  
   325  func (o GroupMapOutput) MapIndex(k pulumi.StringInput) GroupOutput {
   326  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Group {
   327  		return vs[0].(map[string]*Group)[vs[1].(string)]
   328  	}).(GroupOutput)
   329  }
   330  
   331  func init() {
   332  	pulumi.RegisterInputType(reflect.TypeOf((*GroupInput)(nil)).Elem(), &Group{})
   333  	pulumi.RegisterInputType(reflect.TypeOf((*GroupArrayInput)(nil)).Elem(), GroupArray{})
   334  	pulumi.RegisterInputType(reflect.TypeOf((*GroupMapInput)(nil)).Elem(), GroupMap{})
   335  	pulumi.RegisterOutputType(GroupOutput{})
   336  	pulumi.RegisterOutputType(GroupArrayOutput{})
   337  	pulumi.RegisterOutputType(GroupMapOutput{})
   338  }