tencentcloud.VpcDhcpIp
Explore with Pulumi AI
Provides a resource to create a vpc dhcp_ip
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const zones = tencentcloud.getAvailabilityZones({});
const vpc = new tencentcloud.Vpc("vpc", {cidrBlock: "10.0.0.0/16"});
const subnet = new tencentcloud.Subnet("subnet", {
availabilityZone: zones.then(zones => zones.zones?.[0]?.name),
vpcId: vpc.vpcId,
cidrBlock: "10.0.0.0/16",
isMulticast: false,
});
const example = new tencentcloud.VpcDhcpIp("example", {
vpcId: vpc.vpcId,
subnetId: subnet.subnetId,
dhcpIpName: "tf-example",
});
import pulumi
import pulumi_tencentcloud as tencentcloud
zones = tencentcloud.get_availability_zones()
vpc = tencentcloud.Vpc("vpc", cidr_block="10.0.0.0/16")
subnet = tencentcloud.Subnet("subnet",
availability_zone=zones.zones[0].name,
vpc_id=vpc.vpc_id,
cidr_block="10.0.0.0/16",
is_multicast=False)
example = tencentcloud.VpcDhcpIp("example",
vpc_id=vpc.vpc_id,
subnet_id=subnet.subnet_id,
dhcp_ip_name="tf-example")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
zones, err := tencentcloud.GetAvailabilityZones(ctx, &tencentcloud.GetAvailabilityZonesArgs{}, nil)
if err != nil {
return err
}
vpc, err := tencentcloud.NewVpc(ctx, "vpc", &tencentcloud.VpcArgs{
CidrBlock: pulumi.String("10.0.0.0/16"),
})
if err != nil {
return err
}
subnet, err := tencentcloud.NewSubnet(ctx, "subnet", &tencentcloud.SubnetArgs{
AvailabilityZone: pulumi.String(zones.Zones[0].Name),
VpcId: vpc.VpcId,
CidrBlock: pulumi.String("10.0.0.0/16"),
IsMulticast: pulumi.Bool(false),
})
if err != nil {
return err
}
_, err = tencentcloud.NewVpcDhcpIp(ctx, "example", &tencentcloud.VpcDhcpIpArgs{
VpcId: vpc.VpcId,
SubnetId: subnet.SubnetId,
DhcpIpName: pulumi.String("tf-example"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tencentcloud = Pulumi.Tencentcloud;
return await Deployment.RunAsync(() =>
{
var zones = Tencentcloud.GetAvailabilityZones.Invoke();
var vpc = new Tencentcloud.Vpc("vpc", new()
{
CidrBlock = "10.0.0.0/16",
});
var subnet = new Tencentcloud.Subnet("subnet", new()
{
AvailabilityZone = zones.Apply(getAvailabilityZonesResult => getAvailabilityZonesResult.Zones[0]?.Name),
VpcId = vpc.VpcId,
CidrBlock = "10.0.0.0/16",
IsMulticast = false,
});
var example = new Tencentcloud.VpcDhcpIp("example", new()
{
VpcId = vpc.VpcId,
SubnetId = subnet.SubnetId,
DhcpIpName = "tf-example",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.TencentcloudFunctions;
import com.pulumi.tencentcloud.inputs.GetAvailabilityZonesArgs;
import com.pulumi.tencentcloud.Vpc;
import com.pulumi.tencentcloud.VpcArgs;
import com.pulumi.tencentcloud.Subnet;
import com.pulumi.tencentcloud.SubnetArgs;
import com.pulumi.tencentcloud.VpcDhcpIp;
import com.pulumi.tencentcloud.VpcDhcpIpArgs;
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 zones = TencentcloudFunctions.getAvailabilityZones();
var vpc = new Vpc("vpc", VpcArgs.builder()
.cidrBlock("10.0.0.0/16")
.build());
var subnet = new Subnet("subnet", SubnetArgs.builder()
.availabilityZone(zones.applyValue(getAvailabilityZonesResult -> getAvailabilityZonesResult.zones()[0].name()))
.vpcId(vpc.vpcId())
.cidrBlock("10.0.0.0/16")
.isMulticast(false)
.build());
var example = new VpcDhcpIp("example", VpcDhcpIpArgs.builder()
.vpcId(vpc.vpcId())
.subnetId(subnet.subnetId())
.dhcpIpName("tf-example")
.build());
}
}
resources:
vpc:
type: tencentcloud:Vpc
properties:
cidrBlock: 10.0.0.0/16
subnet:
type: tencentcloud:Subnet
properties:
availabilityZone: ${zones.zones[0].name}
vpcId: ${vpc.vpcId}
cidrBlock: 10.0.0.0/16
isMulticast: false
example:
type: tencentcloud:VpcDhcpIp
properties:
vpcId: ${vpc.vpcId}
subnetId: ${subnet.subnetId}
dhcpIpName: tf-example
variables:
zones:
fn::invoke:
function: tencentcloud:getAvailabilityZones
arguments: {}
Create VpcDhcpIp Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new VpcDhcpIp(name: string, args: VpcDhcpIpArgs, opts?: CustomResourceOptions);
@overload
def VpcDhcpIp(resource_name: str,
args: VpcDhcpIpArgs,
opts: Optional[ResourceOptions] = None)
@overload
def VpcDhcpIp(resource_name: str,
opts: Optional[ResourceOptions] = None,
dhcp_ip_name: Optional[str] = None,
subnet_id: Optional[str] = None,
vpc_id: Optional[str] = None,
vpc_dhcp_ip_id: Optional[str] = None)
func NewVpcDhcpIp(ctx *Context, name string, args VpcDhcpIpArgs, opts ...ResourceOption) (*VpcDhcpIp, error)
public VpcDhcpIp(string name, VpcDhcpIpArgs args, CustomResourceOptions? opts = null)
public VpcDhcpIp(String name, VpcDhcpIpArgs args)
public VpcDhcpIp(String name, VpcDhcpIpArgs args, CustomResourceOptions options)
type: tencentcloud:VpcDhcpIp
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 VpcDhcpIpArgs
- 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 VpcDhcpIpArgs
- 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 VpcDhcpIpArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args VpcDhcpIpArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args VpcDhcpIpArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
VpcDhcpIp 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 VpcDhcpIp resource accepts the following input properties:
- Dhcp
Ip stringName DhcpIp
name.- Subnet
Id string - Subnet
ID
. - Vpc
Id string - The private network
ID
. - Vpc
Dhcp stringIp Id - ID of the resource.
- Dhcp
Ip stringName DhcpIp
name.- Subnet
Id string - Subnet
ID
. - Vpc
Id string - The private network
ID
. - Vpc
Dhcp stringIp Id - ID of the resource.
- dhcp
Ip StringName DhcpIp
name.- subnet
Id String - Subnet
ID
. - vpc
Id String - The private network
ID
. - vpc
Dhcp StringIp Id - ID of the resource.
- dhcp
Ip stringName DhcpIp
name.- subnet
Id string - Subnet
ID
. - vpc
Id string - The private network
ID
. - vpc
Dhcp stringIp Id - ID of the resource.
- dhcp_
ip_ strname DhcpIp
name.- subnet_
id str - Subnet
ID
. - vpc_
id str - The private network
ID
. - vpc_
dhcp_ strip_ id - ID of the resource.
- dhcp
Ip StringName DhcpIp
name.- subnet
Id String - Subnet
ID
. - vpc
Id String - The private network
ID
. - vpc
Dhcp StringIp Id - ID of the resource.
Outputs
All input properties are implicitly available as output properties. Additionally, the VpcDhcpIp 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 VpcDhcpIp Resource
Get an existing VpcDhcpIp 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?: VpcDhcpIpState, opts?: CustomResourceOptions): VpcDhcpIp
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
dhcp_ip_name: Optional[str] = None,
subnet_id: Optional[str] = None,
vpc_dhcp_ip_id: Optional[str] = None,
vpc_id: Optional[str] = None) -> VpcDhcpIp
func GetVpcDhcpIp(ctx *Context, name string, id IDInput, state *VpcDhcpIpState, opts ...ResourceOption) (*VpcDhcpIp, error)
public static VpcDhcpIp Get(string name, Input<string> id, VpcDhcpIpState? state, CustomResourceOptions? opts = null)
public static VpcDhcpIp get(String name, Output<String> id, VpcDhcpIpState state, CustomResourceOptions options)
resources: _: type: tencentcloud:VpcDhcpIp 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.
- Dhcp
Ip stringName DhcpIp
name.- Subnet
Id string - Subnet
ID
. - Vpc
Dhcp stringIp Id - ID of the resource.
- Vpc
Id string - The private network
ID
.
- Dhcp
Ip stringName DhcpIp
name.- Subnet
Id string - Subnet
ID
. - Vpc
Dhcp stringIp Id - ID of the resource.
- Vpc
Id string - The private network
ID
.
- dhcp
Ip StringName DhcpIp
name.- subnet
Id String - Subnet
ID
. - vpc
Dhcp StringIp Id - ID of the resource.
- vpc
Id String - The private network
ID
.
- dhcp
Ip stringName DhcpIp
name.- subnet
Id string - Subnet
ID
. - vpc
Dhcp stringIp Id - ID of the resource.
- vpc
Id string - The private network
ID
.
- dhcp_
ip_ strname DhcpIp
name.- subnet_
id str - Subnet
ID
. - vpc_
dhcp_ strip_ id - ID of the resource.
- vpc_
id str - The private network
ID
.
- dhcp
Ip StringName DhcpIp
name.- subnet
Id String - Subnet
ID
. - vpc
Dhcp StringIp Id - ID of the resource.
- vpc
Id String - The private network
ID
.
Import
vpc dhcp_ip can be imported using the id, e.g.
$ pulumi import tencentcloud:index/vpcDhcpIp:VpcDhcpIp dhcp_ip dhcp_ip_id
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- tencentcloud tencentcloudstack/terraform-provider-tencentcloud
- License
- Notes
- This Pulumi package is based on the
tencentcloud
Terraform Provider.