alicloud.vpc.DhcpOptionsSetAttachment
Explore with Pulumi AI
Provides a VPC Dhcp Options Set Attachment resource.
For information about VPC Dhcp Options Set and how to use it, see What is Dhcp Options Set.
NOTE: Available in v1.153.0+.
Example Usage
Basic Usage
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var exampleNetwork = new AliCloud.Vpc.Network("exampleNetwork", new()
{
VpcName = "test",
CidrBlock = "172.16.0.0/12",
});
var exampleDhcpOptionsSet = new AliCloud.Vpc.DhcpOptionsSet("exampleDhcpOptionsSet", new()
{
DhcpOptionsSetName = "example_value",
DhcpOptionsSetDescription = "example_value",
DomainName = "example.com",
DomainNameServers = "100.100.2.136",
});
var exampleDhcpOptionsSetAttachment = new AliCloud.Vpc.DhcpOptionsSetAttachment("exampleDhcpOptionsSetAttachment", new()
{
VpcId = exampleNetwork.Id,
DhcpOptionsSetId = exampleDhcpOptionsSet.Id,
});
});
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 {
exampleNetwork, err := vpc.NewNetwork(ctx, "exampleNetwork", &vpc.NetworkArgs{
VpcName: pulumi.String("test"),
CidrBlock: pulumi.String("172.16.0.0/12"),
})
if err != nil {
return err
}
exampleDhcpOptionsSet, err := vpc.NewDhcpOptionsSet(ctx, "exampleDhcpOptionsSet", &vpc.DhcpOptionsSetArgs{
DhcpOptionsSetName: pulumi.String("example_value"),
DhcpOptionsSetDescription: pulumi.String("example_value"),
DomainName: pulumi.String("example.com"),
DomainNameServers: pulumi.String("100.100.2.136"),
})
if err != nil {
return err
}
_, err = vpc.NewDhcpOptionsSetAttachment(ctx, "exampleDhcpOptionsSetAttachment", &vpc.DhcpOptionsSetAttachmentArgs{
VpcId: exampleNetwork.ID(),
DhcpOptionsSetId: exampleDhcpOptionsSet.ID(),
})
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.DhcpOptionsSet;
import com.pulumi.alicloud.vpc.DhcpOptionsSetArgs;
import com.pulumi.alicloud.vpc.DhcpOptionsSetAttachment;
import com.pulumi.alicloud.vpc.DhcpOptionsSetAttachmentArgs;
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 exampleNetwork = new Network("exampleNetwork", NetworkArgs.builder()
.vpcName("test")
.cidrBlock("172.16.0.0/12")
.build());
var exampleDhcpOptionsSet = new DhcpOptionsSet("exampleDhcpOptionsSet", DhcpOptionsSetArgs.builder()
.dhcpOptionsSetName("example_value")
.dhcpOptionsSetDescription("example_value")
.domainName("example.com")
.domainNameServers("100.100.2.136")
.build());
var exampleDhcpOptionsSetAttachment = new DhcpOptionsSetAttachment("exampleDhcpOptionsSetAttachment", DhcpOptionsSetAttachmentArgs.builder()
.vpcId(exampleNetwork.id())
.dhcpOptionsSetId(exampleDhcpOptionsSet.id())
.build());
}
}
import pulumi
import pulumi_alicloud as alicloud
example_network = alicloud.vpc.Network("exampleNetwork",
vpc_name="test",
cidr_block="172.16.0.0/12")
example_dhcp_options_set = alicloud.vpc.DhcpOptionsSet("exampleDhcpOptionsSet",
dhcp_options_set_name="example_value",
dhcp_options_set_description="example_value",
domain_name="example.com",
domain_name_servers="100.100.2.136")
example_dhcp_options_set_attachment = alicloud.vpc.DhcpOptionsSetAttachment("exampleDhcpOptionsSetAttachment",
vpc_id=example_network.id,
dhcp_options_set_id=example_dhcp_options_set.id)
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const exampleNetwork = new alicloud.vpc.Network("exampleNetwork", {
vpcName: "test",
cidrBlock: "172.16.0.0/12",
});
const exampleDhcpOptionsSet = new alicloud.vpc.DhcpOptionsSet("exampleDhcpOptionsSet", {
dhcpOptionsSetName: "example_value",
dhcpOptionsSetDescription: "example_value",
domainName: "example.com",
domainNameServers: "100.100.2.136",
});
const exampleDhcpOptionsSetAttachment = new alicloud.vpc.DhcpOptionsSetAttachment("exampleDhcpOptionsSetAttachment", {
vpcId: exampleNetwork.id,
dhcpOptionsSetId: exampleDhcpOptionsSet.id,
});
resources:
exampleNetwork:
type: alicloud:vpc:Network
properties:
vpcName: test
cidrBlock: 172.16.0.0/12
exampleDhcpOptionsSet:
type: alicloud:vpc:DhcpOptionsSet
properties:
dhcpOptionsSetName: example_value
dhcpOptionsSetDescription: example_value
domainName: example.com
domainNameServers: 100.100.2.136
exampleDhcpOptionsSetAttachment:
type: alicloud:vpc:DhcpOptionsSetAttachment
properties:
vpcId: ${exampleNetwork.id}
dhcpOptionsSetId: ${exampleDhcpOptionsSet.id}
Create DhcpOptionsSetAttachment Resource
new DhcpOptionsSetAttachment(name: string, args: DhcpOptionsSetAttachmentArgs, opts?: CustomResourceOptions);
@overload
def DhcpOptionsSetAttachment(resource_name: str,
opts: Optional[ResourceOptions] = None,
dhcp_options_set_id: Optional[str] = None,
dry_run: Optional[bool] = None,
vpc_id: Optional[str] = None)
@overload
def DhcpOptionsSetAttachment(resource_name: str,
args: DhcpOptionsSetAttachmentArgs,
opts: Optional[ResourceOptions] = None)
func NewDhcpOptionsSetAttachment(ctx *Context, name string, args DhcpOptionsSetAttachmentArgs, opts ...ResourceOption) (*DhcpOptionsSetAttachment, error)
public DhcpOptionsSetAttachment(string name, DhcpOptionsSetAttachmentArgs args, CustomResourceOptions? opts = null)
public DhcpOptionsSetAttachment(String name, DhcpOptionsSetAttachmentArgs args)
public DhcpOptionsSetAttachment(String name, DhcpOptionsSetAttachmentArgs args, CustomResourceOptions options)
type: alicloud:vpc:DhcpOptionsSetAttachment
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DhcpOptionsSetAttachmentArgs
- 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 DhcpOptionsSetAttachmentArgs
- 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 DhcpOptionsSetAttachmentArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DhcpOptionsSetAttachmentArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args DhcpOptionsSetAttachmentArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
DhcpOptionsSetAttachment 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 DhcpOptionsSetAttachment resource accepts the following input properties:
- Dhcp
Options stringSet Id The ID of the DHCP options set.
- Vpc
Id string The ID of the VPC network that is to be associated with the DHCP options set..
- Dry
Run bool Specifies whether to precheck this request only. Default values:
false
. Valid values:
- Dhcp
Options stringSet Id The ID of the DHCP options set.
- Vpc
Id string The ID of the VPC network that is to be associated with the DHCP options set..
- Dry
Run bool Specifies whether to precheck this request only. Default values:
false
. Valid values:
- dhcp
Options StringSet Id The ID of the DHCP options set.
- vpc
Id String The ID of the VPC network that is to be associated with the DHCP options set..
- dry
Run Boolean Specifies whether to precheck this request only. Default values:
false
. Valid values:
- dhcp
Options stringSet Id The ID of the DHCP options set.
- vpc
Id string The ID of the VPC network that is to be associated with the DHCP options set..
- dry
Run boolean Specifies whether to precheck this request only. Default values:
false
. Valid values:
- dhcp_
options_ strset_ id The ID of the DHCP options set.
- vpc_
id str The ID of the VPC network that is to be associated with the DHCP options set..
- dry_
run bool Specifies whether to precheck this request only. Default values:
false
. Valid values:
- dhcp
Options StringSet Id The ID of the DHCP options set.
- vpc
Id String The ID of the VPC network that is to be associated with the DHCP options set..
- dry
Run Boolean Specifies whether to precheck this request only. Default values:
false
. Valid values:
Outputs
All input properties are implicitly available as output properties. Additionally, the DhcpOptionsSetAttachment resource produces the following output properties:
Look up Existing DhcpOptionsSetAttachment Resource
Get an existing DhcpOptionsSetAttachment 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?: DhcpOptionsSetAttachmentState, opts?: CustomResourceOptions): DhcpOptionsSetAttachment
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
dhcp_options_set_id: Optional[str] = None,
dry_run: Optional[bool] = None,
status: Optional[str] = None,
vpc_id: Optional[str] = None) -> DhcpOptionsSetAttachment
func GetDhcpOptionsSetAttachment(ctx *Context, name string, id IDInput, state *DhcpOptionsSetAttachmentState, opts ...ResourceOption) (*DhcpOptionsSetAttachment, error)
public static DhcpOptionsSetAttachment Get(string name, Input<string> id, DhcpOptionsSetAttachmentState? state, CustomResourceOptions? opts = null)
public static DhcpOptionsSetAttachment get(String name, Output<String> id, DhcpOptionsSetAttachmentState 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.
- Dhcp
Options stringSet Id The ID of the DHCP options set.
- Dry
Run bool Specifies whether to precheck this request only. Default values:
false
. Valid values:- Status string
The status of the VPC network that is associated with the DHCP options set. Valid values:
InUse
orPending
.- Vpc
Id string The ID of the VPC network that is to be associated with the DHCP options set..
- Dhcp
Options stringSet Id The ID of the DHCP options set.
- Dry
Run bool Specifies whether to precheck this request only. Default values:
false
. Valid values:- Status string
The status of the VPC network that is associated with the DHCP options set. Valid values:
InUse
orPending
.- Vpc
Id string The ID of the VPC network that is to be associated with the DHCP options set..
- dhcp
Options StringSet Id The ID of the DHCP options set.
- dry
Run Boolean Specifies whether to precheck this request only. Default values:
false
. Valid values:- status String
The status of the VPC network that is associated with the DHCP options set. Valid values:
InUse
orPending
.- vpc
Id String The ID of the VPC network that is to be associated with the DHCP options set..
- dhcp
Options stringSet Id The ID of the DHCP options set.
- dry
Run boolean Specifies whether to precheck this request only. Default values:
false
. Valid values:- status string
The status of the VPC network that is associated with the DHCP options set. Valid values:
InUse
orPending
.- vpc
Id string The ID of the VPC network that is to be associated with the DHCP options set..
- dhcp_
options_ strset_ id The ID of the DHCP options set.
- dry_
run bool Specifies whether to precheck this request only. Default values:
false
. Valid values:- status str
The status of the VPC network that is associated with the DHCP options set. Valid values:
InUse
orPending
.- vpc_
id str The ID of the VPC network that is to be associated with the DHCP options set..
- dhcp
Options StringSet Id The ID of the DHCP options set.
- dry
Run Boolean Specifies whether to precheck this request only. Default values:
false
. Valid values:- status String
The status of the VPC network that is associated with the DHCP options set. Valid values:
InUse
orPending
.- vpc
Id String The ID of the VPC network that is to be associated with the DHCP options set..
Import
VPC Dhcp Options Set Attachment can be imported using the id, e.g.
$ pulumi import alicloud:vpc/dhcpOptionsSetAttachment:DhcpOptionsSetAttachment 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.