github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/costexplorer/getCostCategory.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 costexplorer
     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 details about a specific CostExplorer Cost Category.
    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/costexplorer"
    25  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    26  //
    27  // )
    28  //
    29  //	func main() {
    30  //		pulumi.Run(func(ctx *pulumi.Context) error {
    31  //			_, err := costexplorer.LookupCostCategory(ctx, &costexplorer.LookupCostCategoryArgs{
    32  //				CostCategoryArn: "costCategoryARN",
    33  //			}, nil)
    34  //			if err != nil {
    35  //				return err
    36  //			}
    37  //			return nil
    38  //		})
    39  //	}
    40  //
    41  // ```
    42  // <!--End PulumiCodeChooser -->
    43  func LookupCostCategory(ctx *pulumi.Context, args *LookupCostCategoryArgs, opts ...pulumi.InvokeOption) (*LookupCostCategoryResult, error) {
    44  	opts = internal.PkgInvokeDefaultOpts(opts)
    45  	var rv LookupCostCategoryResult
    46  	err := ctx.Invoke("aws:costexplorer/getCostCategory:getCostCategory", args, &rv, opts...)
    47  	if err != nil {
    48  		return nil, err
    49  	}
    50  	return &rv, nil
    51  }
    52  
    53  // A collection of arguments for invoking getCostCategory.
    54  type LookupCostCategoryArgs struct {
    55  	// Unique name for the Cost Category.
    56  	CostCategoryArn string `pulumi:"costCategoryArn"`
    57  	// Configuration block for the specific `Tag` to use for `Expression`. See below.
    58  	Tags map[string]string `pulumi:"tags"`
    59  }
    60  
    61  // A collection of values returned by getCostCategory.
    62  type LookupCostCategoryResult struct {
    63  	CostCategoryArn string `pulumi:"costCategoryArn"`
    64  	// Default value for the cost category.
    65  	DefaultValue string `pulumi:"defaultValue"`
    66  	// Effective end data of your Cost Category.
    67  	EffectiveEnd string `pulumi:"effectiveEnd"`
    68  	// Effective state data of your Cost Category.
    69  	EffectiveStart string `pulumi:"effectiveStart"`
    70  	// The provider-assigned unique ID for this managed resource.
    71  	Id   string `pulumi:"id"`
    72  	Name string `pulumi:"name"`
    73  	// Rule schema version in this particular Cost Category.
    74  	RuleVersion string `pulumi:"ruleVersion"`
    75  	// Configuration block for the `Expression` object used to categorize costs. See below.
    76  	Rules []GetCostCategoryRule `pulumi:"rules"`
    77  	// Configuration block for the split charge rules used to allocate your charges between your Cost Category values. See below.
    78  	SplitChargeRules []GetCostCategorySplitChargeRule `pulumi:"splitChargeRules"`
    79  	// Configuration block for the specific `Tag` to use for `Expression`. See below.
    80  	Tags map[string]string `pulumi:"tags"`
    81  }
    82  
    83  func LookupCostCategoryOutput(ctx *pulumi.Context, args LookupCostCategoryOutputArgs, opts ...pulumi.InvokeOption) LookupCostCategoryResultOutput {
    84  	return pulumi.ToOutputWithContext(context.Background(), args).
    85  		ApplyT(func(v interface{}) (LookupCostCategoryResult, error) {
    86  			args := v.(LookupCostCategoryArgs)
    87  			r, err := LookupCostCategory(ctx, &args, opts...)
    88  			var s LookupCostCategoryResult
    89  			if r != nil {
    90  				s = *r
    91  			}
    92  			return s, err
    93  		}).(LookupCostCategoryResultOutput)
    94  }
    95  
    96  // A collection of arguments for invoking getCostCategory.
    97  type LookupCostCategoryOutputArgs struct {
    98  	// Unique name for the Cost Category.
    99  	CostCategoryArn pulumi.StringInput `pulumi:"costCategoryArn"`
   100  	// Configuration block for the specific `Tag` to use for `Expression`. See below.
   101  	Tags pulumi.StringMapInput `pulumi:"tags"`
   102  }
   103  
   104  func (LookupCostCategoryOutputArgs) ElementType() reflect.Type {
   105  	return reflect.TypeOf((*LookupCostCategoryArgs)(nil)).Elem()
   106  }
   107  
   108  // A collection of values returned by getCostCategory.
   109  type LookupCostCategoryResultOutput struct{ *pulumi.OutputState }
   110  
   111  func (LookupCostCategoryResultOutput) ElementType() reflect.Type {
   112  	return reflect.TypeOf((*LookupCostCategoryResult)(nil)).Elem()
   113  }
   114  
   115  func (o LookupCostCategoryResultOutput) ToLookupCostCategoryResultOutput() LookupCostCategoryResultOutput {
   116  	return o
   117  }
   118  
   119  func (o LookupCostCategoryResultOutput) ToLookupCostCategoryResultOutputWithContext(ctx context.Context) LookupCostCategoryResultOutput {
   120  	return o
   121  }
   122  
   123  func (o LookupCostCategoryResultOutput) CostCategoryArn() pulumi.StringOutput {
   124  	return o.ApplyT(func(v LookupCostCategoryResult) string { return v.CostCategoryArn }).(pulumi.StringOutput)
   125  }
   126  
   127  // Default value for the cost category.
   128  func (o LookupCostCategoryResultOutput) DefaultValue() pulumi.StringOutput {
   129  	return o.ApplyT(func(v LookupCostCategoryResult) string { return v.DefaultValue }).(pulumi.StringOutput)
   130  }
   131  
   132  // Effective end data of your Cost Category.
   133  func (o LookupCostCategoryResultOutput) EffectiveEnd() pulumi.StringOutput {
   134  	return o.ApplyT(func(v LookupCostCategoryResult) string { return v.EffectiveEnd }).(pulumi.StringOutput)
   135  }
   136  
   137  // Effective state data of your Cost Category.
   138  func (o LookupCostCategoryResultOutput) EffectiveStart() pulumi.StringOutput {
   139  	return o.ApplyT(func(v LookupCostCategoryResult) string { return v.EffectiveStart }).(pulumi.StringOutput)
   140  }
   141  
   142  // The provider-assigned unique ID for this managed resource.
   143  func (o LookupCostCategoryResultOutput) Id() pulumi.StringOutput {
   144  	return o.ApplyT(func(v LookupCostCategoryResult) string { return v.Id }).(pulumi.StringOutput)
   145  }
   146  
   147  func (o LookupCostCategoryResultOutput) Name() pulumi.StringOutput {
   148  	return o.ApplyT(func(v LookupCostCategoryResult) string { return v.Name }).(pulumi.StringOutput)
   149  }
   150  
   151  // Rule schema version in this particular Cost Category.
   152  func (o LookupCostCategoryResultOutput) RuleVersion() pulumi.StringOutput {
   153  	return o.ApplyT(func(v LookupCostCategoryResult) string { return v.RuleVersion }).(pulumi.StringOutput)
   154  }
   155  
   156  // Configuration block for the `Expression` object used to categorize costs. See below.
   157  func (o LookupCostCategoryResultOutput) Rules() GetCostCategoryRuleArrayOutput {
   158  	return o.ApplyT(func(v LookupCostCategoryResult) []GetCostCategoryRule { return v.Rules }).(GetCostCategoryRuleArrayOutput)
   159  }
   160  
   161  // Configuration block for the split charge rules used to allocate your charges between your Cost Category values. See below.
   162  func (o LookupCostCategoryResultOutput) SplitChargeRules() GetCostCategorySplitChargeRuleArrayOutput {
   163  	return o.ApplyT(func(v LookupCostCategoryResult) []GetCostCategorySplitChargeRule { return v.SplitChargeRules }).(GetCostCategorySplitChargeRuleArrayOutput)
   164  }
   165  
   166  // Configuration block for the specific `Tag` to use for `Expression`. See below.
   167  func (o LookupCostCategoryResultOutput) Tags() pulumi.StringMapOutput {
   168  	return o.ApplyT(func(v LookupCostCategoryResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput)
   169  }
   170  
   171  func init() {
   172  	pulumi.RegisterOutputType(LookupCostCategoryResultOutput{})
   173  }