github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/iot/billingGroup.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 iot
     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  // Manages an AWS IoT Billing Group.
    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/iot"
    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 := iot.NewBillingGroup(ctx, "example", &iot.BillingGroupArgs{
    32  //				Name: pulumi.String("example"),
    33  //				Properties: &iot.BillingGroupPropertiesArgs{
    34  //					Description: pulumi.String("This is my billing group"),
    35  //				},
    36  //				Tags: pulumi.StringMap{
    37  //					"terraform": pulumi.String("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 IoT Billing Groups using the name. For example:
    53  //
    54  // ```sh
    55  // $ pulumi import aws:iot/billingGroup:BillingGroup example example
    56  // ```
    57  type BillingGroup struct {
    58  	pulumi.CustomResourceState
    59  
    60  	// The ARN of the Billing Group.
    61  	Arn       pulumi.StringOutput             `pulumi:"arn"`
    62  	Metadatas BillingGroupMetadataArrayOutput `pulumi:"metadatas"`
    63  	// The name of the Billing Group.
    64  	Name pulumi.StringOutput `pulumi:"name"`
    65  	// The Billing Group properties. Defined below.
    66  	Properties BillingGroupPropertiesPtrOutput `pulumi:"properties"`
    67  	// Key-value mapping of resource tags
    68  	Tags pulumi.StringMapOutput `pulumi:"tags"`
    69  	// Deprecated: Please use `tags` instead.
    70  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
    71  	// The current version of the Billing Group record in the registry.
    72  	Version pulumi.IntOutput `pulumi:"version"`
    73  }
    74  
    75  // NewBillingGroup registers a new resource with the given unique name, arguments, and options.
    76  func NewBillingGroup(ctx *pulumi.Context,
    77  	name string, args *BillingGroupArgs, opts ...pulumi.ResourceOption) (*BillingGroup, error) {
    78  	if args == nil {
    79  		args = &BillingGroupArgs{}
    80  	}
    81  
    82  	opts = internal.PkgResourceDefaultOpts(opts)
    83  	var resource BillingGroup
    84  	err := ctx.RegisterResource("aws:iot/billingGroup:BillingGroup", name, args, &resource, opts...)
    85  	if err != nil {
    86  		return nil, err
    87  	}
    88  	return &resource, nil
    89  }
    90  
    91  // GetBillingGroup gets an existing BillingGroup resource's state with the given name, ID, and optional
    92  // state properties that are used to uniquely qualify the lookup (nil if not required).
    93  func GetBillingGroup(ctx *pulumi.Context,
    94  	name string, id pulumi.IDInput, state *BillingGroupState, opts ...pulumi.ResourceOption) (*BillingGroup, error) {
    95  	var resource BillingGroup
    96  	err := ctx.ReadResource("aws:iot/billingGroup:BillingGroup", name, id, state, &resource, opts...)
    97  	if err != nil {
    98  		return nil, err
    99  	}
   100  	return &resource, nil
   101  }
   102  
   103  // Input properties used for looking up and filtering BillingGroup resources.
   104  type billingGroupState struct {
   105  	// The ARN of the Billing Group.
   106  	Arn       *string                `pulumi:"arn"`
   107  	Metadatas []BillingGroupMetadata `pulumi:"metadatas"`
   108  	// The name of the Billing Group.
   109  	Name *string `pulumi:"name"`
   110  	// The Billing Group properties. Defined below.
   111  	Properties *BillingGroupProperties `pulumi:"properties"`
   112  	// Key-value mapping of resource tags
   113  	Tags map[string]string `pulumi:"tags"`
   114  	// Deprecated: Please use `tags` instead.
   115  	TagsAll map[string]string `pulumi:"tagsAll"`
   116  	// The current version of the Billing Group record in the registry.
   117  	Version *int `pulumi:"version"`
   118  }
   119  
   120  type BillingGroupState struct {
   121  	// The ARN of the Billing Group.
   122  	Arn       pulumi.StringPtrInput
   123  	Metadatas BillingGroupMetadataArrayInput
   124  	// The name of the Billing Group.
   125  	Name pulumi.StringPtrInput
   126  	// The Billing Group properties. Defined below.
   127  	Properties BillingGroupPropertiesPtrInput
   128  	// Key-value mapping of resource tags
   129  	Tags pulumi.StringMapInput
   130  	// Deprecated: Please use `tags` instead.
   131  	TagsAll pulumi.StringMapInput
   132  	// The current version of the Billing Group record in the registry.
   133  	Version pulumi.IntPtrInput
   134  }
   135  
   136  func (BillingGroupState) ElementType() reflect.Type {
   137  	return reflect.TypeOf((*billingGroupState)(nil)).Elem()
   138  }
   139  
   140  type billingGroupArgs struct {
   141  	// The name of the Billing Group.
   142  	Name *string `pulumi:"name"`
   143  	// The Billing Group properties. Defined below.
   144  	Properties *BillingGroupProperties `pulumi:"properties"`
   145  	// Key-value mapping of resource tags
   146  	Tags map[string]string `pulumi:"tags"`
   147  }
   148  
   149  // The set of arguments for constructing a BillingGroup resource.
   150  type BillingGroupArgs struct {
   151  	// The name of the Billing Group.
   152  	Name pulumi.StringPtrInput
   153  	// The Billing Group properties. Defined below.
   154  	Properties BillingGroupPropertiesPtrInput
   155  	// Key-value mapping of resource tags
   156  	Tags pulumi.StringMapInput
   157  }
   158  
   159  func (BillingGroupArgs) ElementType() reflect.Type {
   160  	return reflect.TypeOf((*billingGroupArgs)(nil)).Elem()
   161  }
   162  
   163  type BillingGroupInput interface {
   164  	pulumi.Input
   165  
   166  	ToBillingGroupOutput() BillingGroupOutput
   167  	ToBillingGroupOutputWithContext(ctx context.Context) BillingGroupOutput
   168  }
   169  
   170  func (*BillingGroup) ElementType() reflect.Type {
   171  	return reflect.TypeOf((**BillingGroup)(nil)).Elem()
   172  }
   173  
   174  func (i *BillingGroup) ToBillingGroupOutput() BillingGroupOutput {
   175  	return i.ToBillingGroupOutputWithContext(context.Background())
   176  }
   177  
   178  func (i *BillingGroup) ToBillingGroupOutputWithContext(ctx context.Context) BillingGroupOutput {
   179  	return pulumi.ToOutputWithContext(ctx, i).(BillingGroupOutput)
   180  }
   181  
   182  // BillingGroupArrayInput is an input type that accepts BillingGroupArray and BillingGroupArrayOutput values.
   183  // You can construct a concrete instance of `BillingGroupArrayInput` via:
   184  //
   185  //	BillingGroupArray{ BillingGroupArgs{...} }
   186  type BillingGroupArrayInput interface {
   187  	pulumi.Input
   188  
   189  	ToBillingGroupArrayOutput() BillingGroupArrayOutput
   190  	ToBillingGroupArrayOutputWithContext(context.Context) BillingGroupArrayOutput
   191  }
   192  
   193  type BillingGroupArray []BillingGroupInput
   194  
   195  func (BillingGroupArray) ElementType() reflect.Type {
   196  	return reflect.TypeOf((*[]*BillingGroup)(nil)).Elem()
   197  }
   198  
   199  func (i BillingGroupArray) ToBillingGroupArrayOutput() BillingGroupArrayOutput {
   200  	return i.ToBillingGroupArrayOutputWithContext(context.Background())
   201  }
   202  
   203  func (i BillingGroupArray) ToBillingGroupArrayOutputWithContext(ctx context.Context) BillingGroupArrayOutput {
   204  	return pulumi.ToOutputWithContext(ctx, i).(BillingGroupArrayOutput)
   205  }
   206  
   207  // BillingGroupMapInput is an input type that accepts BillingGroupMap and BillingGroupMapOutput values.
   208  // You can construct a concrete instance of `BillingGroupMapInput` via:
   209  //
   210  //	BillingGroupMap{ "key": BillingGroupArgs{...} }
   211  type BillingGroupMapInput interface {
   212  	pulumi.Input
   213  
   214  	ToBillingGroupMapOutput() BillingGroupMapOutput
   215  	ToBillingGroupMapOutputWithContext(context.Context) BillingGroupMapOutput
   216  }
   217  
   218  type BillingGroupMap map[string]BillingGroupInput
   219  
   220  func (BillingGroupMap) ElementType() reflect.Type {
   221  	return reflect.TypeOf((*map[string]*BillingGroup)(nil)).Elem()
   222  }
   223  
   224  func (i BillingGroupMap) ToBillingGroupMapOutput() BillingGroupMapOutput {
   225  	return i.ToBillingGroupMapOutputWithContext(context.Background())
   226  }
   227  
   228  func (i BillingGroupMap) ToBillingGroupMapOutputWithContext(ctx context.Context) BillingGroupMapOutput {
   229  	return pulumi.ToOutputWithContext(ctx, i).(BillingGroupMapOutput)
   230  }
   231  
   232  type BillingGroupOutput struct{ *pulumi.OutputState }
   233  
   234  func (BillingGroupOutput) ElementType() reflect.Type {
   235  	return reflect.TypeOf((**BillingGroup)(nil)).Elem()
   236  }
   237  
   238  func (o BillingGroupOutput) ToBillingGroupOutput() BillingGroupOutput {
   239  	return o
   240  }
   241  
   242  func (o BillingGroupOutput) ToBillingGroupOutputWithContext(ctx context.Context) BillingGroupOutput {
   243  	return o
   244  }
   245  
   246  // The ARN of the Billing Group.
   247  func (o BillingGroupOutput) Arn() pulumi.StringOutput {
   248  	return o.ApplyT(func(v *BillingGroup) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   249  }
   250  
   251  func (o BillingGroupOutput) Metadatas() BillingGroupMetadataArrayOutput {
   252  	return o.ApplyT(func(v *BillingGroup) BillingGroupMetadataArrayOutput { return v.Metadatas }).(BillingGroupMetadataArrayOutput)
   253  }
   254  
   255  // The name of the Billing Group.
   256  func (o BillingGroupOutput) Name() pulumi.StringOutput {
   257  	return o.ApplyT(func(v *BillingGroup) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
   258  }
   259  
   260  // The Billing Group properties. Defined below.
   261  func (o BillingGroupOutput) Properties() BillingGroupPropertiesPtrOutput {
   262  	return o.ApplyT(func(v *BillingGroup) BillingGroupPropertiesPtrOutput { return v.Properties }).(BillingGroupPropertiesPtrOutput)
   263  }
   264  
   265  // Key-value mapping of resource tags
   266  func (o BillingGroupOutput) Tags() pulumi.StringMapOutput {
   267  	return o.ApplyT(func(v *BillingGroup) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   268  }
   269  
   270  // Deprecated: Please use `tags` instead.
   271  func (o BillingGroupOutput) TagsAll() pulumi.StringMapOutput {
   272  	return o.ApplyT(func(v *BillingGroup) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   273  }
   274  
   275  // The current version of the Billing Group record in the registry.
   276  func (o BillingGroupOutput) Version() pulumi.IntOutput {
   277  	return o.ApplyT(func(v *BillingGroup) pulumi.IntOutput { return v.Version }).(pulumi.IntOutput)
   278  }
   279  
   280  type BillingGroupArrayOutput struct{ *pulumi.OutputState }
   281  
   282  func (BillingGroupArrayOutput) ElementType() reflect.Type {
   283  	return reflect.TypeOf((*[]*BillingGroup)(nil)).Elem()
   284  }
   285  
   286  func (o BillingGroupArrayOutput) ToBillingGroupArrayOutput() BillingGroupArrayOutput {
   287  	return o
   288  }
   289  
   290  func (o BillingGroupArrayOutput) ToBillingGroupArrayOutputWithContext(ctx context.Context) BillingGroupArrayOutput {
   291  	return o
   292  }
   293  
   294  func (o BillingGroupArrayOutput) Index(i pulumi.IntInput) BillingGroupOutput {
   295  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *BillingGroup {
   296  		return vs[0].([]*BillingGroup)[vs[1].(int)]
   297  	}).(BillingGroupOutput)
   298  }
   299  
   300  type BillingGroupMapOutput struct{ *pulumi.OutputState }
   301  
   302  func (BillingGroupMapOutput) ElementType() reflect.Type {
   303  	return reflect.TypeOf((*map[string]*BillingGroup)(nil)).Elem()
   304  }
   305  
   306  func (o BillingGroupMapOutput) ToBillingGroupMapOutput() BillingGroupMapOutput {
   307  	return o
   308  }
   309  
   310  func (o BillingGroupMapOutput) ToBillingGroupMapOutputWithContext(ctx context.Context) BillingGroupMapOutput {
   311  	return o
   312  }
   313  
   314  func (o BillingGroupMapOutput) MapIndex(k pulumi.StringInput) BillingGroupOutput {
   315  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *BillingGroup {
   316  		return vs[0].(map[string]*BillingGroup)[vs[1].(string)]
   317  	}).(BillingGroupOutput)
   318  }
   319  
   320  func init() {
   321  	pulumi.RegisterInputType(reflect.TypeOf((*BillingGroupInput)(nil)).Elem(), &BillingGroup{})
   322  	pulumi.RegisterInputType(reflect.TypeOf((*BillingGroupArrayInput)(nil)).Elem(), BillingGroupArray{})
   323  	pulumi.RegisterInputType(reflect.TypeOf((*BillingGroupMapInput)(nil)).Elem(), BillingGroupMap{})
   324  	pulumi.RegisterOutputType(BillingGroupOutput{})
   325  	pulumi.RegisterOutputType(BillingGroupArrayOutput{})
   326  	pulumi.RegisterOutputType(BillingGroupMapOutput{})
   327  }