1. Registry
  2. Packages
  3. Incapsula Provider
  4. API Docs
  5. getAccount
Viewing docs for incapsula 3.41.1
published on Thursday, Oct 29, 2026 by imperva
incapsula
Viewing docs for incapsula 3.41.1
published on Thursday, Oct 29, 2026 by imperva

    Finds an account below the current account by its name, so there is no need to hardcode account IDs.

    • When using reseller credentials, the reseller’s direct accounts are searched.
    • When using parent account credentials, its sub accounts are searched.

    The credentials must have one of the abilities canAccessSubAccounts, canManageAccountSubAccounts or canExportConfigurations.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as incapsula from "@pulumi/incapsula";
    
    const example = incapsula.getAccount({
        accountName: "My Sub Account",
    });
    const site = new incapsula.Site("site", {
        accountId: example.then(example => example.id),
        domain: "www.example.com",
    });
    
    import pulumi
    import pulumi_incapsula as incapsula
    
    example = incapsula.get_account(account_name="My Sub Account")
    site = incapsula.Site("site",
        account_id=example.id,
        domain="www.example.com")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/incapsula/v3/incapsula"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := incapsula.LookupAccount(ctx, &incapsula.LookupAccountArgs{
    			AccountName: "My Sub Account",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = incapsula.NewSite(ctx, "site", &incapsula.SiteArgs{
    			AccountId: pulumi.String(example.Id),
    			Domain:    pulumi.String("www.example.com"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Incapsula = Pulumi.Incapsula;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Incapsula.GetAccount.Invoke(new()
        {
            AccountName = "My Sub Account",
        });
    
        var site = new Incapsula.Site("site", new()
        {
            AccountId = example.Apply(getAccountResult => getAccountResult.Id),
            Domain = "www.example.com",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.incapsula.IncapsulaFunctions;
    import com.pulumi.incapsula.inputs.GetAccountArgs;
    import com.pulumi.incapsula.Site;
    import com.pulumi.incapsula.SiteArgs;
    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 = IncapsulaFunctions.getAccount(GetAccountArgs.builder()
                .accountName("My Sub Account")
                .build());
    
            var site = new Site("site", SiteArgs.builder()
                .accountId(example.id())
                .domain("www.example.com")
                .build());
    
        }
    }
    
    resources:
      site:
        type: incapsula:Site
        properties:
          accountId: ${example.id}
          domain: www.example.com
    variables:
      example:
        fn::invoke:
          function: incapsula:getAccount
          arguments:
            accountName: My Sub Account
    
    Example coming soon!
    

    Using getAccount

    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 getAccount(args: GetAccountArgs, opts?: InvokeOptions): Promise<GetAccountResult>
    function getAccountOutput(args: GetAccountOutputArgs, opts?: InvokeOutputOptions): Output<GetAccountResult>
    def get_account(account_name: Optional[str] = None,
                    id: Optional[str] = None,
                    opts: Optional[InvokeOptions] = None) -> GetAccountResult
    def get_account_output(account_name: pulumi.Input[Optional[str]] = None,
                    id: pulumi.Input[Optional[str]] = None,
                    opts: Optional[InvokeOutputOptions] = None) -> Output[GetAccountResult]
    func LookupAccount(ctx *Context, args *LookupAccountArgs, opts ...InvokeOption) (*LookupAccountResult, error)
    func LookupAccountOutput(ctx *Context, args *LookupAccountOutputArgs, opts ...InvokeOption) LookupAccountResultOutput

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

    public static class GetAccount 
    {
        public static Task<GetAccountResult> InvokeAsync(GetAccountArgs args, InvokeOptions? opts = null)
        public static Output<GetAccountResult> Invoke(GetAccountInvokeArgs args, InvokeOptions? opts = null)
        public static Output<GetAccountResult> Invoke(GetAccountInvokeArgs args, InvokeOutputOptions opts)
    }
    public static CompletableFuture<GetAccountResult> getAccount(GetAccountArgs args, InvokeOptions options)
    public static Output<GetAccountResult> getAccount(GetAccountArgs args, InvokeOptions options)
    public static Output<GetAccountResult> getAccount(GetAccountArgs args, InvokeOutputOptions options)
    
    fn::invoke:
      function: incapsula:index/getAccount:getAccount
      arguments:
        # arguments dictionary
    data "incapsula_get_account" "name" {
        # arguments
    }

    The following arguments are supported:

    AccountName string
    The name of the account to find. Matching is case-insensitive; the value is not trimmed. The data source fails if no account matches, or if more than one account matches (the matching account IDs are listed in the error).
    Id string
    The ID of the account.
    AccountName string
    The name of the account to find. Matching is case-insensitive; the value is not trimmed. The data source fails if no account matches, or if more than one account matches (the matching account IDs are listed in the error).
    Id string
    The ID of the account.
    account_name string
    The name of the account to find. Matching is case-insensitive; the value is not trimmed. The data source fails if no account matches, or if more than one account matches (the matching account IDs are listed in the error).
    id string
    The ID of the account.
    accountName String
    The name of the account to find. Matching is case-insensitive; the value is not trimmed. The data source fails if no account matches, or if more than one account matches (the matching account IDs are listed in the error).
    id String
    The ID of the account.
    accountName string
    The name of the account to find. Matching is case-insensitive; the value is not trimmed. The data source fails if no account matches, or if more than one account matches (the matching account IDs are listed in the error).
    id string
    The ID of the account.
    account_name str
    The name of the account to find. Matching is case-insensitive; the value is not trimmed. The data source fails if no account matches, or if more than one account matches (the matching account IDs are listed in the error).
    id str
    The ID of the account.
    accountName String
    The name of the account to find. Matching is case-insensitive; the value is not trimmed. The data source fails if no account matches, or if more than one account matches (the matching account IDs are listed in the error).
    id String
    The ID of the account.

    getAccount Result

    The following output properties are available:

    AccountId string
    The ID of the account.
    AccountName string
    The name of the account, as returned by the API.
    Id string
    The ID of the account.
    ParentId string
    The ID of the parent account.
    AccountId string
    The ID of the account.
    AccountName string
    The name of the account, as returned by the API.
    Id string
    The ID of the account.
    ParentId string
    The ID of the parent account.
    account_id string
    The ID of the account.
    account_name string
    The name of the account, as returned by the API.
    id string
    The ID of the account.
    parent_id string
    The ID of the parent account.
    accountId String
    The ID of the account.
    accountName String
    The name of the account, as returned by the API.
    id String
    The ID of the account.
    parentId String
    The ID of the parent account.
    accountId string
    The ID of the account.
    accountName string
    The name of the account, as returned by the API.
    id string
    The ID of the account.
    parentId string
    The ID of the parent account.
    account_id str
    The ID of the account.
    account_name str
    The name of the account, as returned by the API.
    id str
    The ID of the account.
    parent_id str
    The ID of the parent account.
    accountId String
    The ID of the account.
    accountName String
    The name of the account, as returned by the API.
    id String
    The ID of the account.
    parentId String
    The ID of the parent account.

    Package Details

    Repository
    incapsula imperva/terraform-provider-incapsula
    License
    Notes
    This Pulumi package is based on the incapsula Terraform Provider.
    incapsula
    Viewing docs for incapsula 3.41.1
    published on Thursday, Oct 29, 2026 by imperva

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial