1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. billing
  5. getAccountIamPolicy
Google Cloud v9.4.0 published on Tuesday, Nov 4, 2025 by Pulumi

gcp.billing.getAccountIamPolicy

Start a Neo task
Explain and create a gcp.billing.getAccountIamPolicy resource
gcp logo
Google Cloud v9.4.0 published on Tuesday, Nov 4, 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",
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    policy = gcp.billing.get_account_iam_policy(billing_account_id="MEEP-MEEP-MEEP-MEEP-MEEP")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v9/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
    	})
    }
    
    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",
        });
    
    });
    
    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());
    
        }
    }
    
    variables:
      policy:
        fn::invoke:
          function: gcp:billing:getAccountIamPolicy
          arguments:
            billingAccountId: MEEP-MEEP-MEEP-MEEP-MEEP
    

    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>
    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]
    func LookupAccountIamPolicy(ctx *Context, args *LookupAccountIamPolicyArgs, opts ...InvokeOption) (*LookupAccountIamPolicyResult, error)
    func LookupAccountIamPolicyOutput(ctx *Context, args *LookupAccountIamPolicyOutputArgs, opts ...InvokeOption) LookupAccountIamPolicyResultOutput

    > 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)
    }
    public static CompletableFuture<GetAccountIamPolicyResult> getAccountIamPolicy(GetAccountIamPolicyArgs args, InvokeOptions options)
    public static Output<GetAccountIamPolicyResult> getAccountIamPolicy(GetAccountIamPolicyArgs args, InvokeOptions options)
    
    fn::invoke:
      function: gcp:billing/getAccountIamPolicy:getAccountIamPolicy
      arguments:
        # arguments dictionary

    The following arguments are supported:

    BillingAccountId string
    The billing account id.
    BillingAccountId string
    The billing account id.
    billingAccountId String
    The billing account id.
    billingAccountId string
    The billing account id.
    billing_account_id str
    The billing account id.
    billingAccountId 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.
    gcp logo
    Google Cloud v9.4.0 published on Tuesday, Nov 4, 2025 by Pulumi
      Meet Neo: Your AI Platform Teammate