1. Packages
  2. Packages
  3. AWS
  4. API Docs
  5. securityhub
  6. AccountV2
Viewing docs for AWS v7.28.0
published on Thursday, Apr 30, 2026 by Pulumi
aws logo
Viewing docs for AWS v7.28.0
published on Thursday, Apr 30, 2026 by Pulumi

    Enables the unified Security Hub V2 for this AWS account.

    NOTE: Destroying this resource will disable Security Hub V2 for this AWS account.

    NOTE: This resource manages the unified Security Hub V2 service, which is distinct from the classic Security Hub CSPM managed by aws.securityhub.Account. Both can coexist in the same account.

    Example Usage

    Basic

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.securityhub.AccountV2("example", {});
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.securityhub.AccountV2("example")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/securityhub"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := securityhub.NewAccountV2(ctx, "example", nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Aws.SecurityHub.AccountV2("example");
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.securityhub.AccountV2;
    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) {
            var example = new AccountV2("example");
    
        }
    }
    
    resources:
      example:
        type: aws:securityhub:AccountV2
    

    With Tags

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.securityhub.AccountV2("example", {tags: {
        Environment: "production",
    }});
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.securityhub.AccountV2("example", tags={
        "Environment": "production",
    })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/securityhub"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := securityhub.NewAccountV2(ctx, "example", &securityhub.AccountV2Args{
    			Tags: pulumi.StringMap{
    				"Environment": pulumi.String("production"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Aws.SecurityHub.AccountV2("example", new()
        {
            Tags = 
            {
                { "Environment", "production" },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.securityhub.AccountV2;
    import com.pulumi.aws.securityhub.AccountV2Args;
    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) {
            var example = new AccountV2("example", AccountV2Args.builder()
                .tags(Map.of("Environment", "production"))
                .build());
    
        }
    }
    
    resources:
      example:
        type: aws:securityhub:AccountV2
        properties:
          tags:
            Environment: production
    

    Create AccountV2 Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new AccountV2(name: string, args?: AccountV2Args, opts?: CustomResourceOptions);
    @overload
    def AccountV2(resource_name: str,
                  args: Optional[AccountV2Args] = None,
                  opts: Optional[ResourceOptions] = None)
    
    @overload
    def AccountV2(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  region: Optional[str] = None,
                  tags: Optional[Mapping[str, str]] = None)
    func NewAccountV2(ctx *Context, name string, args *AccountV2Args, opts ...ResourceOption) (*AccountV2, error)
    public AccountV2(string name, AccountV2Args? args = null, CustomResourceOptions? opts = null)
    public AccountV2(String name, AccountV2Args args)
    public AccountV2(String name, AccountV2Args args, CustomResourceOptions options)
    
    type: aws:securityhub:AccountV2
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args AccountV2Args
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args AccountV2Args
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args AccountV2Args
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args AccountV2Args
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args AccountV2Args
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var accountV2Resource = new Aws.SecurityHub.AccountV2("accountV2Resource", new()
    {
        Region = "string",
        Tags = 
        {
            { "string", "string" },
        },
    });
    
    example, err := securityhub.NewAccountV2(ctx, "accountV2Resource", &securityhub.AccountV2Args{
    	Region: pulumi.String("string"),
    	Tags: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    })
    
    var accountV2Resource = new AccountV2("accountV2Resource", AccountV2Args.builder()
        .region("string")
        .tags(Map.of("string", "string"))
        .build());
    
    account_v2_resource = aws.securityhub.AccountV2("accountV2Resource",
        region="string",
        tags={
            "string": "string",
        })
    
    const accountV2Resource = new aws.securityhub.AccountV2("accountV2Resource", {
        region: "string",
        tags: {
            string: "string",
        },
    });
    
    type: aws:securityhub:AccountV2
    properties:
        region: string
        tags:
            string: string
    

    AccountV2 Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The AccountV2 resource accepts the following input properties:

    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    Tags Dictionary<string, string>
    Map of tags to assign to the resource. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    Tags map[string]string
    Map of tags to assign to the resource. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    tags Map<String,String>
    Map of tags to assign to the resource. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    tags {[key: string]: string}
    Map of tags to assign to the resource. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    region str
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    tags Mapping[str, str]
    Map of tags to assign to the resource. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    tags Map<String>
    Map of tags to assign to the resource. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the AccountV2 resource produces the following output properties:

    Arn string
    ARN of the Security Hub V2 resource created in the account.
    Id string
    The provider-assigned unique ID for this managed resource.
    TagsAll Dictionary<string, string>
    Map of tags assigned to the resource, including those inherited from the provider defaultTags configuration block.
    Arn string
    ARN of the Security Hub V2 resource created in the account.
    Id string
    The provider-assigned unique ID for this managed resource.
    TagsAll map[string]string
    Map of tags assigned to the resource, including those inherited from the provider defaultTags configuration block.
    arn String
    ARN of the Security Hub V2 resource created in the account.
    id String
    The provider-assigned unique ID for this managed resource.
    tagsAll Map<String,String>
    Map of tags assigned to the resource, including those inherited from the provider defaultTags configuration block.
    arn string
    ARN of the Security Hub V2 resource created in the account.
    id string
    The provider-assigned unique ID for this managed resource.
    tagsAll {[key: string]: string}
    Map of tags assigned to the resource, including those inherited from the provider defaultTags configuration block.
    arn str
    ARN of the Security Hub V2 resource created in the account.
    id str
    The provider-assigned unique ID for this managed resource.
    tags_all Mapping[str, str]
    Map of tags assigned to the resource, including those inherited from the provider defaultTags configuration block.
    arn String
    ARN of the Security Hub V2 resource created in the account.
    id String
    The provider-assigned unique ID for this managed resource.
    tagsAll Map<String>
    Map of tags assigned to the resource, including those inherited from the provider defaultTags configuration block.

    Look up Existing AccountV2 Resource

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

    public static get(name: string, id: Input<ID>, state?: AccountV2State, opts?: CustomResourceOptions): AccountV2
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            arn: Optional[str] = None,
            region: Optional[str] = None,
            tags: Optional[Mapping[str, str]] = None,
            tags_all: Optional[Mapping[str, str]] = None) -> AccountV2
    func GetAccountV2(ctx *Context, name string, id IDInput, state *AccountV2State, opts ...ResourceOption) (*AccountV2, error)
    public static AccountV2 Get(string name, Input<string> id, AccountV2State? state, CustomResourceOptions? opts = null)
    public static AccountV2 get(String name, Output<String> id, AccountV2State state, CustomResourceOptions options)
    resources:  _:    type: aws:securityhub:AccountV2    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    Arn string
    ARN of the Security Hub V2 resource created in the account.
    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    Tags Dictionary<string, string>
    Map of tags to assign to the resource. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    TagsAll Dictionary<string, string>
    Map of tags assigned to the resource, including those inherited from the provider defaultTags configuration block.
    Arn string
    ARN of the Security Hub V2 resource created in the account.
    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    Tags map[string]string
    Map of tags to assign to the resource. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    TagsAll map[string]string
    Map of tags assigned to the resource, including those inherited from the provider defaultTags configuration block.
    arn String
    ARN of the Security Hub V2 resource created in the account.
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    tags Map<String,String>
    Map of tags to assign to the resource. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    tagsAll Map<String,String>
    Map of tags assigned to the resource, including those inherited from the provider defaultTags configuration block.
    arn string
    ARN of the Security Hub V2 resource created in the account.
    region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    tags {[key: string]: string}
    Map of tags to assign to the resource. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    tagsAll {[key: string]: string}
    Map of tags assigned to the resource, including those inherited from the provider defaultTags configuration block.
    arn str
    ARN of the Security Hub V2 resource created in the account.
    region str
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    tags Mapping[str, str]
    Map of tags to assign to the resource. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    tags_all Mapping[str, str]
    Map of tags assigned to the resource, including those inherited from the provider defaultTags configuration block.
    arn String
    ARN of the Security Hub V2 resource created in the account.
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    tags Map<String>
    Map of tags to assign to the resource. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    tagsAll Map<String>
    Map of tags assigned to the resource, including those inherited from the provider defaultTags configuration block.

    Import

    Identity Schema

    Required

    • arn (String) Amazon Resource Name (ARN) of the Security Hub V2 resource.

    Using pulumi import, import Security Hub V2 accounts using arn. For example:

    $ pulumi import aws:securityhub/accountV2:AccountV2 example arn:aws:securityhub:us-west-2:123456789012:hubv2/25054a12-7926-47bc-924f-368e03d43e94
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo
    Viewing docs for AWS v7.28.0
    published on Thursday, Apr 30, 2026 by Pulumi
      Try Pulumi Cloud free. Your team will thank you.