1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. billing
  5. getAccountIamPolicy
Google Cloud v8.23.0 published on Monday, Mar 24, 2025 by Pulumi

gcp.billing.getAccountIamPolicy

Explore with Pulumi AI

Google Cloud v8.23.0 published on Monday, Mar 24, 2025 by Pulumi

Retrieves the current IAM policy data for a Billing Account.

example

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

const policy = gcp.billing.getAccountIamPolicy({
    billingAccountId: "MEEP-MEEP-MEEP-MEEP-MEEP",
});
Copy
import pulumi
import pulumi_gcp as gcp

policy = gcp.billing.get_account_iam_policy(billing_account_id="MEEP-MEEP-MEEP-MEEP-MEEP")
Copy
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/billing"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := billing.LookupAccountIamPolicy(ctx, &billing.LookupAccountIamPolicyArgs{
			BillingAccountId: "MEEP-MEEP-MEEP-MEEP-MEEP",
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var policy = Gcp.Billing.GetAccountIamPolicy.Invoke(new()
    {
        BillingAccountId = "MEEP-MEEP-MEEP-MEEP-MEEP",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.billing.BillingFunctions;
import com.pulumi.gcp.billing.inputs.GetAccountIamPolicyArgs;
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 policy = BillingFunctions.getAccountIamPolicy(GetAccountIamPolicyArgs.builder()
            .billingAccountId("MEEP-MEEP-MEEP-MEEP-MEEP")
            .build());

    }
}
Copy
variables:
  policy:
    fn::invoke:
      function: gcp:billing:getAccountIamPolicy
      arguments:
        billingAccountId: MEEP-MEEP-MEEP-MEEP-MEEP
Copy

Using getAccountIamPolicy

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 getAccountIamPolicy(args: GetAccountIamPolicyArgs, opts?: InvokeOptions): Promise<GetAccountIamPolicyResult>
function getAccountIamPolicyOutput(args: GetAccountIamPolicyOutputArgs, opts?: InvokeOptions): Output<GetAccountIamPolicyResult>
Copy
def get_account_iam_policy(billing_account_id: Optional[str] = None,
                           opts: Optional[InvokeOptions] = None) -> GetAccountIamPolicyResult
def get_account_iam_policy_output(billing_account_id: Optional[pulumi.Input[str]] = None,
                           opts: Optional[InvokeOptions] = None) -> Output[GetAccountIamPolicyResult]
Copy
func LookupAccountIamPolicy(ctx *Context, args *LookupAccountIamPolicyArgs, opts ...InvokeOption) (*LookupAccountIamPolicyResult, error)
func LookupAccountIamPolicyOutput(ctx *Context, args *LookupAccountIamPolicyOutputArgs, opts ...InvokeOption) LookupAccountIamPolicyResultOutput
Copy

> Note: This function is named LookupAccountIamPolicy in the Go SDK.

public static class GetAccountIamPolicy 
{
    public static Task<GetAccountIamPolicyResult> InvokeAsync(GetAccountIamPolicyArgs args, InvokeOptions? opts = null)
    public static Output<GetAccountIamPolicyResult> Invoke(GetAccountIamPolicyInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetAccountIamPolicyResult> getAccountIamPolicy(GetAccountIamPolicyArgs args, InvokeOptions options)
public static Output<GetAccountIamPolicyResult> getAccountIamPolicy(GetAccountIamPolicyArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: gcp:billing/getAccountIamPolicy:getAccountIamPolicy
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

BillingAccountId
This property is required.
Changes to this property will trigger replacement.
string
The billing account id.
BillingAccountId
This property is required.
Changes to this property will trigger replacement.
string
The billing account id.
billingAccountId
This property is required.
Changes to this property will trigger replacement.
String
The billing account id.
billingAccountId
This property is required.
Changes to this property will trigger replacement.
string
The billing account id.
billing_account_id
This property is required.
Changes to this property will trigger replacement.
str
The billing account id.
billingAccountId
This property is required.
Changes to this property will trigger replacement.
String
The billing account id.

getAccountIamPolicy Result

The following output properties are available:

BillingAccountId string
Etag string
(Computed) The etag of the IAM policy.
Id string
The provider-assigned unique ID for this managed resource.
PolicyData string
(Computed) The policy data
BillingAccountId string
Etag string
(Computed) The etag of the IAM policy.
Id string
The provider-assigned unique ID for this managed resource.
PolicyData string
(Computed) The policy data
billingAccountId String
etag String
(Computed) The etag of the IAM policy.
id String
The provider-assigned unique ID for this managed resource.
policyData String
(Computed) The policy data
billingAccountId string
etag string
(Computed) The etag of the IAM policy.
id string
The provider-assigned unique ID for this managed resource.
policyData string
(Computed) The policy data
billing_account_id str
etag str
(Computed) The etag of the IAM policy.
id str
The provider-assigned unique ID for this managed resource.
policy_data str
(Computed) The policy data
billingAccountId String
etag String
(Computed) The etag of the IAM policy.
id String
The provider-assigned unique ID for this managed resource.
policyData String
(Computed) The policy data

Package Details

Repository
Google Cloud (GCP) Classic pulumi/pulumi-gcp
License
Apache-2.0
Notes
This Pulumi package is based on the google-beta Terraform Provider.
Google Cloud v8.23.0 published on Monday, Mar 24, 2025 by Pulumi