1. Packages
  2. Volcengine
  3. API Docs
  4. transit_router
  5. GrantRule
Volcengine v0.0.27 published on Tuesday, Dec 10, 2024 by Volcengine

volcengine.transit_router.GrantRule

Explore with Pulumi AI

Provides a resource to manage transit router grant rule

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as volcengine from "@volcengine/pulumi";

const fooTransitRouter = new volcengine.transit_router.TransitRouter("fooTransitRouter", {
    transitRouterName: "acc-test-tf",
    description: "acc-test-tf",
});
const fooGrantRule = new volcengine.transit_router.GrantRule("fooGrantRule", {
    grantAccountId: "2000xxxxx",
    description: "acc-test-tf",
    transitRouterId: fooTransitRouter.id,
});
Copy
import pulumi
import pulumi_volcengine as volcengine

foo_transit_router = volcengine.transit_router.TransitRouter("fooTransitRouter",
    transit_router_name="acc-test-tf",
    description="acc-test-tf")
foo_grant_rule = volcengine.transit_router.GrantRule("fooGrantRule",
    grant_account_id="2000xxxxx",
    description="acc-test-tf",
    transit_router_id=foo_transit_router.id)
Copy
package main

import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/transit_router"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		fooTransitRouter, err := transit_router.NewTransitRouter(ctx, "fooTransitRouter", &transit_router.TransitRouterArgs{
			TransitRouterName: pulumi.String("acc-test-tf"),
			Description:       pulumi.String("acc-test-tf"),
		})
		if err != nil {
			return err
		}
		_, err = transit_router.NewGrantRule(ctx, "fooGrantRule", &transit_router.GrantRuleArgs{
			GrantAccountId:  pulumi.String("2000xxxxx"),
			Description:     pulumi.String("acc-test-tf"),
			TransitRouterId: fooTransitRouter.ID(),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Volcengine = Pulumi.Volcengine;

return await Deployment.RunAsync(() => 
{
    var fooTransitRouter = new Volcengine.Transit_router.TransitRouter("fooTransitRouter", new()
    {
        TransitRouterName = "acc-test-tf",
        Description = "acc-test-tf",
    });

    var fooGrantRule = new Volcengine.Transit_router.GrantRule("fooGrantRule", new()
    {
        GrantAccountId = "2000xxxxx",
        Description = "acc-test-tf",
        TransitRouterId = fooTransitRouter.Id,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.volcengine.transit_router.TransitRouter;
import com.pulumi.volcengine.transit_router.TransitRouterArgs;
import com.pulumi.volcengine.transit_router.GrantRule;
import com.pulumi.volcengine.transit_router.GrantRuleArgs;
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 fooTransitRouter = new TransitRouter("fooTransitRouter", TransitRouterArgs.builder()        
            .transitRouterName("acc-test-tf")
            .description("acc-test-tf")
            .build());

        var fooGrantRule = new GrantRule("fooGrantRule", GrantRuleArgs.builder()        
            .grantAccountId("2000xxxxx")
            .description("acc-test-tf")
            .transitRouterId(fooTransitRouter.id())
            .build());

    }
}
Copy
resources:
  fooTransitRouter:
    type: volcengine:transit_router:TransitRouter
    properties:
      transitRouterName: acc-test-tf
      description: acc-test-tf
  fooGrantRule:
    type: volcengine:transit_router:GrantRule
    properties:
      grantAccountId: 2000xxxxx
      description: acc-test-tf
      transitRouterId: ${fooTransitRouter.id}
Copy

Create GrantRule Resource

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

Constructor syntax

new GrantRule(name: string, args: GrantRuleArgs, opts?: CustomResourceOptions);
@overload
def GrantRule(resource_name: str,
              args: GrantRuleArgs,
              opts: Optional[ResourceOptions] = None)

@overload
def GrantRule(resource_name: str,
              opts: Optional[ResourceOptions] = None,
              grant_account_id: Optional[str] = None,
              transit_router_id: Optional[str] = None,
              description: Optional[str] = None)
func NewGrantRule(ctx *Context, name string, args GrantRuleArgs, opts ...ResourceOption) (*GrantRule, error)
public GrantRule(string name, GrantRuleArgs args, CustomResourceOptions? opts = null)
public GrantRule(String name, GrantRuleArgs args)
public GrantRule(String name, GrantRuleArgs args, CustomResourceOptions options)
type: volcengine:transit_router:GrantRule
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. GrantRuleArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. GrantRuleArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. GrantRuleArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. GrantRuleArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. GrantRuleArgs
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 grantRuleResource = new Volcengine.Transit_router.GrantRule("grantRuleResource", new()
{
    GrantAccountId = "string",
    TransitRouterId = "string",
    Description = "string",
});
Copy
example, err := transit_router.NewGrantRule(ctx, "grantRuleResource", &transit_router.GrantRuleArgs{
	GrantAccountId:  pulumi.String("string"),
	TransitRouterId: pulumi.String("string"),
	Description:     pulumi.String("string"),
})
Copy
var grantRuleResource = new GrantRule("grantRuleResource", GrantRuleArgs.builder()
    .grantAccountId("string")
    .transitRouterId("string")
    .description("string")
    .build());
Copy
grant_rule_resource = volcengine.transit_router.GrantRule("grantRuleResource",
    grant_account_id="string",
    transit_router_id="string",
    description="string")
Copy
const grantRuleResource = new volcengine.transit_router.GrantRule("grantRuleResource", {
    grantAccountId: "string",
    transitRouterId: "string",
    description: "string",
});
Copy
type: volcengine:transit_router:GrantRule
properties:
    description: string
    grantAccountId: string
    transitRouterId: string
Copy

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

GrantAccountId
This property is required.
Changes to this property will trigger replacement.
string
Account ID awaiting authorization for intermediate router instance.
TransitRouterId
This property is required.
Changes to this property will trigger replacement.
string
The id of the transit router.
Description string
The description of the rule.
GrantAccountId
This property is required.
Changes to this property will trigger replacement.
string
Account ID awaiting authorization for intermediate router instance.
TransitRouterId
This property is required.
Changes to this property will trigger replacement.
string
The id of the transit router.
Description string
The description of the rule.
grantAccountId
This property is required.
Changes to this property will trigger replacement.
String
Account ID awaiting authorization for intermediate router instance.
transitRouterId
This property is required.
Changes to this property will trigger replacement.
String
The id of the transit router.
description String
The description of the rule.
grantAccountId
This property is required.
Changes to this property will trigger replacement.
string
Account ID awaiting authorization for intermediate router instance.
transitRouterId
This property is required.
Changes to this property will trigger replacement.
string
The id of the transit router.
description string
The description of the rule.
grant_account_id
This property is required.
Changes to this property will trigger replacement.
str
Account ID awaiting authorization for intermediate router instance.
transit_router_id
This property is required.
Changes to this property will trigger replacement.
str
The id of the transit router.
description str
The description of the rule.
grantAccountId
This property is required.
Changes to this property will trigger replacement.
String
Account ID awaiting authorization for intermediate router instance.
transitRouterId
This property is required.
Changes to this property will trigger replacement.
String
The id of the transit router.
description String
The description of the rule.

Outputs

All input properties are implicitly available as output properties. Additionally, the GrantRule 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 GrantRule Resource

Get an existing GrantRule 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?: GrantRuleState, opts?: CustomResourceOptions): GrantRule
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        description: Optional[str] = None,
        grant_account_id: Optional[str] = None,
        transit_router_id: Optional[str] = None) -> GrantRule
func GetGrantRule(ctx *Context, name string, id IDInput, state *GrantRuleState, opts ...ResourceOption) (*GrantRule, error)
public static GrantRule Get(string name, Input<string> id, GrantRuleState? state, CustomResourceOptions? opts = null)
public static GrantRule get(String name, Output<String> id, GrantRuleState state, CustomResourceOptions options)
resources:  _:    type: volcengine:transit_router:GrantRule    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
Description string
The description of the rule.
GrantAccountId Changes to this property will trigger replacement. string
Account ID awaiting authorization for intermediate router instance.
TransitRouterId Changes to this property will trigger replacement. string
The id of the transit router.
Description string
The description of the rule.
GrantAccountId Changes to this property will trigger replacement. string
Account ID awaiting authorization for intermediate router instance.
TransitRouterId Changes to this property will trigger replacement. string
The id of the transit router.
description String
The description of the rule.
grantAccountId Changes to this property will trigger replacement. String
Account ID awaiting authorization for intermediate router instance.
transitRouterId Changes to this property will trigger replacement. String
The id of the transit router.
description string
The description of the rule.
grantAccountId Changes to this property will trigger replacement. string
Account ID awaiting authorization for intermediate router instance.
transitRouterId Changes to this property will trigger replacement. string
The id of the transit router.
description str
The description of the rule.
grant_account_id Changes to this property will trigger replacement. str
Account ID awaiting authorization for intermediate router instance.
transit_router_id Changes to this property will trigger replacement. str
The id of the transit router.
description String
The description of the rule.
grantAccountId Changes to this property will trigger replacement. String
Account ID awaiting authorization for intermediate router instance.
transitRouterId Changes to this property will trigger replacement. String
The id of the transit router.

Import

TransitRouterGrantRule can be imported using the transit router id and accountId, e.g.

$ pulumi import volcengine:transit_router/grantRule:GrantRule default trId:accountId
Copy

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

Package Details

Repository
volcengine volcengine/pulumi-volcengine
License
Apache-2.0
Notes
This Pulumi package is based on the volcengine Terraform Provider.