1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. hbr
  5. CrossAccount
Alibaba Cloud v3.74.0 published on Monday, Jan 27, 2025 by Pulumi

alicloud.hbr.CrossAccount

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.74.0 published on Monday, Jan 27, 2025 by Pulumi

    Provides a Hybrid Backup Recovery (HBR) Cross Account resource.

    The cross account is used for the cross-account backup in the Cloud Backup. The management account can back up the resources under the cross account.

    For information about Hybrid Backup Recovery (HBR) Cross Account and how to use it, see What is Cross Account.

    NOTE: Available since v1.241.0.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const config = new pulumi.Config();
    const name = config.get("name") || "terraform-example";
    const _default = new alicloud.hbr.CrossAccount("default", {
        crossAccountUserId: 1,
        crossAccountRoleName: name,
        alias: name,
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "terraform-example"
    default = alicloud.hbr.CrossAccount("default",
        cross_account_user_id=1,
        cross_account_role_name=name,
        alias=name)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/hbr"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		cfg := config.New(ctx, "")
    		name := "terraform-example"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		_, err := hbr.NewCrossAccount(ctx, "default", &hbr.CrossAccountArgs{
    			CrossAccountUserId:   pulumi.Int(1),
    			CrossAccountRoleName: pulumi.String(name),
    			Alias:                pulumi.String(name),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var name = config.Get("name") ?? "terraform-example";
        var @default = new AliCloud.Hbr.CrossAccount("default", new()
        {
            CrossAccountUserId = 1,
            CrossAccountRoleName = name,
            Alias = name,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.hbr.CrossAccount;
    import com.pulumi.alicloud.hbr.CrossAccountArgs;
    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 config = ctx.config();
            final var name = config.get("name").orElse("terraform-example");
            var default_ = new CrossAccount("default", CrossAccountArgs.builder()
                .crossAccountUserId("1")
                .crossAccountRoleName(name)
                .alias(name)
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: terraform-example
    resources:
      default:
        type: alicloud:hbr:CrossAccount
        properties:
          crossAccountUserId: '1'
          crossAccountRoleName: ${name}
          alias: ${name}
    

    Create CrossAccount Resource

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

    Constructor syntax

    new CrossAccount(name: string, args: CrossAccountArgs, opts?: CustomResourceOptions);
    @overload
    def CrossAccount(resource_name: str,
                     args: CrossAccountArgs,
                     opts: Optional[ResourceOptions] = None)
    
    @overload
    def CrossAccount(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     cross_account_role_name: Optional[str] = None,
                     cross_account_user_id: Optional[int] = None,
                     alias: Optional[str] = None)
    func NewCrossAccount(ctx *Context, name string, args CrossAccountArgs, opts ...ResourceOption) (*CrossAccount, error)
    public CrossAccount(string name, CrossAccountArgs args, CustomResourceOptions? opts = null)
    public CrossAccount(String name, CrossAccountArgs args)
    public CrossAccount(String name, CrossAccountArgs args, CustomResourceOptions options)
    
    type: alicloud:hbr:CrossAccount
    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 CrossAccountArgs
    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 CrossAccountArgs
    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 CrossAccountArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args CrossAccountArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args CrossAccountArgs
    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 crossAccountResource = new AliCloud.Hbr.CrossAccount("crossAccountResource", new()
    {
        CrossAccountRoleName = "string",
        CrossAccountUserId = 0,
        Alias = "string",
    });
    
    example, err := hbr.NewCrossAccount(ctx, "crossAccountResource", &hbr.CrossAccountArgs{
    	CrossAccountRoleName: pulumi.String("string"),
    	CrossAccountUserId:   pulumi.Int(0),
    	Alias:                pulumi.String("string"),
    })
    
    var crossAccountResource = new CrossAccount("crossAccountResource", CrossAccountArgs.builder()
        .crossAccountRoleName("string")
        .crossAccountUserId(0)
        .alias("string")
        .build());
    
    cross_account_resource = alicloud.hbr.CrossAccount("crossAccountResource",
        cross_account_role_name="string",
        cross_account_user_id=0,
        alias="string")
    
    const crossAccountResource = new alicloud.hbr.CrossAccount("crossAccountResource", {
        crossAccountRoleName: "string",
        crossAccountUserId: 0,
        alias: "string",
    });
    
    type: alicloud:hbr:CrossAccount
    properties:
        alias: string
        crossAccountRoleName: string
        crossAccountUserId: 0
    

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

    CrossAccountRoleName string
    The name of RAM role that the backup account authorizes the management account to manage its resources
    CrossAccountUserId int
    The uid of the backup account.
    Alias string
    Backup account alias
    CrossAccountRoleName string
    The name of RAM role that the backup account authorizes the management account to manage its resources
    CrossAccountUserId int
    The uid of the backup account.
    Alias string
    Backup account alias
    crossAccountRoleName String
    The name of RAM role that the backup account authorizes the management account to manage its resources
    crossAccountUserId Integer
    The uid of the backup account.
    alias String
    Backup account alias
    crossAccountRoleName string
    The name of RAM role that the backup account authorizes the management account to manage its resources
    crossAccountUserId number
    The uid of the backup account.
    alias string
    Backup account alias
    cross_account_role_name str
    The name of RAM role that the backup account authorizes the management account to manage its resources
    cross_account_user_id int
    The uid of the backup account.
    alias str
    Backup account alias
    crossAccountRoleName String
    The name of RAM role that the backup account authorizes the management account to manage its resources
    crossAccountUserId Number
    The uid of the backup account.
    alias String
    Backup account alias

    Outputs

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

    CreateTime int
    Timestamp of the creation time
    Id string
    The provider-assigned unique ID for this managed resource.
    CreateTime int
    Timestamp of the creation time
    Id string
    The provider-assigned unique ID for this managed resource.
    createTime Integer
    Timestamp of the creation time
    id String
    The provider-assigned unique ID for this managed resource.
    createTime number
    Timestamp of the creation time
    id string
    The provider-assigned unique ID for this managed resource.
    create_time int
    Timestamp of the creation time
    id str
    The provider-assigned unique ID for this managed resource.
    createTime Number
    Timestamp of the creation time
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing CrossAccount Resource

    Get an existing CrossAccount 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?: CrossAccountState, opts?: CustomResourceOptions): CrossAccount
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            alias: Optional[str] = None,
            create_time: Optional[int] = None,
            cross_account_role_name: Optional[str] = None,
            cross_account_user_id: Optional[int] = None) -> CrossAccount
    func GetCrossAccount(ctx *Context, name string, id IDInput, state *CrossAccountState, opts ...ResourceOption) (*CrossAccount, error)
    public static CrossAccount Get(string name, Input<string> id, CrossAccountState? state, CustomResourceOptions? opts = null)
    public static CrossAccount get(String name, Output<String> id, CrossAccountState state, CustomResourceOptions options)
    resources:  _:    type: alicloud:hbr:CrossAccount    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:
    Alias string
    Backup account alias
    CreateTime int
    Timestamp of the creation time
    CrossAccountRoleName string
    The name of RAM role that the backup account authorizes the management account to manage its resources
    CrossAccountUserId int
    The uid of the backup account.
    Alias string
    Backup account alias
    CreateTime int
    Timestamp of the creation time
    CrossAccountRoleName string
    The name of RAM role that the backup account authorizes the management account to manage its resources
    CrossAccountUserId int
    The uid of the backup account.
    alias String
    Backup account alias
    createTime Integer
    Timestamp of the creation time
    crossAccountRoleName String
    The name of RAM role that the backup account authorizes the management account to manage its resources
    crossAccountUserId Integer
    The uid of the backup account.
    alias string
    Backup account alias
    createTime number
    Timestamp of the creation time
    crossAccountRoleName string
    The name of RAM role that the backup account authorizes the management account to manage its resources
    crossAccountUserId number
    The uid of the backup account.
    alias str
    Backup account alias
    create_time int
    Timestamp of the creation time
    cross_account_role_name str
    The name of RAM role that the backup account authorizes the management account to manage its resources
    cross_account_user_id int
    The uid of the backup account.
    alias String
    Backup account alias
    createTime Number
    Timestamp of the creation time
    crossAccountRoleName String
    The name of RAM role that the backup account authorizes the management account to manage its resources
    crossAccountUserId Number
    The uid of the backup account.

    Import

    Hybrid Backup Recovery (HBR) Cross Account can be imported using the id, e.g.

    $ pulumi import alicloud:hbr/crossAccount:CrossAccount example <cross_account_user_id>:<cross_account_role_name>
    

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

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.74.0 published on Monday, Jan 27, 2025 by Pulumi