alicloud logo
Alibaba Cloud v3.34.0, Mar 17 23

alicloud.vpc.Ipv4Gateway

Provides a VPC Ipv4 Gateway resource.

For information about VPC Ipv4 Gateway and how to use it, see What is Ipv4 Gateway.

NOTE: Available in v1.181.0+.

Example Usage

Basic Usage

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

return await Deployment.RunAsync(() => 
{
    var @default = AliCloud.Vpc.GetNetworks.Invoke(new()
    {
        NameRegex = "default-NoDeleting",
    });

    var example = new AliCloud.Vpc.Ipv4Gateway("example", new()
    {
        Ipv4GatewayName = "example_value",
        VpcId = @default.Apply(@default => @default.Apply(getNetworksResult => getNetworksResult.Ids[0])),
    });

});
package main

import (
	"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 {
		_default, err := vpc.GetNetworks(ctx, &vpc.GetNetworksArgs{
			NameRegex: pulumi.StringRef("default-NoDeleting"),
		}, nil)
		if err != nil {
			return err
		}
		_, err = vpc.NewIpv4Gateway(ctx, "example", &vpc.Ipv4GatewayArgs{
			Ipv4GatewayName: pulumi.String("example_value"),
			VpcId:           *pulumi.String(_default.Ids[0]),
		})
		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.VpcFunctions;
import com.pulumi.alicloud.vpc.inputs.GetNetworksArgs;
import com.pulumi.alicloud.vpc.Ipv4Gateway;
import com.pulumi.alicloud.vpc.Ipv4GatewayArgs;
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 default = VpcFunctions.getNetworks(GetNetworksArgs.builder()
            .nameRegex("default-NoDeleting")
            .build());

        var example = new Ipv4Gateway("example", Ipv4GatewayArgs.builder()        
            .ipv4GatewayName("example_value")
            .vpcId(default_.ids()[0])
            .build());

    }
}
import pulumi
import pulumi_alicloud as alicloud

default = alicloud.vpc.get_networks(name_regex="default-NoDeleting")
example = alicloud.vpc.Ipv4Gateway("example",
    ipv4_gateway_name="example_value",
    vpc_id=default.ids[0])
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const default = alicloud.vpc.getNetworks({
    nameRegex: "default-NoDeleting",
});
const example = new alicloud.vpc.Ipv4Gateway("example", {
    ipv4GatewayName: "example_value",
    vpcId: _default.then(_default => _default.ids?.[0]),
});
resources:
  example:
    type: alicloud:vpc:Ipv4Gateway
    properties:
      ipv4GatewayName: example_value
      vpcId: ${default.ids[0]}
variables:
  default:
    fn::invoke:
      Function: alicloud:vpc:getNetworks
      Arguments:
        nameRegex: default-NoDeleting

Create Ipv4Gateway Resource

new Ipv4Gateway(name: string, args: Ipv4GatewayArgs, opts?: CustomResourceOptions);
@overload
def Ipv4Gateway(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                dry_run: Optional[bool] = None,
                enabled: Optional[bool] = None,
                ipv4_gateway_description: Optional[str] = None,
                ipv4_gateway_name: Optional[str] = None,
                vpc_id: Optional[str] = None)
@overload
def Ipv4Gateway(resource_name: str,
                args: Ipv4GatewayArgs,
                opts: Optional[ResourceOptions] = None)
func NewIpv4Gateway(ctx *Context, name string, args Ipv4GatewayArgs, opts ...ResourceOption) (*Ipv4Gateway, error)
public Ipv4Gateway(string name, Ipv4GatewayArgs args, CustomResourceOptions? opts = null)
public Ipv4Gateway(String name, Ipv4GatewayArgs args)
public Ipv4Gateway(String name, Ipv4GatewayArgs args, CustomResourceOptions options)
type: alicloud:vpc:Ipv4Gateway
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

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

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

VpcId string

The ID of the virtual private cloud (VPC) where you want to create the IPv4 gateway. You can create only one IPv4 gateway in a VPC.

DryRun bool

The dry run.

Enabled bool

Whether the IPv4 gateway is active or not. Valid values are true and false.

Ipv4GatewayDescription string

The description of the IPv4 gateway. The description must be 2 to 256 characters in length. It must start with a letter but cannot start with http:// or https://.

Ipv4GatewayName string

The name of the IPv4 gateway. The name must be 2 to 128 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). It must start with a letter.

VpcId string

The ID of the virtual private cloud (VPC) where you want to create the IPv4 gateway. You can create only one IPv4 gateway in a VPC.

DryRun bool

The dry run.

Enabled bool

Whether the IPv4 gateway is active or not. Valid values are true and false.

Ipv4GatewayDescription string

The description of the IPv4 gateway. The description must be 2 to 256 characters in length. It must start with a letter but cannot start with http:// or https://.

Ipv4GatewayName string

The name of the IPv4 gateway. The name must be 2 to 128 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). It must start with a letter.

vpcId String

The ID of the virtual private cloud (VPC) where you want to create the IPv4 gateway. You can create only one IPv4 gateway in a VPC.

dryRun Boolean

The dry run.

enabled Boolean

Whether the IPv4 gateway is active or not. Valid values are true and false.

ipv4GatewayDescription String

The description of the IPv4 gateway. The description must be 2 to 256 characters in length. It must start with a letter but cannot start with http:// or https://.

ipv4GatewayName String

The name of the IPv4 gateway. The name must be 2 to 128 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). It must start with a letter.

vpcId string

The ID of the virtual private cloud (VPC) where you want to create the IPv4 gateway. You can create only one IPv4 gateway in a VPC.

dryRun boolean

The dry run.

enabled boolean

Whether the IPv4 gateway is active or not. Valid values are true and false.

ipv4GatewayDescription string

The description of the IPv4 gateway. The description must be 2 to 256 characters in length. It must start with a letter but cannot start with http:// or https://.

ipv4GatewayName string

The name of the IPv4 gateway. The name must be 2 to 128 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). It must start with a letter.

vpc_id str

The ID of the virtual private cloud (VPC) where you want to create the IPv4 gateway. You can create only one IPv4 gateway in a VPC.

dry_run bool

The dry run.

enabled bool

Whether the IPv4 gateway is active or not. Valid values are true and false.

ipv4_gateway_description str

The description of the IPv4 gateway. The description must be 2 to 256 characters in length. It must start with a letter but cannot start with http:// or https://.

ipv4_gateway_name str

The name of the IPv4 gateway. The name must be 2 to 128 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). It must start with a letter.

vpcId String

The ID of the virtual private cloud (VPC) where you want to create the IPv4 gateway. You can create only one IPv4 gateway in a VPC.

dryRun Boolean

The dry run.

enabled Boolean

Whether the IPv4 gateway is active or not. Valid values are true and false.

ipv4GatewayDescription String

The description of the IPv4 gateway. The description must be 2 to 256 characters in length. It must start with a letter but cannot start with http:// or https://.

ipv4GatewayName String

The name of the IPv4 gateway. The name must be 2 to 128 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). It must start with a letter.

Outputs

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

Id string

The provider-assigned unique ID for this managed resource.

Status string

The status of the resource.

Id string

The provider-assigned unique ID for this managed resource.

Status string

The status of the resource.

id String

The provider-assigned unique ID for this managed resource.

status String

The status of the resource.

id string

The provider-assigned unique ID for this managed resource.

status string

The status of the resource.

id str

The provider-assigned unique ID for this managed resource.

status str

The status of the resource.

id String

The provider-assigned unique ID for this managed resource.

status String

The status of the resource.

Look up Existing Ipv4Gateway Resource

Get an existing Ipv4Gateway 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?: Ipv4GatewayState, opts?: CustomResourceOptions): Ipv4Gateway
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        dry_run: Optional[bool] = None,
        enabled: Optional[bool] = None,
        ipv4_gateway_description: Optional[str] = None,
        ipv4_gateway_name: Optional[str] = None,
        status: Optional[str] = None,
        vpc_id: Optional[str] = None) -> Ipv4Gateway
func GetIpv4Gateway(ctx *Context, name string, id IDInput, state *Ipv4GatewayState, opts ...ResourceOption) (*Ipv4Gateway, error)
public static Ipv4Gateway Get(string name, Input<string> id, Ipv4GatewayState? state, CustomResourceOptions? opts = null)
public static Ipv4Gateway get(String name, Output<String> id, Ipv4GatewayState 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:
DryRun bool

The dry run.

Enabled bool

Whether the IPv4 gateway is active or not. Valid values are true and false.

Ipv4GatewayDescription string

The description of the IPv4 gateway. The description must be 2 to 256 characters in length. It must start with a letter but cannot start with http:// or https://.

Ipv4GatewayName string

The name of the IPv4 gateway. The name must be 2 to 128 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). It must start with a letter.

Status string

The status of the resource.

VpcId string

The ID of the virtual private cloud (VPC) where you want to create the IPv4 gateway. You can create only one IPv4 gateway in a VPC.

DryRun bool

The dry run.

Enabled bool

Whether the IPv4 gateway is active or not. Valid values are true and false.

Ipv4GatewayDescription string

The description of the IPv4 gateway. The description must be 2 to 256 characters in length. It must start with a letter but cannot start with http:// or https://.

Ipv4GatewayName string

The name of the IPv4 gateway. The name must be 2 to 128 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). It must start with a letter.

Status string

The status of the resource.

VpcId string

The ID of the virtual private cloud (VPC) where you want to create the IPv4 gateway. You can create only one IPv4 gateway in a VPC.

dryRun Boolean

The dry run.

enabled Boolean

Whether the IPv4 gateway is active or not. Valid values are true and false.

ipv4GatewayDescription String

The description of the IPv4 gateway. The description must be 2 to 256 characters in length. It must start with a letter but cannot start with http:// or https://.

ipv4GatewayName String

The name of the IPv4 gateway. The name must be 2 to 128 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). It must start with a letter.

status String

The status of the resource.

vpcId String

The ID of the virtual private cloud (VPC) where you want to create the IPv4 gateway. You can create only one IPv4 gateway in a VPC.

dryRun boolean

The dry run.

enabled boolean

Whether the IPv4 gateway is active or not. Valid values are true and false.

ipv4GatewayDescription string

The description of the IPv4 gateway. The description must be 2 to 256 characters in length. It must start with a letter but cannot start with http:// or https://.

ipv4GatewayName string

The name of the IPv4 gateway. The name must be 2 to 128 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). It must start with a letter.

status string

The status of the resource.

vpcId string

The ID of the virtual private cloud (VPC) where you want to create the IPv4 gateway. You can create only one IPv4 gateway in a VPC.

dry_run bool

The dry run.

enabled bool

Whether the IPv4 gateway is active or not. Valid values are true and false.

ipv4_gateway_description str

The description of the IPv4 gateway. The description must be 2 to 256 characters in length. It must start with a letter but cannot start with http:// or https://.

ipv4_gateway_name str

The name of the IPv4 gateway. The name must be 2 to 128 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). It must start with a letter.

status str

The status of the resource.

vpc_id str

The ID of the virtual private cloud (VPC) where you want to create the IPv4 gateway. You can create only one IPv4 gateway in a VPC.

dryRun Boolean

The dry run.

enabled Boolean

Whether the IPv4 gateway is active or not. Valid values are true and false.

ipv4GatewayDescription String

The description of the IPv4 gateway. The description must be 2 to 256 characters in length. It must start with a letter but cannot start with http:// or https://.

ipv4GatewayName String

The name of the IPv4 gateway. The name must be 2 to 128 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). It must start with a letter.

status String

The status of the resource.

vpcId String

The ID of the virtual private cloud (VPC) where you want to create the IPv4 gateway. You can create only one IPv4 gateway in a VPC.

Import

VPC Ipv4 Gateway can be imported using the id, e.g.

 $ pulumi import alicloud:vpc/ipv4Gateway:Ipv4Gateway example <id>

Package Details

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

This Pulumi package is based on the alicloud Terraform Provider.