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

volcengine.transit_router.SharedTransitRouterState

Explore with Pulumi AI

Provides a resource to manage transit router shared transit router state

Example Usage

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

const secondAccount = new volcengine.Provider("secondAccount", {
    accessKey: "access_key_2",
    secretKey: "secret_key_2",
    region: "region_2",
});
const fooTransitRouter = new volcengine.transit_router.TransitRouter("fooTransitRouter", {
    transitRouterName: "acc-test-tr",
    description: "acc-test",
});
const fooGrantRule = new volcengine.transit_router.GrantRule("fooGrantRule", {
    grantAccountId: "2000xxxxx",
    description: "acc-test-tf",
    transitRouterId: fooTransitRouter.id,
});
const fooSharedTransitRouterState = new volcengine.transit_router.SharedTransitRouterState("fooSharedTransitRouterState", {
    transitRouterId: fooTransitRouter.id,
    action: "Accept",
}, {
    provider: volcengine.second_account,
});
Copy
import pulumi
import pulumi_volcengine as volcengine

second_account = volcengine.Provider("secondAccount",
    access_key="access_key_2",
    secret_key="secret_key_2",
    region="region_2")
foo_transit_router = volcengine.transit_router.TransitRouter("fooTransitRouter",
    transit_router_name="acc-test-tr",
    description="acc-test")
foo_grant_rule = volcengine.transit_router.GrantRule("fooGrantRule",
    grant_account_id="2000xxxxx",
    description="acc-test-tf",
    transit_router_id=foo_transit_router.id)
foo_shared_transit_router_state = volcengine.transit_router.SharedTransitRouterState("fooSharedTransitRouterState",
    transit_router_id=foo_transit_router.id,
    action="Accept",
    opts=pulumi.ResourceOptions(provider=volcengine["second_account"]))
Copy
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := volcengine.NewProvider(ctx, "secondAccount", &volcengine.ProviderArgs{
			AccessKey: pulumi.String("access_key_2"),
			SecretKey: pulumi.String("secret_key_2"),
			Region:    pulumi.String("region_2"),
		})
		if err != nil {
			return err
		}
		fooTransitRouter, err := transit_router.NewTransitRouter(ctx, "fooTransitRouter", &transit_router.TransitRouterArgs{
			TransitRouterName: pulumi.String("acc-test-tr"),
			Description:       pulumi.String("acc-test"),
		})
		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
		}
		_, err = transit_router.NewSharedTransitRouterState(ctx, "fooSharedTransitRouterState", &transit_router.SharedTransitRouterStateArgs{
			TransitRouterId: fooTransitRouter.ID(),
			Action:          pulumi.String("Accept"),
		}, pulumi.Provider(volcengine.Second_account))
		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 secondAccount = new Volcengine.Provider("secondAccount", new()
    {
        AccessKey = "access_key_2",
        SecretKey = "secret_key_2",
        Region = "region_2",
    });

    var fooTransitRouter = new Volcengine.Transit_router.TransitRouter("fooTransitRouter", new()
    {
        TransitRouterName = "acc-test-tr",
        Description = "acc-test",
    });

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

    var fooSharedTransitRouterState = new Volcengine.Transit_router.SharedTransitRouterState("fooSharedTransitRouterState", new()
    {
        TransitRouterId = fooTransitRouter.Id,
        Action = "Accept",
    }, new CustomResourceOptions
    {
        Provider = volcengine.Second_account,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.volcengine.Provider;
import com.pulumi.volcengine.ProviderArgs;
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 com.pulumi.volcengine.transit_router.SharedTransitRouterState;
import com.pulumi.volcengine.transit_router.SharedTransitRouterStateArgs;
import com.pulumi.resources.CustomResourceOptions;
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 secondAccount = new Provider("secondAccount", ProviderArgs.builder()        
            .accessKey("access_key_2")
            .secretKey("secret_key_2")
            .region("region_2")
            .build());

        var fooTransitRouter = new TransitRouter("fooTransitRouter", TransitRouterArgs.builder()        
            .transitRouterName("acc-test-tr")
            .description("acc-test")
            .build());

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

        var fooSharedTransitRouterState = new SharedTransitRouterState("fooSharedTransitRouterState", SharedTransitRouterStateArgs.builder()        
            .transitRouterId(fooTransitRouter.id())
            .action("Accept")
            .build(), CustomResourceOptions.builder()
                .provider(volcengine.second_account())
                .build());

    }
}
Copy
resources:
  secondAccount:
    type: pulumi:providers:volcengine
    properties:
      accessKey: access_key_2
      secretKey: secret_key_2
      region: region_2
  fooTransitRouter:
    type: volcengine:transit_router:TransitRouter
    properties:
      transitRouterName: acc-test-tr
      description: acc-test
  fooGrantRule:
    type: volcengine:transit_router:GrantRule
    properties:
      grantAccountId: 2000xxxxx
      description: acc-test-tf
      transitRouterId: ${fooTransitRouter.id}
  fooSharedTransitRouterState:
    type: volcengine:transit_router:SharedTransitRouterState
    properties:
      transitRouterId: ${fooTransitRouter.id}
      action: Accept
    options:
      provider: ${volcengine.second_account}
Copy

Create SharedTransitRouterState Resource

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

Constructor syntax

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

@overload
def SharedTransitRouterState(resource_name: str,
                             opts: Optional[ResourceOptions] = None,
                             action: Optional[str] = None,
                             transit_router_id: Optional[str] = None)
func NewSharedTransitRouterState(ctx *Context, name string, args SharedTransitRouterStateArgs, opts ...ResourceOption) (*SharedTransitRouterState, error)
public SharedTransitRouterState(string name, SharedTransitRouterStateArgs args, CustomResourceOptions? opts = null)
public SharedTransitRouterState(String name, SharedTransitRouterStateArgs args)
public SharedTransitRouterState(String name, SharedTransitRouterStateArgs args, CustomResourceOptions options)
type: volcengine:transit_router:SharedTransitRouterState
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. SharedTransitRouterStateArgs
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. SharedTransitRouterStateArgs
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. SharedTransitRouterStateArgs
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. SharedTransitRouterStateArgs
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. SharedTransitRouterStateArgs
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 sharedTransitRouterStateResource = new Volcengine.Transit_router.SharedTransitRouterState("sharedTransitRouterStateResource", new()
{
    Action = "string",
    TransitRouterId = "string",
});
Copy
example, err := transit_router.NewSharedTransitRouterState(ctx, "sharedTransitRouterStateResource", &transit_router.SharedTransitRouterStateArgs{
	Action:          pulumi.String("string"),
	TransitRouterId: pulumi.String("string"),
})
Copy
var sharedTransitRouterStateResource = new SharedTransitRouterState("sharedTransitRouterStateResource", SharedTransitRouterStateArgs.builder()
    .action("string")
    .transitRouterId("string")
    .build());
Copy
shared_transit_router_state_resource = volcengine.transit_router.SharedTransitRouterState("sharedTransitRouterStateResource",
    action="string",
    transit_router_id="string")
Copy
const sharedTransitRouterStateResource = new volcengine.transit_router.SharedTransitRouterState("sharedTransitRouterStateResource", {
    action: "string",
    transitRouterId: "string",
});
Copy
type: volcengine:transit_router:SharedTransitRouterState
properties:
    action: string
    transitRouterId: string
Copy

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

Action This property is required. string
Accept or Reject the shared transit router. When importing resources, this attribute will not be imported. If this attribute is set, please use lifecycle and ignore_changes ignore changes in fields.
TransitRouterId
This property is required.
Changes to this property will trigger replacement.
string
The id of the transit router.
Action This property is required. string
Accept or Reject the shared transit router. When importing resources, this attribute will not be imported. If this attribute is set, please use lifecycle and ignore_changes ignore changes in fields.
TransitRouterId
This property is required.
Changes to this property will trigger replacement.
string
The id of the transit router.
action This property is required. String
Accept or Reject the shared transit router. When importing resources, this attribute will not be imported. If this attribute is set, please use lifecycle and ignore_changes ignore changes in fields.
transitRouterId
This property is required.
Changes to this property will trigger replacement.
String
The id of the transit router.
action This property is required. string
Accept or Reject the shared transit router. When importing resources, this attribute will not be imported. If this attribute is set, please use lifecycle and ignore_changes ignore changes in fields.
transitRouterId
This property is required.
Changes to this property will trigger replacement.
string
The id of the transit router.
action This property is required. str
Accept or Reject the shared transit router. When importing resources, this attribute will not be imported. If this attribute is set, please use lifecycle and ignore_changes ignore changes in fields.
transit_router_id
This property is required.
Changes to this property will trigger replacement.
str
The id of the transit router.
action This property is required. String
Accept or Reject the shared transit router. When importing resources, this attribute will not be imported. If this attribute is set, please use lifecycle and ignore_changes ignore changes in fields.
transitRouterId
This property is required.
Changes to this property will trigger replacement.
String
The id of the transit router.

Outputs

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

Get an existing SharedTransitRouterState 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?: SharedTransitRouterStateState, opts?: CustomResourceOptions): SharedTransitRouterState
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        action: Optional[str] = None,
        transit_router_id: Optional[str] = None) -> SharedTransitRouterState
func GetSharedTransitRouterState(ctx *Context, name string, id IDInput, state *SharedTransitRouterStateState, opts ...ResourceOption) (*SharedTransitRouterState, error)
public static SharedTransitRouterState Get(string name, Input<string> id, SharedTransitRouterStateState? state, CustomResourceOptions? opts = null)
public static SharedTransitRouterState get(String name, Output<String> id, SharedTransitRouterStateState state, CustomResourceOptions options)
resources:  _:    type: volcengine:transit_router:SharedTransitRouterState    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:
Action string
Accept or Reject the shared transit router. When importing resources, this attribute will not be imported. If this attribute is set, please use lifecycle and ignore_changes ignore changes in fields.
TransitRouterId Changes to this property will trigger replacement. string
The id of the transit router.
Action string
Accept or Reject the shared transit router. When importing resources, this attribute will not be imported. If this attribute is set, please use lifecycle and ignore_changes ignore changes in fields.
TransitRouterId Changes to this property will trigger replacement. string
The id of the transit router.
action String
Accept or Reject the shared transit router. When importing resources, this attribute will not be imported. If this attribute is set, please use lifecycle and ignore_changes ignore changes in fields.
transitRouterId Changes to this property will trigger replacement. String
The id of the transit router.
action string
Accept or Reject the shared transit router. When importing resources, this attribute will not be imported. If this attribute is set, please use lifecycle and ignore_changes ignore changes in fields.
transitRouterId Changes to this property will trigger replacement. string
The id of the transit router.
action str
Accept or Reject the shared transit router. When importing resources, this attribute will not be imported. If this attribute is set, please use lifecycle and ignore_changes ignore changes in fields.
transit_router_id Changes to this property will trigger replacement. str
The id of the transit router.
action String
Accept or Reject the shared transit router. When importing resources, this attribute will not be imported. If this attribute is set, please use lifecycle and ignore_changes ignore changes in fields.
transitRouterId Changes to this property will trigger replacement. String
The id of the transit router.

Import

SharedTransitRouterState can be imported using the id, e.g.

$ pulumi import volcengine:transit_router/sharedTransitRouterState:SharedTransitRouterState default state:transitRouterId
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.