1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. eflo
  5. VpdGrantRule
Alibaba Cloud v3.90.0 published on Tuesday, Dec 2, 2025 by Pulumi
alicloud logo
Alibaba Cloud v3.90.0 published on Tuesday, Dec 2, 2025 by Pulumi

    Provides a Eflo Vpd Grant Rule resource.

    Lingjun Network Segment Cross-Account Authorization Information.

    For information about Eflo Vpd Grant Rule and how to use it, see What is Vpd Grant Rule.

    NOTE: Available since v1.263.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 = alicloud.getAccount({});
    const defaultEr = new alicloud.eflo.Er("default", {
        erName: name,
        masterZoneId: "cn-hangzhou-a",
    });
    const defaultVpd = new alicloud.eflo.Vpd("default", {
        cidr: "10.0.0.0/8",
        vpdName: name,
    });
    const defaultVpdGrantRule = new alicloud.eflo.VpdGrantRule("default", {
        grantTenantId: _default.then(_default => _default.id),
        erId: defaultEr.id,
        instanceId: defaultVpd.id,
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "terraform-example"
    default = alicloud.get_account()
    default_er = alicloud.eflo.Er("default",
        er_name=name,
        master_zone_id="cn-hangzhou-a")
    default_vpd = alicloud.eflo.Vpd("default",
        cidr="10.0.0.0/8",
        vpd_name=name)
    default_vpd_grant_rule = alicloud.eflo.VpdGrantRule("default",
        grant_tenant_id=default.id,
        er_id=default_er.id,
        instance_id=default_vpd.id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/eflo"
    	"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
    		}
    		_default, err := alicloud.GetAccount(ctx, map[string]interface{}{}, nil)
    		if err != nil {
    			return err
    		}
    		defaultEr, err := eflo.NewEr(ctx, "default", &eflo.ErArgs{
    			ErName:       pulumi.String(name),
    			MasterZoneId: pulumi.String("cn-hangzhou-a"),
    		})
    		if err != nil {
    			return err
    		}
    		defaultVpd, err := eflo.NewVpd(ctx, "default", &eflo.VpdArgs{
    			Cidr:    pulumi.String("10.0.0.0/8"),
    			VpdName: pulumi.String(name),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = eflo.NewVpdGrantRule(ctx, "default", &eflo.VpdGrantRuleArgs{
    			GrantTenantId: pulumi.String(_default.Id),
    			ErId:          defaultEr.ID(),
    			InstanceId:    defaultVpd.ID(),
    		})
    		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 = AliCloud.GetAccount.Invoke();
    
        var defaultEr = new AliCloud.Eflo.Er("default", new()
        {
            ErName = name,
            MasterZoneId = "cn-hangzhou-a",
        });
    
        var defaultVpd = new AliCloud.Eflo.Vpd("default", new()
        {
            Cidr = "10.0.0.0/8",
            VpdName = name,
        });
    
        var defaultVpdGrantRule = new AliCloud.Eflo.VpdGrantRule("default", new()
        {
            GrantTenantId = @default.Apply(@default => @default.Apply(getAccountResult => getAccountResult.Id)),
            ErId = defaultEr.Id,
            InstanceId = defaultVpd.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.AlicloudFunctions;
    import com.pulumi.alicloud.eflo.Er;
    import com.pulumi.alicloud.eflo.ErArgs;
    import com.pulumi.alicloud.eflo.Vpd;
    import com.pulumi.alicloud.eflo.VpdArgs;
    import com.pulumi.alicloud.eflo.VpdGrantRule;
    import com.pulumi.alicloud.eflo.VpdGrantRuleArgs;
    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");
            final var default = AlicloudFunctions.getAccount(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference);
    
            var defaultEr = new Er("defaultEr", ErArgs.builder()
                .erName(name)
                .masterZoneId("cn-hangzhou-a")
                .build());
    
            var defaultVpd = new Vpd("defaultVpd", VpdArgs.builder()
                .cidr("10.0.0.0/8")
                .vpdName(name)
                .build());
    
            var defaultVpdGrantRule = new VpdGrantRule("defaultVpdGrantRule", VpdGrantRuleArgs.builder()
                .grantTenantId(default_.id())
                .erId(defaultEr.id())
                .instanceId(defaultVpd.id())
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: terraform-example
    resources:
      defaultEr:
        type: alicloud:eflo:Er
        name: default
        properties:
          erName: ${name}
          masterZoneId: cn-hangzhou-a
      defaultVpd:
        type: alicloud:eflo:Vpd
        name: default
        properties:
          cidr: 10.0.0.0/8
          vpdName: ${name}
      defaultVpdGrantRule:
        type: alicloud:eflo:VpdGrantRule
        name: default
        properties:
          grantTenantId: ${default.id}
          erId: ${defaultEr.id}
          instanceId: ${defaultVpd.id}
    variables:
      default:
        fn::invoke:
          function: alicloud:getAccount
          arguments: {}
    

    Create VpdGrantRule Resource

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

    Constructor syntax

    new VpdGrantRule(name: string, args: VpdGrantRuleArgs, opts?: CustomResourceOptions);
    @overload
    def VpdGrantRule(resource_name: str,
                     args: VpdGrantRuleArgs,
                     opts: Optional[ResourceOptions] = None)
    
    @overload
    def VpdGrantRule(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     er_id: Optional[str] = None,
                     grant_tenant_id: Optional[str] = None,
                     instance_id: Optional[str] = None)
    func NewVpdGrantRule(ctx *Context, name string, args VpdGrantRuleArgs, opts ...ResourceOption) (*VpdGrantRule, error)
    public VpdGrantRule(string name, VpdGrantRuleArgs args, CustomResourceOptions? opts = null)
    public VpdGrantRule(String name, VpdGrantRuleArgs args)
    public VpdGrantRule(String name, VpdGrantRuleArgs args, CustomResourceOptions options)
    
    type: alicloud:eflo:VpdGrantRule
    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 VpdGrantRuleArgs
    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 VpdGrantRuleArgs
    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 VpdGrantRuleArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args VpdGrantRuleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args VpdGrantRuleArgs
    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 vpdGrantRuleResource = new AliCloud.Eflo.VpdGrantRule("vpdGrantRuleResource", new()
    {
        ErId = "string",
        GrantTenantId = "string",
        InstanceId = "string",
    });
    
    example, err := eflo.NewVpdGrantRule(ctx, "vpdGrantRuleResource", &eflo.VpdGrantRuleArgs{
    	ErId:          pulumi.String("string"),
    	GrantTenantId: pulumi.String("string"),
    	InstanceId:    pulumi.String("string"),
    })
    
    var vpdGrantRuleResource = new VpdGrantRule("vpdGrantRuleResource", VpdGrantRuleArgs.builder()
        .erId("string")
        .grantTenantId("string")
        .instanceId("string")
        .build());
    
    vpd_grant_rule_resource = alicloud.eflo.VpdGrantRule("vpdGrantRuleResource",
        er_id="string",
        grant_tenant_id="string",
        instance_id="string")
    
    const vpdGrantRuleResource = new alicloud.eflo.VpdGrantRule("vpdGrantRuleResource", {
        erId: "string",
        grantTenantId: "string",
        instanceId: "string",
    });
    
    type: alicloud:eflo:VpdGrantRule
    properties:
        erId: string
        grantTenantId: string
        instanceId: string
    

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

    ErId string
    The ID of the ER instance under the cross-account tenant.
    GrantTenantId string
    Cross-account authorized tenant ID.
    InstanceId string
    Instance ID of VPD.
    ErId string
    The ID of the ER instance under the cross-account tenant.
    GrantTenantId string
    Cross-account authorized tenant ID.
    InstanceId string
    Instance ID of VPD.
    erId String
    The ID of the ER instance under the cross-account tenant.
    grantTenantId String
    Cross-account authorized tenant ID.
    instanceId String
    Instance ID of VPD.
    erId string
    The ID of the ER instance under the cross-account tenant.
    grantTenantId string
    Cross-account authorized tenant ID.
    instanceId string
    Instance ID of VPD.
    er_id str
    The ID of the ER instance under the cross-account tenant.
    grant_tenant_id str
    Cross-account authorized tenant ID.
    instance_id str
    Instance ID of VPD.
    erId String
    The ID of the ER instance under the cross-account tenant.
    grantTenantId String
    Cross-account authorized tenant ID.
    instanceId String
    Instance ID of VPD.

    Outputs

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

    CreateTime string
    The Creation time.
    Id string
    The provider-assigned unique ID for this managed resource.
    RegionId string
    The Region ID.
    CreateTime string
    The Creation time.
    Id string
    The provider-assigned unique ID for this managed resource.
    RegionId string
    The Region ID.
    createTime String
    The Creation time.
    id String
    The provider-assigned unique ID for this managed resource.
    regionId String
    The Region ID.
    createTime string
    The Creation time.
    id string
    The provider-assigned unique ID for this managed resource.
    regionId string
    The Region ID.
    create_time str
    The Creation time.
    id str
    The provider-assigned unique ID for this managed resource.
    region_id str
    The Region ID.
    createTime String
    The Creation time.
    id String
    The provider-assigned unique ID for this managed resource.
    regionId String
    The Region ID.

    Look up Existing VpdGrantRule Resource

    Get an existing VpdGrantRule 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?: VpdGrantRuleState, opts?: CustomResourceOptions): VpdGrantRule
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            create_time: Optional[str] = None,
            er_id: Optional[str] = None,
            grant_tenant_id: Optional[str] = None,
            instance_id: Optional[str] = None,
            region_id: Optional[str] = None) -> VpdGrantRule
    func GetVpdGrantRule(ctx *Context, name string, id IDInput, state *VpdGrantRuleState, opts ...ResourceOption) (*VpdGrantRule, error)
    public static VpdGrantRule Get(string name, Input<string> id, VpdGrantRuleState? state, CustomResourceOptions? opts = null)
    public static VpdGrantRule get(String name, Output<String> id, VpdGrantRuleState state, CustomResourceOptions options)
    resources:  _:    type: alicloud:eflo:VpdGrantRule    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:
    CreateTime string
    The Creation time.
    ErId string
    The ID of the ER instance under the cross-account tenant.
    GrantTenantId string
    Cross-account authorized tenant ID.
    InstanceId string
    Instance ID of VPD.
    RegionId string
    The Region ID.
    CreateTime string
    The Creation time.
    ErId string
    The ID of the ER instance under the cross-account tenant.
    GrantTenantId string
    Cross-account authorized tenant ID.
    InstanceId string
    Instance ID of VPD.
    RegionId string
    The Region ID.
    createTime String
    The Creation time.
    erId String
    The ID of the ER instance under the cross-account tenant.
    grantTenantId String
    Cross-account authorized tenant ID.
    instanceId String
    Instance ID of VPD.
    regionId String
    The Region ID.
    createTime string
    The Creation time.
    erId string
    The ID of the ER instance under the cross-account tenant.
    grantTenantId string
    Cross-account authorized tenant ID.
    instanceId string
    Instance ID of VPD.
    regionId string
    The Region ID.
    create_time str
    The Creation time.
    er_id str
    The ID of the ER instance under the cross-account tenant.
    grant_tenant_id str
    Cross-account authorized tenant ID.
    instance_id str
    Instance ID of VPD.
    region_id str
    The Region ID.
    createTime String
    The Creation time.
    erId String
    The ID of the ER instance under the cross-account tenant.
    grantTenantId String
    Cross-account authorized tenant ID.
    instanceId String
    Instance ID of VPD.
    regionId String
    The Region ID.

    Import

    Eflo Vpd Grant Rule can be imported using the id, e.g.

    $ pulumi import alicloud:eflo/vpdGrantRule:VpdGrantRule example <id>
    

    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.90.0 published on Tuesday, Dec 2, 2025 by Pulumi
      Meet Neo: Your AI Platform Teammate