alicloud logo
Alibaba Cloud v3.34.0, Mar 17 23

alicloud.vpc.Ipv6EgressRule

Provides a VPC Ipv6 Egress Rule resource.

For information about VPC Ipv6 Egress Rule and how to use it, see What is Ipv6 Egress Rule.

NOTE: Available in v1.142.0+.

Example Usage

Basic Usage

using System.Collections.Generic;
using Pulumi;
using AliCloud = Pulumi.AliCloud;

return await Deployment.RunAsync(() => 
{
    var defaultNetwork = new AliCloud.Vpc.Network("defaultNetwork", new()
    {
        VpcName = "example_value",
        EnableIpv6 = true,
    });

    var exampleIpv6Gateway = new AliCloud.Vpc.Ipv6Gateway("exampleIpv6Gateway", new()
    {
        Ipv6GatewayName = "example_value",
        VpcId = defaultNetwork.Id,
    });

    var defaultInstances = AliCloud.Ecs.GetInstances.Invoke(new()
    {
        NameRegex = "ecs_with_ipv6_address",
        Status = "Running",
    });

    var defaultIpv6Addresses = AliCloud.Vpc.GetIpv6Addresses.Invoke(new()
    {
        AssociatedInstanceId = defaultInstances.Apply(getInstancesResult => getInstancesResult.Instances[0]?.Id),
        Status = "Available",
    });

    var exampleIpv6EgressRule = new AliCloud.Vpc.Ipv6EgressRule("exampleIpv6EgressRule", new()
    {
        InstanceId = defaultIpv6Addresses.Apply(getIpv6AddressesResult => getIpv6AddressesResult.Ids[0]),
        Ipv6EgressRuleName = "example_value",
        Description = "example_value",
        Ipv6GatewayId = exampleIpv6Gateway.Id,
        InstanceType = "Ipv6Address",
    });

});
package main

import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecs"
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		defaultNetwork, err := vpc.NewNetwork(ctx, "defaultNetwork", &vpc.NetworkArgs{
			VpcName:    pulumi.String("example_value"),
			EnableIpv6: pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		exampleIpv6Gateway, err := vpc.NewIpv6Gateway(ctx, "exampleIpv6Gateway", &vpc.Ipv6GatewayArgs{
			Ipv6GatewayName: pulumi.String("example_value"),
			VpcId:           defaultNetwork.ID(),
		})
		if err != nil {
			return err
		}
		defaultInstances, err := ecs.GetInstances(ctx, &ecs.GetInstancesArgs{
			NameRegex: pulumi.StringRef("ecs_with_ipv6_address"),
			Status:    pulumi.StringRef("Running"),
		}, nil)
		if err != nil {
			return err
		}
		defaultIpv6Addresses, err := vpc.GetIpv6Addresses(ctx, &vpc.GetIpv6AddressesArgs{
			AssociatedInstanceId: pulumi.StringRef(defaultInstances.Instances[0].Id),
			Status:               pulumi.StringRef("Available"),
		}, nil)
		if err != nil {
			return err
		}
		_, err = vpc.NewIpv6EgressRule(ctx, "exampleIpv6EgressRule", &vpc.Ipv6EgressRuleArgs{
			InstanceId:         *pulumi.String(defaultIpv6Addresses.Ids[0]),
			Ipv6EgressRuleName: pulumi.String("example_value"),
			Description:        pulumi.String("example_value"),
			Ipv6GatewayId:      exampleIpv6Gateway.ID(),
			InstanceType:       pulumi.String("Ipv6Address"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.vpc.Network;
import com.pulumi.alicloud.vpc.NetworkArgs;
import com.pulumi.alicloud.vpc.Ipv6Gateway;
import com.pulumi.alicloud.vpc.Ipv6GatewayArgs;
import com.pulumi.alicloud.ecs.EcsFunctions;
import com.pulumi.alicloud.ecs.inputs.GetInstancesArgs;
import com.pulumi.alicloud.vpc.VpcFunctions;
import com.pulumi.alicloud.vpc.inputs.GetIpv6AddressesArgs;
import com.pulumi.alicloud.vpc.Ipv6EgressRule;
import com.pulumi.alicloud.vpc.Ipv6EgressRuleArgs;
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 defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder()        
            .vpcName("example_value")
            .enableIpv6("true")
            .build());

        var exampleIpv6Gateway = new Ipv6Gateway("exampleIpv6Gateway", Ipv6GatewayArgs.builder()        
            .ipv6GatewayName("example_value")
            .vpcId(defaultNetwork.id())
            .build());

        final var defaultInstances = EcsFunctions.getInstances(GetInstancesArgs.builder()
            .nameRegex("ecs_with_ipv6_address")
            .status("Running")
            .build());

        final var defaultIpv6Addresses = VpcFunctions.getIpv6Addresses(GetIpv6AddressesArgs.builder()
            .associatedInstanceId(defaultInstances.applyValue(getInstancesResult -> getInstancesResult.instances()[0].id()))
            .status("Available")
            .build());

        var exampleIpv6EgressRule = new Ipv6EgressRule("exampleIpv6EgressRule", Ipv6EgressRuleArgs.builder()        
            .instanceId(defaultIpv6Addresses.applyValue(getIpv6AddressesResult -> getIpv6AddressesResult.ids()[0]))
            .ipv6EgressRuleName("example_value")
            .description("example_value")
            .ipv6GatewayId(exampleIpv6Gateway.id())
            .instanceType("Ipv6Address")
            .build());

    }
}
import pulumi
import pulumi_alicloud as alicloud

default_network = alicloud.vpc.Network("defaultNetwork",
    vpc_name="example_value",
    enable_ipv6=True)
example_ipv6_gateway = alicloud.vpc.Ipv6Gateway("exampleIpv6Gateway",
    ipv6_gateway_name="example_value",
    vpc_id=default_network.id)
default_instances = alicloud.ecs.get_instances(name_regex="ecs_with_ipv6_address",
    status="Running")
default_ipv6_addresses = alicloud.vpc.get_ipv6_addresses(associated_instance_id=default_instances.instances[0].id,
    status="Available")
example_ipv6_egress_rule = alicloud.vpc.Ipv6EgressRule("exampleIpv6EgressRule",
    instance_id=default_ipv6_addresses.ids[0],
    ipv6_egress_rule_name="example_value",
    description="example_value",
    ipv6_gateway_id=example_ipv6_gateway.id,
    instance_type="Ipv6Address")
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const defaultNetwork = new alicloud.vpc.Network("defaultNetwork", {
    vpcName: "example_value",
    enableIpv6: true,
});
const exampleIpv6Gateway = new alicloud.vpc.Ipv6Gateway("exampleIpv6Gateway", {
    ipv6GatewayName: "example_value",
    vpcId: defaultNetwork.id,
});
const defaultInstances = alicloud.ecs.getInstances({
    nameRegex: "ecs_with_ipv6_address",
    status: "Running",
});
const defaultIpv6Addresses = defaultInstances.then(defaultInstances => alicloud.vpc.getIpv6Addresses({
    associatedInstanceId: defaultInstances.instances?.[0]?.id,
    status: "Available",
}));
const exampleIpv6EgressRule = new alicloud.vpc.Ipv6EgressRule("exampleIpv6EgressRule", {
    instanceId: defaultIpv6Addresses.then(defaultIpv6Addresses => defaultIpv6Addresses.ids?.[0]),
    ipv6EgressRuleName: "example_value",
    description: "example_value",
    ipv6GatewayId: exampleIpv6Gateway.id,
    instanceType: "Ipv6Address",
});
resources:
  defaultNetwork:
    type: alicloud:vpc:Network
    properties:
      vpcName: example_value
      enableIpv6: 'true'
  exampleIpv6Gateway:
    type: alicloud:vpc:Ipv6Gateway
    properties:
      ipv6GatewayName: example_value
      vpcId: ${defaultNetwork.id}
  exampleIpv6EgressRule:
    type: alicloud:vpc:Ipv6EgressRule
    properties:
      instanceId: ${defaultIpv6Addresses.ids[0]}
      ipv6EgressRuleName: example_value
      description: example_value
      ipv6GatewayId: ${exampleIpv6Gateway.id}
      instanceType: Ipv6Address
variables:
  defaultInstances:
    fn::invoke:
      Function: alicloud:ecs:getInstances
      Arguments:
        nameRegex: ecs_with_ipv6_address
        status: Running
  defaultIpv6Addresses:
    fn::invoke:
      Function: alicloud:vpc:getIpv6Addresses
      Arguments:
        associatedInstanceId: ${defaultInstances.instances[0].id}
        status: Available

Create Ipv6EgressRule Resource

new Ipv6EgressRule(name: string, args: Ipv6EgressRuleArgs, opts?: CustomResourceOptions);
@overload
def Ipv6EgressRule(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   description: Optional[str] = None,
                   instance_id: Optional[str] = None,
                   instance_type: Optional[str] = None,
                   ipv6_egress_rule_name: Optional[str] = None,
                   ipv6_gateway_id: Optional[str] = None)
@overload
def Ipv6EgressRule(resource_name: str,
                   args: Ipv6EgressRuleArgs,
                   opts: Optional[ResourceOptions] = None)
func NewIpv6EgressRule(ctx *Context, name string, args Ipv6EgressRuleArgs, opts ...ResourceOption) (*Ipv6EgressRule, error)
public Ipv6EgressRule(string name, Ipv6EgressRuleArgs args, CustomResourceOptions? opts = null)
public Ipv6EgressRule(String name, Ipv6EgressRuleArgs args)
public Ipv6EgressRule(String name, Ipv6EgressRuleArgs args, CustomResourceOptions options)
type: alicloud:vpc:Ipv6EgressRule
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args Ipv6EgressRuleArgs
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 Ipv6EgressRuleArgs
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 Ipv6EgressRuleArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args Ipv6EgressRuleArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args Ipv6EgressRuleArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Ipv6EgressRule Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The Ipv6EgressRule resource accepts the following input properties:

InstanceId string

The ID of the IPv6 address to which you want to apply the egress-only rule.

Ipv6GatewayId string

The ID of the IPv6 gateway.

Description string

The description of the egress-only rule. The description must be 2 to 256 characters in length. It cannot start with http:// or https://.

InstanceType string

The type of instance to which you want to apply the egress-only rule. Valid values: Ipv6Address. Ipv6Address (default): an IPv6 address.

Ipv6EgressRuleName string

The name of the egress-only rule. The name must be 2 to 128 characters in length, and can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter but cannot start with http:// or https://.

InstanceId string

The ID of the IPv6 address to which you want to apply the egress-only rule.

Ipv6GatewayId string

The ID of the IPv6 gateway.

Description string

The description of the egress-only rule. The description must be 2 to 256 characters in length. It cannot start with http:// or https://.

InstanceType string

The type of instance to which you want to apply the egress-only rule. Valid values: Ipv6Address. Ipv6Address (default): an IPv6 address.

Ipv6EgressRuleName string

The name of the egress-only rule. The name must be 2 to 128 characters in length, and can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter but cannot start with http:// or https://.

instanceId String

The ID of the IPv6 address to which you want to apply the egress-only rule.

ipv6GatewayId String

The ID of the IPv6 gateway.

description String

The description of the egress-only rule. The description must be 2 to 256 characters in length. It cannot start with http:// or https://.

instanceType String

The type of instance to which you want to apply the egress-only rule. Valid values: Ipv6Address. Ipv6Address (default): an IPv6 address.

ipv6EgressRuleName String

The name of the egress-only rule. The name must be 2 to 128 characters in length, and can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter but cannot start with http:// or https://.

instanceId string

The ID of the IPv6 address to which you want to apply the egress-only rule.

ipv6GatewayId string

The ID of the IPv6 gateway.

description string

The description of the egress-only rule. The description must be 2 to 256 characters in length. It cannot start with http:// or https://.

instanceType string

The type of instance to which you want to apply the egress-only rule. Valid values: Ipv6Address. Ipv6Address (default): an IPv6 address.

ipv6EgressRuleName string

The name of the egress-only rule. The name must be 2 to 128 characters in length, and can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter but cannot start with http:// or https://.

instance_id str

The ID of the IPv6 address to which you want to apply the egress-only rule.

ipv6_gateway_id str

The ID of the IPv6 gateway.

description str

The description of the egress-only rule. The description must be 2 to 256 characters in length. It cannot start with http:// or https://.

instance_type str

The type of instance to which you want to apply the egress-only rule. Valid values: Ipv6Address. Ipv6Address (default): an IPv6 address.

ipv6_egress_rule_name str

The name of the egress-only rule. The name must be 2 to 128 characters in length, and can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter but cannot start with http:// or https://.

instanceId String

The ID of the IPv6 address to which you want to apply the egress-only rule.

ipv6GatewayId String

The ID of the IPv6 gateway.

description String

The description of the egress-only rule. The description must be 2 to 256 characters in length. It cannot start with http:// or https://.

instanceType String

The type of instance to which you want to apply the egress-only rule. Valid values: Ipv6Address. Ipv6Address (default): an IPv6 address.

ipv6EgressRuleName String

The name of the egress-only rule. The name must be 2 to 128 characters in length, and can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter but cannot start with http:// or https://.

Outputs

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

Id string

The provider-assigned unique ID for this managed resource.

Status string

The status of the resource. Valid values: Available, Pending and Deleting.

Id string

The provider-assigned unique ID for this managed resource.

Status string

The status of the resource. Valid values: Available, Pending and Deleting.

id String

The provider-assigned unique ID for this managed resource.

status String

The status of the resource. Valid values: Available, Pending and Deleting.

id string

The provider-assigned unique ID for this managed resource.

status string

The status of the resource. Valid values: Available, Pending and Deleting.

id str

The provider-assigned unique ID for this managed resource.

status str

The status of the resource. Valid values: Available, Pending and Deleting.

id String

The provider-assigned unique ID for this managed resource.

status String

The status of the resource. Valid values: Available, Pending and Deleting.

Look up Existing Ipv6EgressRule Resource

Get an existing Ipv6EgressRule 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?: Ipv6EgressRuleState, opts?: CustomResourceOptions): Ipv6EgressRule
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        description: Optional[str] = None,
        instance_id: Optional[str] = None,
        instance_type: Optional[str] = None,
        ipv6_egress_rule_name: Optional[str] = None,
        ipv6_gateway_id: Optional[str] = None,
        status: Optional[str] = None) -> Ipv6EgressRule
func GetIpv6EgressRule(ctx *Context, name string, id IDInput, state *Ipv6EgressRuleState, opts ...ResourceOption) (*Ipv6EgressRule, error)
public static Ipv6EgressRule Get(string name, Input<string> id, Ipv6EgressRuleState? state, CustomResourceOptions? opts = null)
public static Ipv6EgressRule get(String name, Output<String> id, Ipv6EgressRuleState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
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:
Description string

The description of the egress-only rule. The description must be 2 to 256 characters in length. It cannot start with http:// or https://.

InstanceId string

The ID of the IPv6 address to which you want to apply the egress-only rule.

InstanceType string

The type of instance to which you want to apply the egress-only rule. Valid values: Ipv6Address. Ipv6Address (default): an IPv6 address.

Ipv6EgressRuleName string

The name of the egress-only rule. The name must be 2 to 128 characters in length, and can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter but cannot start with http:// or https://.

Ipv6GatewayId string

The ID of the IPv6 gateway.

Status string

The status of the resource. Valid values: Available, Pending and Deleting.

Description string

The description of the egress-only rule. The description must be 2 to 256 characters in length. It cannot start with http:// or https://.

InstanceId string

The ID of the IPv6 address to which you want to apply the egress-only rule.

InstanceType string

The type of instance to which you want to apply the egress-only rule. Valid values: Ipv6Address. Ipv6Address (default): an IPv6 address.

Ipv6EgressRuleName string

The name of the egress-only rule. The name must be 2 to 128 characters in length, and can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter but cannot start with http:// or https://.

Ipv6GatewayId string

The ID of the IPv6 gateway.

Status string

The status of the resource. Valid values: Available, Pending and Deleting.

description String

The description of the egress-only rule. The description must be 2 to 256 characters in length. It cannot start with http:// or https://.

instanceId String

The ID of the IPv6 address to which you want to apply the egress-only rule.

instanceType String

The type of instance to which you want to apply the egress-only rule. Valid values: Ipv6Address. Ipv6Address (default): an IPv6 address.

ipv6EgressRuleName String

The name of the egress-only rule. The name must be 2 to 128 characters in length, and can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter but cannot start with http:// or https://.

ipv6GatewayId String

The ID of the IPv6 gateway.

status String

The status of the resource. Valid values: Available, Pending and Deleting.

description string

The description of the egress-only rule. The description must be 2 to 256 characters in length. It cannot start with http:// or https://.

instanceId string

The ID of the IPv6 address to which you want to apply the egress-only rule.

instanceType string

The type of instance to which you want to apply the egress-only rule. Valid values: Ipv6Address. Ipv6Address (default): an IPv6 address.

ipv6EgressRuleName string

The name of the egress-only rule. The name must be 2 to 128 characters in length, and can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter but cannot start with http:// or https://.

ipv6GatewayId string

The ID of the IPv6 gateway.

status string

The status of the resource. Valid values: Available, Pending and Deleting.

description str

The description of the egress-only rule. The description must be 2 to 256 characters in length. It cannot start with http:// or https://.

instance_id str

The ID of the IPv6 address to which you want to apply the egress-only rule.

instance_type str

The type of instance to which you want to apply the egress-only rule. Valid values: Ipv6Address. Ipv6Address (default): an IPv6 address.

ipv6_egress_rule_name str

The name of the egress-only rule. The name must be 2 to 128 characters in length, and can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter but cannot start with http:// or https://.

ipv6_gateway_id str

The ID of the IPv6 gateway.

status str

The status of the resource. Valid values: Available, Pending and Deleting.

description String

The description of the egress-only rule. The description must be 2 to 256 characters in length. It cannot start with http:// or https://.

instanceId String

The ID of the IPv6 address to which you want to apply the egress-only rule.

instanceType String

The type of instance to which you want to apply the egress-only rule. Valid values: Ipv6Address. Ipv6Address (default): an IPv6 address.

ipv6EgressRuleName String

The name of the egress-only rule. The name must be 2 to 128 characters in length, and can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter but cannot start with http:// or https://.

ipv6GatewayId String

The ID of the IPv6 gateway.

status String

The status of the resource. Valid values: Available, Pending and Deleting.

Import

VPC Ipv6 Egress Rule can be imported using the id, e.g.

 $ pulumi import alicloud:vpc/ipv6EgressRule:Ipv6EgressRule example <ipv6_gateway_id>:<ipv6_egress_rule_id>

Package Details

Repository
Alibaba Cloud pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.