Module billing

This page documents the language specification for the gcp package. If you're looking for help working with the inputs, outputs, or functions of gcp resources in a Pulumi program, please see the resource documentation for examples and API reference.

Resources

Others

Resources

Resource AccountIamBinding

class AccountIamBinding extends CustomResource

Allows creation and management of a single binding within IAM policy for an existing Google Cloud Platform Billing Account.

Note: This resource must not be used in conjunction with gcp.billing.AccountIamMember for the same role or they will fight over what your policy should be.

Note: On create, this resource will overwrite members of any existing roles. Use pulumi import and inspect the output to ensure your existing members are preserved.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const binding = new gcp.billing.AccountIamBinding("binding", {
    billingAccountId: "00AA00-000AAA-00AA0A",
    members: ["user:alice@gmail.com"],
    role: "roles/billing.viewer",
});

constructor

new AccountIamBinding(name: string, args: AccountIamBindingArgs, opts?: pulumi.CustomResourceOptions)

Create a AccountIamBinding resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: AccountIamBindingState, opts?: pulumi.CustomResourceOptions): AccountIamBinding

Get an existing AccountIamBinding resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): obj is AccountIamBinding

Returns true if the given object is an instance of AccountIamBinding. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property billingAccountId

public billingAccountId: pulumi.Output<string>;

The billing account id.

property condition

public condition: pulumi.Output<AccountIamBindingCondition | undefined>;

property etag

public etag: pulumi.Output<string>;

(Computed) The etag of the billing account’s IAM policy.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property members

public members: pulumi.Output<string[]>;

A list of users that the role should apply to. For more details on format and restrictions see https://cloud.google.com/billing/reference/rest/v1/Policy#Binding

property role

public role: pulumi.Output<string>;

The role that should be applied.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

Resource AccountIamMember

class AccountIamMember extends CustomResource

Allows creation and management of a single member for a single binding within the IAM policy for an existing Google Cloud Platform Billing Account.

Note: This resource must not be used in conjunction with gcp.billing.AccountIamBinding for the same role or they will fight over what your policy should be.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const binding = new gcp.billing.AccountIamMember("binding", {
    billingAccountId: "00AA00-000AAA-00AA0A",
    member: "user:alice@gmail.com",
    role: "roles/billing.viewer",
});

constructor

new AccountIamMember(name: string, args: AccountIamMemberArgs, opts?: pulumi.CustomResourceOptions)

Create a AccountIamMember resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: AccountIamMemberState, opts?: pulumi.CustomResourceOptions): AccountIamMember

Get an existing AccountIamMember resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): obj is AccountIamMember

Returns true if the given object is an instance of AccountIamMember. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property billingAccountId

public billingAccountId: pulumi.Output<string>;

The billing account id.

property condition

public condition: pulumi.Output<AccountIamMemberCondition | undefined>;

property etag

public etag: pulumi.Output<string>;

(Computed) The etag of the billing account’s IAM policy.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property member

public member: pulumi.Output<string>;

The user that the role should apply to. For more details on format and restrictions see https://cloud.google.com/billing/reference/rest/v1/Policy#Binding

property role

public role: pulumi.Output<string>;

The role that should be applied.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

Resource AccountIamPolicy

class AccountIamPolicy extends CustomResource

Allows management of the entire IAM policy for an existing Google Cloud Platform Billing Account.

Warning: Billing accounts have a default user that can be overwritten by use of this resource. The safest alternative is to use multiple gcp.billing.AccountIamBinding resources. If you do use this resource, the best way to be sure that you are not making dangerous changes is to start by importing your existing policy, and examining the diff very closely.

Note: This resource must not be used in conjunction with gcp.billing.AccountIamMember or gcp.billing.AccountIamBinding or they will fight over what your policy should be.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const admin = gcp.organizations.getIAMPolicy({
    binding: [{
        role: "roles/billing.viewer",
        members: ["user:jane@example.com"],
    }],
});
const policy = new gcp.billing.AccountIamPolicy("policy", {
    billingAccountId: "00AA00-000AAA-00AA0A",
    policyData: admin.then(admin => admin.policyData),
});

constructor

new AccountIamPolicy(name: string, args: AccountIamPolicyArgs, opts?: pulumi.CustomResourceOptions)

Create a AccountIamPolicy resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: AccountIamPolicyState, opts?: pulumi.CustomResourceOptions): AccountIamPolicy

Get an existing AccountIamPolicy resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): obj is AccountIamPolicy

Returns true if the given object is an instance of AccountIamPolicy. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property billingAccountId

public billingAccountId: pulumi.Output<string>;

The billing account id.

property etag

public etag: pulumi.Output<string>;

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property policyData

public policyData: pulumi.Output<string>;

The gcp.organizations.getIAMPolicy data source that represents the IAM policy that will be applied to the billing account. This policy overrides any existing policy applied to the billing account.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

Resource Budget

class Budget extends CustomResource

Budget configuration for a billing account.

To get more information about Budget, see:

Example Usage - Billing Budget Basic

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const account = gcp.organizations.getBillingAccount({
    billingAccount: "000000-0000000-0000000-000000",
});
const budget = new gcp.billing.Budget("budget", {
    billingAccount: account.then(account => account.id),
    displayName: "Example Billing Budget",
    amount: {
        specified_amount: {
            currencyCode: "USD",
            units: "100000",
        },
    },
    threshold_rules: [{
        thresholdPercent: 0.5,
    }],
});

Example Usage - Billing Budget Filter

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const account = gcp.organizations.getBillingAccount({
    billingAccount: "000000-0000000-0000000-000000",
});
const budget = new gcp.billing.Budget("budget", {
    billingAccount: account.then(account => account.id),
    displayName: "Example Billing Budget",
    budget_filter: {
        projects: ["projects/my-project-name"],
        creditTypesTreatment: "EXCLUDE_ALL_CREDITS",
        services: ["services/24E6-581D-38E5"],
    },
    amount: {
        specified_amount: {
            currencyCode: "USD",
            units: "100000",
        },
    },
    threshold_rules: [
        {
            thresholdPercent: 0.5,
        },
        {
            thresholdPercent: 0.9,
            spendBasis: "FORECASTED_SPEND",
        },
    ],
});

constructor

new Budget(name: string, args: BudgetArgs, opts?: pulumi.CustomResourceOptions)

Create a Budget resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: BudgetState, opts?: pulumi.CustomResourceOptions): Budget

Get an existing Budget resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): obj is Budget

Returns true if the given object is an instance of Budget. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property allUpdatesRule

public allUpdatesRule: pulumi.Output<BudgetAllUpdatesRule | undefined>;

Defines notifications that are sent on every update to the billing account’s spend, regardless of the thresholds defined using threshold rules. Structure is documented below.

property amount

public amount: pulumi.Output<BudgetAmount>;

The budgeted amount for each usage period. Structure is documented below.

property billingAccount

public billingAccount: pulumi.Output<string>;

ID of the billing account to set a budget on.

property budgetFilter

public budgetFilter: pulumi.Output<BudgetBudgetFilter | undefined>;

Filters that define which resources are used to compute the actual spend against the budget. Structure is documented below.

property displayName

public displayName: pulumi.Output<string | undefined>;

User data for display name in UI. Must be <= 60 chars.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property name

public name: pulumi.Output<string>;

Resource name of the budget. The resource name implies the scope of a budget. Values are of the form billingAccounts/{billingAccountId}/budgets/{budgetId}.

property thresholdRules

public thresholdRules: pulumi.Output<BudgetThresholdRule[]>;

Rules that trigger alerts (notifications of thresholds being crossed) when spend exceeds the specified percentages of the budget. Structure is documented below.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

Others

interface AccountIamBindingArgs

interface AccountIamBindingArgs

The set of arguments for constructing a AccountIamBinding resource.

property billingAccountId

billingAccountId: pulumi.Input<string>;

The billing account id.

property condition

condition?: pulumi.Input<AccountIamBindingCondition>;

property members

members: pulumi.Input<pulumi.Input<string>[]>;

A list of users that the role should apply to. For more details on format and restrictions see https://cloud.google.com/billing/reference/rest/v1/Policy#Binding

property role

role: pulumi.Input<string>;

The role that should be applied.

interface AccountIamBindingState

interface AccountIamBindingState

Input properties used for looking up and filtering AccountIamBinding resources.

property billingAccountId

billingAccountId?: pulumi.Input<string>;

The billing account id.

property condition

condition?: pulumi.Input<AccountIamBindingCondition>;

property etag

etag?: pulumi.Input<string>;

(Computed) The etag of the billing account’s IAM policy.

property members

members?: pulumi.Input<pulumi.Input<string>[]>;

A list of users that the role should apply to. For more details on format and restrictions see https://cloud.google.com/billing/reference/rest/v1/Policy#Binding

property role

role?: pulumi.Input<string>;

The role that should be applied.

interface AccountIamMemberArgs

interface AccountIamMemberArgs

The set of arguments for constructing a AccountIamMember resource.

property billingAccountId

billingAccountId: pulumi.Input<string>;

The billing account id.

property condition

condition?: pulumi.Input<AccountIamMemberCondition>;

property member

member: pulumi.Input<string>;

The user that the role should apply to. For more details on format and restrictions see https://cloud.google.com/billing/reference/rest/v1/Policy#Binding

property role

role: pulumi.Input<string>;

The role that should be applied.

interface AccountIamMemberState

interface AccountIamMemberState

Input properties used for looking up and filtering AccountIamMember resources.

property billingAccountId

billingAccountId?: pulumi.Input<string>;

The billing account id.

property condition

condition?: pulumi.Input<AccountIamMemberCondition>;

property etag

etag?: pulumi.Input<string>;

(Computed) The etag of the billing account’s IAM policy.

property member

member?: pulumi.Input<string>;

The user that the role should apply to. For more details on format and restrictions see https://cloud.google.com/billing/reference/rest/v1/Policy#Binding

property role

role?: pulumi.Input<string>;

The role that should be applied.

interface AccountIamPolicyArgs

interface AccountIamPolicyArgs

The set of arguments for constructing a AccountIamPolicy resource.

property billingAccountId

billingAccountId: pulumi.Input<string>;

The billing account id.

property policyData

policyData: pulumi.Input<string>;

The gcp.organizations.getIAMPolicy data source that represents the IAM policy that will be applied to the billing account. This policy overrides any existing policy applied to the billing account.

interface AccountIamPolicyState

interface AccountIamPolicyState

Input properties used for looking up and filtering AccountIamPolicy resources.

property billingAccountId

billingAccountId?: pulumi.Input<string>;

The billing account id.

property etag

etag?: pulumi.Input<string>;

property policyData

policyData?: pulumi.Input<string>;

The gcp.organizations.getIAMPolicy data source that represents the IAM policy that will be applied to the billing account. This policy overrides any existing policy applied to the billing account.

interface BudgetArgs

interface BudgetArgs

The set of arguments for constructing a Budget resource.

property allUpdatesRule

allUpdatesRule?: pulumi.Input<BudgetAllUpdatesRule>;

Defines notifications that are sent on every update to the billing account’s spend, regardless of the thresholds defined using threshold rules. Structure is documented below.

property amount

amount: pulumi.Input<BudgetAmount>;

The budgeted amount for each usage period. Structure is documented below.

property billingAccount

billingAccount: pulumi.Input<string>;

ID of the billing account to set a budget on.

property budgetFilter

budgetFilter?: pulumi.Input<BudgetBudgetFilter>;

Filters that define which resources are used to compute the actual spend against the budget. Structure is documented below.

property displayName

displayName?: pulumi.Input<string>;

User data for display name in UI. Must be <= 60 chars.

property thresholdRules

thresholdRules: pulumi.Input<pulumi.Input<BudgetThresholdRule>[]>;

Rules that trigger alerts (notifications of thresholds being crossed) when spend exceeds the specified percentages of the budget. Structure is documented below.

interface BudgetState

interface BudgetState

Input properties used for looking up and filtering Budget resources.

property allUpdatesRule

allUpdatesRule?: pulumi.Input<BudgetAllUpdatesRule>;

Defines notifications that are sent on every update to the billing account’s spend, regardless of the thresholds defined using threshold rules. Structure is documented below.

property amount

amount?: pulumi.Input<BudgetAmount>;

The budgeted amount for each usage period. Structure is documented below.

property billingAccount

billingAccount?: pulumi.Input<string>;

ID of the billing account to set a budget on.

property budgetFilter

budgetFilter?: pulumi.Input<BudgetBudgetFilter>;

Filters that define which resources are used to compute the actual spend against the budget. Structure is documented below.

property displayName

displayName?: pulumi.Input<string>;

User data for display name in UI. Must be <= 60 chars.

property name

name?: pulumi.Input<string>;

Resource name of the budget. The resource name implies the scope of a budget. Values are of the form billingAccounts/{billingAccountId}/budgets/{budgetId}.

property thresholdRules

thresholdRules?: pulumi.Input<pulumi.Input<BudgetThresholdRule>[]>;

Rules that trigger alerts (notifications of thresholds being crossed) when spend exceeds the specified percentages of the budget. Structure is documented below.