1. Packages
  2. Cloudflare Provider
  3. API Docs
  4. Account
Cloudflare v5.42.0 published on Thursday, Oct 31, 2024 by Pulumi

cloudflare.Account

Explore with Pulumi AI

cloudflare logo
Cloudflare v5.42.0 published on Thursday, Oct 31, 2024 by Pulumi

    Provides a Cloudflare Account resource. Account is the basic resource for working with Cloudflare zones, teams and users.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as cloudflare from "@pulumi/cloudflare";
    
    const example = new cloudflare.Account("example", {
        name: "some-enterprise-account",
        type: "enterprise",
        enforceTwofactor: true,
    });
    
    import pulumi
    import pulumi_cloudflare as cloudflare
    
    example = cloudflare.Account("example",
        name="some-enterprise-account",
        type="enterprise",
        enforce_twofactor=True)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-cloudflare/sdk/v5/go/cloudflare"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := cloudflare.NewAccount(ctx, "example", &cloudflare.AccountArgs{
    			Name:             pulumi.String("some-enterprise-account"),
    			Type:             pulumi.String("enterprise"),
    			EnforceTwofactor: pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Cloudflare = Pulumi.Cloudflare;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Cloudflare.Account("example", new()
        {
            Name = "some-enterprise-account",
            Type = "enterprise",
            EnforceTwofactor = true,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.cloudflare.Account;
    import com.pulumi.cloudflare.AccountArgs;
    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 Account("example", AccountArgs.builder()
                .name("some-enterprise-account")
                .type("enterprise")
                .enforceTwofactor(true)
                .build());
    
        }
    }
    
    resources:
      example:
        type: cloudflare:Account
        properties:
          name: some-enterprise-account
          type: enterprise
          enforceTwofactor: true
    

    Create Account Resource

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

    Constructor syntax

    new Account(name: string, args: AccountArgs, opts?: CustomResourceOptions);
    @overload
    def Account(resource_name: str,
                args: AccountArgs,
                opts: Optional[ResourceOptions] = None)
    
    @overload
    def Account(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                name: Optional[str] = None,
                enforce_twofactor: Optional[bool] = None,
                type: Optional[str] = None)
    func NewAccount(ctx *Context, name string, args AccountArgs, opts ...ResourceOption) (*Account, error)
    public Account(string name, AccountArgs args, CustomResourceOptions? opts = null)
    public Account(String name, AccountArgs args)
    public Account(String name, AccountArgs args, CustomResourceOptions options)
    
    type: cloudflare:Account
    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 AccountArgs
    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 AccountArgs
    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 AccountArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args AccountArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args AccountArgs
    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 accountResource = new Cloudflare.Account("accountResource", new()
    {
        Name = "string",
        EnforceTwofactor = false,
        Type = "string",
    });
    
    example, err := cloudflare.NewAccount(ctx, "accountResource", &cloudflare.AccountArgs{
    	Name:             pulumi.String("string"),
    	EnforceTwofactor: pulumi.Bool(false),
    	Type:             pulumi.String("string"),
    })
    
    var accountResource = new Account("accountResource", AccountArgs.builder()
        .name("string")
        .enforceTwofactor(false)
        .type("string")
        .build());
    
    account_resource = cloudflare.Account("accountResource",
        name="string",
        enforce_twofactor=False,
        type="string")
    
    const accountResource = new cloudflare.Account("accountResource", {
        name: "string",
        enforceTwofactor: false,
        type: "string",
    });
    
    type: cloudflare:Account
    properties:
        enforceTwofactor: false
        name: string
        type: string
    

    Account 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 Account resource accepts the following input properties:

    Name string
    The name of the account that is displayed in the Cloudflare dashboard.
    EnforceTwofactor bool
    Whether 2FA is enforced on the account. Defaults to false.
    Type string
    Account type. Available values: enterprise, standard. Defaults to standard. Modifying this attribute will force creation of a new resource.
    Name string
    The name of the account that is displayed in the Cloudflare dashboard.
    EnforceTwofactor bool
    Whether 2FA is enforced on the account. Defaults to false.
    Type string
    Account type. Available values: enterprise, standard. Defaults to standard. Modifying this attribute will force creation of a new resource.
    name String
    The name of the account that is displayed in the Cloudflare dashboard.
    enforceTwofactor Boolean
    Whether 2FA is enforced on the account. Defaults to false.
    type String
    Account type. Available values: enterprise, standard. Defaults to standard. Modifying this attribute will force creation of a new resource.
    name string
    The name of the account that is displayed in the Cloudflare dashboard.
    enforceTwofactor boolean
    Whether 2FA is enforced on the account. Defaults to false.
    type string
    Account type. Available values: enterprise, standard. Defaults to standard. Modifying this attribute will force creation of a new resource.
    name str
    The name of the account that is displayed in the Cloudflare dashboard.
    enforce_twofactor bool
    Whether 2FA is enforced on the account. Defaults to false.
    type str
    Account type. Available values: enterprise, standard. Defaults to standard. Modifying this attribute will force creation of a new resource.
    name String
    The name of the account that is displayed in the Cloudflare dashboard.
    enforceTwofactor Boolean
    Whether 2FA is enforced on the account. Defaults to false.
    type String
    Account type. Available values: enterprise, standard. Defaults to standard. Modifying this attribute will force creation of a new resource.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing Account Resource

    Get an existing Account 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?: AccountState, opts?: CustomResourceOptions): Account
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            enforce_twofactor: Optional[bool] = None,
            name: Optional[str] = None,
            type: Optional[str] = None) -> Account
    func GetAccount(ctx *Context, name string, id IDInput, state *AccountState, opts ...ResourceOption) (*Account, error)
    public static Account Get(string name, Input<string> id, AccountState? state, CustomResourceOptions? opts = null)
    public static Account get(String name, Output<String> id, AccountState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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:
    EnforceTwofactor bool
    Whether 2FA is enforced on the account. Defaults to false.
    Name string
    The name of the account that is displayed in the Cloudflare dashboard.
    Type string
    Account type. Available values: enterprise, standard. Defaults to standard. Modifying this attribute will force creation of a new resource.
    EnforceTwofactor bool
    Whether 2FA is enforced on the account. Defaults to false.
    Name string
    The name of the account that is displayed in the Cloudflare dashboard.
    Type string
    Account type. Available values: enterprise, standard. Defaults to standard. Modifying this attribute will force creation of a new resource.
    enforceTwofactor Boolean
    Whether 2FA is enforced on the account. Defaults to false.
    name String
    The name of the account that is displayed in the Cloudflare dashboard.
    type String
    Account type. Available values: enterprise, standard. Defaults to standard. Modifying this attribute will force creation of a new resource.
    enforceTwofactor boolean
    Whether 2FA is enforced on the account. Defaults to false.
    name string
    The name of the account that is displayed in the Cloudflare dashboard.
    type string
    Account type. Available values: enterprise, standard. Defaults to standard. Modifying this attribute will force creation of a new resource.
    enforce_twofactor bool
    Whether 2FA is enforced on the account. Defaults to false.
    name str
    The name of the account that is displayed in the Cloudflare dashboard.
    type str
    Account type. Available values: enterprise, standard. Defaults to standard. Modifying this attribute will force creation of a new resource.
    enforceTwofactor Boolean
    Whether 2FA is enforced on the account. Defaults to false.
    name String
    The name of the account that is displayed in the Cloudflare dashboard.
    type String
    Account type. Available values: enterprise, standard. Defaults to standard. Modifying this attribute will force creation of a new resource.

    Import

    $ pulumi import cloudflare:index/account:Account example <account_id>
    

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

    Package Details

    Repository
    Cloudflare pulumi/pulumi-cloudflare
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the cloudflare Terraform Provider.
    cloudflare logo
    Cloudflare v5.42.0 published on Thursday, Oct 31, 2024 by Pulumi