AWS SDK Version 3 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Creates a custom set of DHCP options. After you create a DHCP option set, you associate it with a VPC. After you associate a DHCP option set with a VPC, all existing and newly launched instances in the VPC use this set of DHCP options.

The following are the individual DHCP options you can specify. For more information, see DHCP options sets in the Amazon VPC User Guide.

Note:

For .NET Core this operation is only available in asynchronous form. Please refer to CreateDhcpOptionsAsync.

Namespace: Amazon.EC2
Assembly: AWSSDK.EC2.dll
Version: 3.x.y.z

Syntax

C#
public virtual CreateDhcpOptionsResponse CreateDhcpOptions(
         CreateDhcpOptionsRequest request
)

Parameters

request
Type: Amazon.EC2.Model.CreateDhcpOptionsRequest

Container for the necessary parameters to execute the CreateDhcpOptions service method.

Return Value


The response from the CreateDhcpOptions service method, as returned by EC2.

Examples

This example creates a DHCP options set.

To create a DHCP options set


var client = new AmazonEC2Client();
var response = client.CreateDhcpOptions(new CreateDhcpOptionsRequest 
{
    DhcpConfigurations = new List<DhcpConfiguration> {
        new DhcpConfiguration {
            Key = "domain-name-servers",
            Values = new List<string> {
                "10.2.5.1",
                "10.2.5.2"
            }
        }
    }
});

DhcpOptions dhcpOptions = response.DhcpOptions;

            

Version Information

.NET Framework:
Supported in: 4.5, 4.0, 3.5

See Also