Viewing docs for AWS v7.22.0
published on Wednesday, Mar 11, 2026 by Pulumi
published on Wednesday, Mar 11, 2026 by Pulumi
Viewing docs for AWS v7.22.0
published on Wednesday, Mar 11, 2026 by Pulumi
published on Wednesday, Mar 11, 2026 by Pulumi
Provides details about an AWS Billing Views.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = aws.billing.getViews({
billingViewTypes: ["PRIMARY"],
});
export const primaryViewArnByTypes = example.then(example => example.billingViews?.[0]?.arn);
import pulumi
import pulumi_aws as aws
example = aws.billing.get_views(billing_view_types=["PRIMARY"])
pulumi.export("primaryViewArnByTypes", example.billing_views[0].arn)
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/billing"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := billing.GetViews(ctx, &billing.GetViewsArgs{
BillingViewTypes: []string{
"PRIMARY",
},
}, nil)
if err != nil {
return err
}
ctx.Export("primaryViewArnByTypes", example.BillingViews[0].Arn)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = Aws.Billing.GetViews.Invoke(new()
{
BillingViewTypes = new[]
{
"PRIMARY",
},
});
return new Dictionary<string, object?>
{
["primaryViewArnByTypes"] = example.Apply(getViewsResult => getViewsResult.BillingViews[0]?.Arn),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.billing.BillingFunctions;
import com.pulumi.aws.billing.inputs.GetViewsArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var example = BillingFunctions.getViews(GetViewsArgs.builder()
.billingViewTypes("PRIMARY")
.build());
ctx.export("primaryViewArnByTypes", example.billingViews()[0].arn());
}
}
variables:
example:
fn::invoke:
function: aws:billing:getViews
arguments:
billingViewTypes:
- PRIMARY
outputs:
primaryViewArnByTypes: ${example.billingViews[0].arn}
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = aws.billing.getViews({});
export const viewArns = example.then(example => .map(view => (view.arn)));
export const primaryViewArnByName = example.then(example => .filter(view => view.name == "Primary View").map(view => (view.arn))[0]);
import pulumi
import pulumi_aws as aws
example = aws.billing.get_views()
pulumi.export("viewArns", [view.arn for view in example.billing_views])
pulumi.export("primaryViewArnByName", [view.arn for view in example.billing_views if view.name == "Primary View"][0])
Example coming soon!
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = Aws.Billing.GetViews.Invoke();
return new Dictionary<string, object?>
{
["viewArns"] = .Select(view =>
{
return view.Arn;
}).ToList(),
["primaryViewArnByName"] = .Where(view => view.Name == "Primary View").Select(view =>
{
return view.Arn;
}).ToList()[0],
};
});
Example coming soon!
Example coming soon!
Using getViews
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getViews(args: GetViewsArgs, opts?: InvokeOptions): Promise<GetViewsResult>
function getViewsOutput(args: GetViewsOutputArgs, opts?: InvokeOptions): Output<GetViewsResult>def get_views(billing_view_types: Optional[Sequence[str]] = None,
opts: Optional[InvokeOptions] = None) -> GetViewsResult
def get_views_output(billing_view_types: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetViewsResult]func GetViews(ctx *Context, args *GetViewsArgs, opts ...InvokeOption) (*GetViewsResult, error)
func GetViewsOutput(ctx *Context, args *GetViewsOutputArgs, opts ...InvokeOption) GetViewsResultOutput> Note: This function is named GetViews in the Go SDK.
public static class GetViews
{
public static Task<GetViewsResult> InvokeAsync(GetViewsArgs args, InvokeOptions? opts = null)
public static Output<GetViewsResult> Invoke(GetViewsInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetViewsResult> getViews(GetViewsArgs args, InvokeOptions options)
public static Output<GetViewsResult> getViews(GetViewsArgs args, InvokeOptions options)
fn::invoke:
function: aws:billing/getViews:getViews
arguments:
# arguments dictionaryThe following arguments are supported:
- Billing
View List<string>Types - List of billing view types to retrieve. Valid values are
PRIMARY,BILLING_GROUP,CUSTOM.
- Billing
View []stringTypes - List of billing view types to retrieve. Valid values are
PRIMARY,BILLING_GROUP,CUSTOM.
- billing
View List<String>Types - List of billing view types to retrieve. Valid values are
PRIMARY,BILLING_GROUP,CUSTOM.
- billing
View string[]Types - List of billing view types to retrieve. Valid values are
PRIMARY,BILLING_GROUP,CUSTOM.
- billing_
view_ Sequence[str]types - List of billing view types to retrieve. Valid values are
PRIMARY,BILLING_GROUP,CUSTOM.
- billing
View List<String>Types - List of billing view types to retrieve. Valid values are
PRIMARY,BILLING_GROUP,CUSTOM.
getViews Result
The following output properties are available:
- Billing
Views List<GetViews Billing View> - List of billing view objects with the following attributes:
- Id string
- The provider-assigned unique ID for this managed resource.
- Billing
View List<string>Types
- Billing
Views []GetViews Billing View - List of billing view objects with the following attributes:
- Id string
- The provider-assigned unique ID for this managed resource.
- Billing
View []stringTypes
- billing
Views List<GetViews Billing View> - List of billing view objects with the following attributes:
- id String
- The provider-assigned unique ID for this managed resource.
- billing
View List<String>Types
- billing
Views GetViews Billing View[] - List of billing view objects with the following attributes:
- id string
- The provider-assigned unique ID for this managed resource.
- billing
View string[]Types
- billing_
views Sequence[GetViews Billing View] - List of billing view objects with the following attributes:
- id str
- The provider-assigned unique ID for this managed resource.
- billing_
view_ Sequence[str]types
- billing
Views List<Property Map> - List of billing view objects with the following attributes:
- id String
- The provider-assigned unique ID for this managed resource.
- billing
View List<String>Types
Supporting Types
GetViewsBillingView
- Arn string
- ARN of the billing view.
- Billing
View stringType - Description string
- Description of the billing view.
- Name string
- Name of the billing view.
- Owner
Account stringId - Account ID of the billing view owner.
- Arn string
- ARN of the billing view.
- Billing
View stringType - Description string
- Description of the billing view.
- Name string
- Name of the billing view.
- Owner
Account stringId - Account ID of the billing view owner.
- arn String
- ARN of the billing view.
- billing
View StringType - description String
- Description of the billing view.
- name String
- Name of the billing view.
- owner
Account StringId - Account ID of the billing view owner.
- arn string
- ARN of the billing view.
- billing
View stringType - description string
- Description of the billing view.
- name string
- Name of the billing view.
- owner
Account stringId - Account ID of the billing view owner.
- arn str
- ARN of the billing view.
- billing_
view_ strtype - description str
- Description of the billing view.
- name str
- Name of the billing view.
- owner_
account_ strid - Account ID of the billing view owner.
- arn String
- ARN of the billing view.
- billing
View StringType - description String
- Description of the billing view.
- name String
- Name of the billing view.
- owner
Account StringId - Account ID of the billing view owner.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
awsTerraform Provider.
Viewing docs for AWS v7.22.0
published on Wednesday, Mar 11, 2026 by Pulumi
published on Wednesday, Mar 11, 2026 by Pulumi
