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:
- Er
Id string - The ID of the ER instance under the cross-account tenant.
- Grant
Tenant stringId - Cross-account authorized tenant ID.
- Instance
Id string - Instance ID of VPD.
- Er
Id string - The ID of the ER instance under the cross-account tenant.
- Grant
Tenant stringId - Cross-account authorized tenant ID.
- Instance
Id string - Instance ID of VPD.
- er
Id String - The ID of the ER instance under the cross-account tenant.
- grant
Tenant StringId - Cross-account authorized tenant ID.
- instance
Id String - Instance ID of VPD.
- er
Id string - The ID of the ER instance under the cross-account tenant.
- grant
Tenant stringId - Cross-account authorized tenant ID.
- instance
Id string - Instance ID of VPD.
- er_
id str - The ID of the ER instance under the cross-account tenant.
- grant_
tenant_ strid - Cross-account authorized tenant ID.
- instance_
id str - Instance ID of VPD.
- er
Id String - The ID of the ER instance under the cross-account tenant.
- grant
Tenant StringId - Cross-account authorized tenant ID.
- instance
Id String - Instance ID of VPD.
Outputs
All input properties are implicitly available as output properties. Additionally, the VpdGrantRule resource produces the following output properties:
- Create
Time string - The Creation time.
- Id string
- The provider-assigned unique ID for this managed resource.
- Region
Id string - The Region ID.
- Create
Time string - The Creation time.
- Id string
- The provider-assigned unique ID for this managed resource.
- Region
Id string - The Region ID.
- create
Time String - The Creation time.
- id String
- The provider-assigned unique ID for this managed resource.
- region
Id String - The Region ID.
- create
Time string - The Creation time.
- id string
- The provider-assigned unique ID for this managed resource.
- region
Id 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.
- create
Time String - The Creation time.
- id String
- The provider-assigned unique ID for this managed resource.
- region
Id 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) -> VpdGrantRulefunc 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.
- Create
Time string - The Creation time.
- Er
Id string - The ID of the ER instance under the cross-account tenant.
- Grant
Tenant stringId - Cross-account authorized tenant ID.
- Instance
Id string - Instance ID of VPD.
- Region
Id string - The Region ID.
- Create
Time string - The Creation time.
- Er
Id string - The ID of the ER instance under the cross-account tenant.
- Grant
Tenant stringId - Cross-account authorized tenant ID.
- Instance
Id string - Instance ID of VPD.
- Region
Id string - The Region ID.
- create
Time String - The Creation time.
- er
Id String - The ID of the ER instance under the cross-account tenant.
- grant
Tenant StringId - Cross-account authorized tenant ID.
- instance
Id String - Instance ID of VPD.
- region
Id String - The Region ID.
- create
Time string - The Creation time.
- er
Id string - The ID of the ER instance under the cross-account tenant.
- grant
Tenant stringId - Cross-account authorized tenant ID.
- instance
Id string - Instance ID of VPD.
- region
Id 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_ strid - Cross-account authorized tenant ID.
- instance_
id str - Instance ID of VPD.
- region_
id str - The Region ID.
- create
Time String - The Creation time.
- er
Id String - The ID of the ER instance under the cross-account tenant.
- grant
Tenant StringId - Cross-account authorized tenant ID.
- instance
Id String - Instance ID of VPD.
- region
Id 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
alicloudTerraform Provider.
