github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/resourceexplorer/view.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 resourceexplorer
     5  
     6  import (
     7  	"context"
     8  	"reflect"
     9  
    10  	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
    11  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    12  )
    13  
    14  // Provides a resource to manage a Resource Explorer view.
    15  //
    16  // ## Example Usage
    17  //
    18  // <!--Start PulumiCodeChooser -->
    19  // ```go
    20  // package main
    21  //
    22  // import (
    23  //
    24  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/resourceexplorer"
    25  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    26  //
    27  // )
    28  //
    29  //	func main() {
    30  //		pulumi.Run(func(ctx *pulumi.Context) error {
    31  //			example, err := resourceexplorer.NewIndex(ctx, "example", &resourceexplorer.IndexArgs{
    32  //				Type: pulumi.String("LOCAL"),
    33  //			})
    34  //			if err != nil {
    35  //				return err
    36  //			}
    37  //			_, err = resourceexplorer.NewView(ctx, "example", &resourceexplorer.ViewArgs{
    38  //				Name: pulumi.String("exampleview"),
    39  //				Filters: &resourceexplorer.ViewFiltersArgs{
    40  //					FilterString: pulumi.String("resourcetype:ec2:instance"),
    41  //				},
    42  //				IncludedProperties: resourceexplorer.ViewIncludedPropertyArray{
    43  //					&resourceexplorer.ViewIncludedPropertyArgs{
    44  //						Name: pulumi.String("tags"),
    45  //					},
    46  //				},
    47  //			}, pulumi.DependsOn([]pulumi.Resource{
    48  //				example,
    49  //			}))
    50  //			if err != nil {
    51  //				return err
    52  //			}
    53  //			return nil
    54  //		})
    55  //	}
    56  //
    57  // ```
    58  // <!--End PulumiCodeChooser -->
    59  //
    60  // ## Import
    61  //
    62  // Using `pulumi import`, import Resource Explorer views using the `arn`. For example:
    63  //
    64  // ```sh
    65  // $ pulumi import aws:resourceexplorer/view:View example arn:aws:resource-explorer-2:us-west-2:123456789012:view/exampleview/e0914f6c-6c27-4b47-b5d4-6b28381a2421
    66  // ```
    67  type View struct {
    68  	pulumi.CustomResourceState
    69  
    70  	// Amazon Resource Name (ARN) of the Resource Explorer view.
    71  	Arn pulumi.StringOutput `pulumi:"arn"`
    72  	// Specifies whether the view is the [_default view_](https://docs.aws.amazon.com/resource-explorer/latest/userguide/manage-views-about.html#manage-views-about-default) for the AWS Region. Default: `false`.
    73  	DefaultView pulumi.BoolOutput `pulumi:"defaultView"`
    74  	// Specifies which resources are included in the results of queries made using this view. See Filters below for more details.
    75  	Filters ViewFiltersPtrOutput `pulumi:"filters"`
    76  	// Optional fields to be included in search results from this view. See Included Properties below for more details.
    77  	IncludedProperties ViewIncludedPropertyArrayOutput `pulumi:"includedProperties"`
    78  	// The name of the view. The name must be no more than 64 characters long, and can include letters, digits, and the dash (-) character. The name must be unique within its AWS Region.
    79  	Name pulumi.StringOutput `pulumi:"name"`
    80  	// 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.
    81  	Tags pulumi.StringMapOutput `pulumi:"tags"`
    82  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
    83  	//
    84  	// Deprecated: Please use `tags` instead.
    85  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
    86  }
    87  
    88  // NewView registers a new resource with the given unique name, arguments, and options.
    89  func NewView(ctx *pulumi.Context,
    90  	name string, args *ViewArgs, opts ...pulumi.ResourceOption) (*View, error) {
    91  	if args == nil {
    92  		args = &ViewArgs{}
    93  	}
    94  
    95  	opts = internal.PkgResourceDefaultOpts(opts)
    96  	var resource View
    97  	err := ctx.RegisterResource("aws:resourceexplorer/view:View", name, args, &resource, opts...)
    98  	if err != nil {
    99  		return nil, err
   100  	}
   101  	return &resource, nil
   102  }
   103  
   104  // GetView gets an existing View resource's state with the given name, ID, and optional
   105  // state properties that are used to uniquely qualify the lookup (nil if not required).
   106  func GetView(ctx *pulumi.Context,
   107  	name string, id pulumi.IDInput, state *ViewState, opts ...pulumi.ResourceOption) (*View, error) {
   108  	var resource View
   109  	err := ctx.ReadResource("aws:resourceexplorer/view:View", name, id, state, &resource, opts...)
   110  	if err != nil {
   111  		return nil, err
   112  	}
   113  	return &resource, nil
   114  }
   115  
   116  // Input properties used for looking up and filtering View resources.
   117  type viewState struct {
   118  	// Amazon Resource Name (ARN) of the Resource Explorer view.
   119  	Arn *string `pulumi:"arn"`
   120  	// Specifies whether the view is the [_default view_](https://docs.aws.amazon.com/resource-explorer/latest/userguide/manage-views-about.html#manage-views-about-default) for the AWS Region. Default: `false`.
   121  	DefaultView *bool `pulumi:"defaultView"`
   122  	// Specifies which resources are included in the results of queries made using this view. See Filters below for more details.
   123  	Filters *ViewFilters `pulumi:"filters"`
   124  	// Optional fields to be included in search results from this view. See Included Properties below for more details.
   125  	IncludedProperties []ViewIncludedProperty `pulumi:"includedProperties"`
   126  	// The name of the view. The name must be no more than 64 characters long, and can include letters, digits, and the dash (-) character. The name must be unique within its AWS Region.
   127  	Name *string `pulumi:"name"`
   128  	// 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.
   129  	Tags map[string]string `pulumi:"tags"`
   130  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   131  	//
   132  	// Deprecated: Please use `tags` instead.
   133  	TagsAll map[string]string `pulumi:"tagsAll"`
   134  }
   135  
   136  type ViewState struct {
   137  	// Amazon Resource Name (ARN) of the Resource Explorer view.
   138  	Arn pulumi.StringPtrInput
   139  	// Specifies whether the view is the [_default view_](https://docs.aws.amazon.com/resource-explorer/latest/userguide/manage-views-about.html#manage-views-about-default) for the AWS Region. Default: `false`.
   140  	DefaultView pulumi.BoolPtrInput
   141  	// Specifies which resources are included in the results of queries made using this view. See Filters below for more details.
   142  	Filters ViewFiltersPtrInput
   143  	// Optional fields to be included in search results from this view. See Included Properties below for more details.
   144  	IncludedProperties ViewIncludedPropertyArrayInput
   145  	// The name of the view. The name must be no more than 64 characters long, and can include letters, digits, and the dash (-) character. The name must be unique within its AWS Region.
   146  	Name pulumi.StringPtrInput
   147  	// 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.
   148  	Tags pulumi.StringMapInput
   149  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   150  	//
   151  	// Deprecated: Please use `tags` instead.
   152  	TagsAll pulumi.StringMapInput
   153  }
   154  
   155  func (ViewState) ElementType() reflect.Type {
   156  	return reflect.TypeOf((*viewState)(nil)).Elem()
   157  }
   158  
   159  type viewArgs struct {
   160  	// Specifies whether the view is the [_default view_](https://docs.aws.amazon.com/resource-explorer/latest/userguide/manage-views-about.html#manage-views-about-default) for the AWS Region. Default: `false`.
   161  	DefaultView *bool `pulumi:"defaultView"`
   162  	// Specifies which resources are included in the results of queries made using this view. See Filters below for more details.
   163  	Filters *ViewFilters `pulumi:"filters"`
   164  	// Optional fields to be included in search results from this view. See Included Properties below for more details.
   165  	IncludedProperties []ViewIncludedProperty `pulumi:"includedProperties"`
   166  	// The name of the view. The name must be no more than 64 characters long, and can include letters, digits, and the dash (-) character. The name must be unique within its AWS Region.
   167  	Name *string `pulumi:"name"`
   168  	// 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.
   169  	Tags map[string]string `pulumi:"tags"`
   170  }
   171  
   172  // The set of arguments for constructing a View resource.
   173  type ViewArgs struct {
   174  	// Specifies whether the view is the [_default view_](https://docs.aws.amazon.com/resource-explorer/latest/userguide/manage-views-about.html#manage-views-about-default) for the AWS Region. Default: `false`.
   175  	DefaultView pulumi.BoolPtrInput
   176  	// Specifies which resources are included in the results of queries made using this view. See Filters below for more details.
   177  	Filters ViewFiltersPtrInput
   178  	// Optional fields to be included in search results from this view. See Included Properties below for more details.
   179  	IncludedProperties ViewIncludedPropertyArrayInput
   180  	// The name of the view. The name must be no more than 64 characters long, and can include letters, digits, and the dash (-) character. The name must be unique within its AWS Region.
   181  	Name pulumi.StringPtrInput
   182  	// 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.
   183  	Tags pulumi.StringMapInput
   184  }
   185  
   186  func (ViewArgs) ElementType() reflect.Type {
   187  	return reflect.TypeOf((*viewArgs)(nil)).Elem()
   188  }
   189  
   190  type ViewInput interface {
   191  	pulumi.Input
   192  
   193  	ToViewOutput() ViewOutput
   194  	ToViewOutputWithContext(ctx context.Context) ViewOutput
   195  }
   196  
   197  func (*View) ElementType() reflect.Type {
   198  	return reflect.TypeOf((**View)(nil)).Elem()
   199  }
   200  
   201  func (i *View) ToViewOutput() ViewOutput {
   202  	return i.ToViewOutputWithContext(context.Background())
   203  }
   204  
   205  func (i *View) ToViewOutputWithContext(ctx context.Context) ViewOutput {
   206  	return pulumi.ToOutputWithContext(ctx, i).(ViewOutput)
   207  }
   208  
   209  // ViewArrayInput is an input type that accepts ViewArray and ViewArrayOutput values.
   210  // You can construct a concrete instance of `ViewArrayInput` via:
   211  //
   212  //	ViewArray{ ViewArgs{...} }
   213  type ViewArrayInput interface {
   214  	pulumi.Input
   215  
   216  	ToViewArrayOutput() ViewArrayOutput
   217  	ToViewArrayOutputWithContext(context.Context) ViewArrayOutput
   218  }
   219  
   220  type ViewArray []ViewInput
   221  
   222  func (ViewArray) ElementType() reflect.Type {
   223  	return reflect.TypeOf((*[]*View)(nil)).Elem()
   224  }
   225  
   226  func (i ViewArray) ToViewArrayOutput() ViewArrayOutput {
   227  	return i.ToViewArrayOutputWithContext(context.Background())
   228  }
   229  
   230  func (i ViewArray) ToViewArrayOutputWithContext(ctx context.Context) ViewArrayOutput {
   231  	return pulumi.ToOutputWithContext(ctx, i).(ViewArrayOutput)
   232  }
   233  
   234  // ViewMapInput is an input type that accepts ViewMap and ViewMapOutput values.
   235  // You can construct a concrete instance of `ViewMapInput` via:
   236  //
   237  //	ViewMap{ "key": ViewArgs{...} }
   238  type ViewMapInput interface {
   239  	pulumi.Input
   240  
   241  	ToViewMapOutput() ViewMapOutput
   242  	ToViewMapOutputWithContext(context.Context) ViewMapOutput
   243  }
   244  
   245  type ViewMap map[string]ViewInput
   246  
   247  func (ViewMap) ElementType() reflect.Type {
   248  	return reflect.TypeOf((*map[string]*View)(nil)).Elem()
   249  }
   250  
   251  func (i ViewMap) ToViewMapOutput() ViewMapOutput {
   252  	return i.ToViewMapOutputWithContext(context.Background())
   253  }
   254  
   255  func (i ViewMap) ToViewMapOutputWithContext(ctx context.Context) ViewMapOutput {
   256  	return pulumi.ToOutputWithContext(ctx, i).(ViewMapOutput)
   257  }
   258  
   259  type ViewOutput struct{ *pulumi.OutputState }
   260  
   261  func (ViewOutput) ElementType() reflect.Type {
   262  	return reflect.TypeOf((**View)(nil)).Elem()
   263  }
   264  
   265  func (o ViewOutput) ToViewOutput() ViewOutput {
   266  	return o
   267  }
   268  
   269  func (o ViewOutput) ToViewOutputWithContext(ctx context.Context) ViewOutput {
   270  	return o
   271  }
   272  
   273  // Amazon Resource Name (ARN) of the Resource Explorer view.
   274  func (o ViewOutput) Arn() pulumi.StringOutput {
   275  	return o.ApplyT(func(v *View) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   276  }
   277  
   278  // Specifies whether the view is the [_default view_](https://docs.aws.amazon.com/resource-explorer/latest/userguide/manage-views-about.html#manage-views-about-default) for the AWS Region. Default: `false`.
   279  func (o ViewOutput) DefaultView() pulumi.BoolOutput {
   280  	return o.ApplyT(func(v *View) pulumi.BoolOutput { return v.DefaultView }).(pulumi.BoolOutput)
   281  }
   282  
   283  // Specifies which resources are included in the results of queries made using this view. See Filters below for more details.
   284  func (o ViewOutput) Filters() ViewFiltersPtrOutput {
   285  	return o.ApplyT(func(v *View) ViewFiltersPtrOutput { return v.Filters }).(ViewFiltersPtrOutput)
   286  }
   287  
   288  // Optional fields to be included in search results from this view. See Included Properties below for more details.
   289  func (o ViewOutput) IncludedProperties() ViewIncludedPropertyArrayOutput {
   290  	return o.ApplyT(func(v *View) ViewIncludedPropertyArrayOutput { return v.IncludedProperties }).(ViewIncludedPropertyArrayOutput)
   291  }
   292  
   293  // The name of the view. The name must be no more than 64 characters long, and can include letters, digits, and the dash (-) character. The name must be unique within its AWS Region.
   294  func (o ViewOutput) Name() pulumi.StringOutput {
   295  	return o.ApplyT(func(v *View) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
   296  }
   297  
   298  // 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.
   299  func (o ViewOutput) Tags() pulumi.StringMapOutput {
   300  	return o.ApplyT(func(v *View) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   301  }
   302  
   303  // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   304  //
   305  // Deprecated: Please use `tags` instead.
   306  func (o ViewOutput) TagsAll() pulumi.StringMapOutput {
   307  	return o.ApplyT(func(v *View) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   308  }
   309  
   310  type ViewArrayOutput struct{ *pulumi.OutputState }
   311  
   312  func (ViewArrayOutput) ElementType() reflect.Type {
   313  	return reflect.TypeOf((*[]*View)(nil)).Elem()
   314  }
   315  
   316  func (o ViewArrayOutput) ToViewArrayOutput() ViewArrayOutput {
   317  	return o
   318  }
   319  
   320  func (o ViewArrayOutput) ToViewArrayOutputWithContext(ctx context.Context) ViewArrayOutput {
   321  	return o
   322  }
   323  
   324  func (o ViewArrayOutput) Index(i pulumi.IntInput) ViewOutput {
   325  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *View {
   326  		return vs[0].([]*View)[vs[1].(int)]
   327  	}).(ViewOutput)
   328  }
   329  
   330  type ViewMapOutput struct{ *pulumi.OutputState }
   331  
   332  func (ViewMapOutput) ElementType() reflect.Type {
   333  	return reflect.TypeOf((*map[string]*View)(nil)).Elem()
   334  }
   335  
   336  func (o ViewMapOutput) ToViewMapOutput() ViewMapOutput {
   337  	return o
   338  }
   339  
   340  func (o ViewMapOutput) ToViewMapOutputWithContext(ctx context.Context) ViewMapOutput {
   341  	return o
   342  }
   343  
   344  func (o ViewMapOutput) MapIndex(k pulumi.StringInput) ViewOutput {
   345  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *View {
   346  		return vs[0].(map[string]*View)[vs[1].(string)]
   347  	}).(ViewOutput)
   348  }
   349  
   350  func init() {
   351  	pulumi.RegisterInputType(reflect.TypeOf((*ViewInput)(nil)).Elem(), &View{})
   352  	pulumi.RegisterInputType(reflect.TypeOf((*ViewArrayInput)(nil)).Elem(), ViewArray{})
   353  	pulumi.RegisterInputType(reflect.TypeOf((*ViewMapInput)(nil)).Elem(), ViewMap{})
   354  	pulumi.RegisterOutputType(ViewOutput{})
   355  	pulumi.RegisterOutputType(ViewArrayOutput{})
   356  	pulumi.RegisterOutputType(ViewMapOutput{})
   357  }