VpcDhcpOptionsAssociation
Provides a VPC DHCP Options Association resource.
Remarks
- You can only associate one DHCP Options Set to a given VPC ID.
- Removing the DHCP Options Association automatically sets AWS’s
defaultDHCP Options Set to the VPC.
Example Usage
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var dnsResolver = new Aws.Ec2.VpcDhcpOptionsAssociation("dnsResolver", new Aws.Ec2.VpcDhcpOptionsAssociationArgs
{
DhcpOptionsId = aws_vpc_dhcp_options.Foo.Id,
VpcId = aws_vpc.Foo.Id,
});
}
}
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v2/go/aws/ec2"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ec2.NewVpcDhcpOptionsAssociation(ctx, "dnsResolver", &ec2.VpcDhcpOptionsAssociationArgs{
DhcpOptionsId: pulumi.String(aws_vpc_dhcp_options.Foo.Id),
VpcId: pulumi.String(aws_vpc.Foo.Id),
})
if err != nil {
return err
}
return nil
})
}import pulumi
import pulumi_aws as aws
dns_resolver = aws.ec2.VpcDhcpOptionsAssociation("dnsResolver",
dhcp_options_id=aws_vpc_dhcp_options["foo"]["id"],
vpc_id=aws_vpc["foo"]["id"])import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const dnsResolver = new aws.ec2.VpcDhcpOptionsAssociation("dns_resolver", {
dhcpOptionsId: aws_vpc_dhcp_options_foo.id,
vpcId: aws_vpc_foo.id,
});Create a VpcDhcpOptionsAssociation Resource
new VpcDhcpOptionsAssociation(name: string, args: VpcDhcpOptionsAssociationArgs, opts?: CustomResourceOptions);def VpcDhcpOptionsAssociation(resource_name, opts=None, dhcp_options_id=None, vpc_id=None, __props__=None);func NewVpcDhcpOptionsAssociation(ctx *Context, name string, args VpcDhcpOptionsAssociationArgs, opts ...ResourceOption) (*VpcDhcpOptionsAssociation, error)public VpcDhcpOptionsAssociation(string name, VpcDhcpOptionsAssociationArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args VpcDhcpOptionsAssociationArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- opts ResourceOptions
- A bag of options that control this resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args VpcDhcpOptionsAssociationArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args VpcDhcpOptionsAssociationArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
VpcDhcpOptionsAssociation Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The VpcDhcpOptionsAssociation resource accepts the following input properties:
- Dhcp
Options stringId The ID of the DHCP Options Set to associate to the VPC.
- Vpc
Id string The ID of the VPC to which we would like to associate a DHCP Options Set.
- Dhcp
Options stringId The ID of the DHCP Options Set to associate to the VPC.
- Vpc
Id string The ID of the VPC to which we would like to associate a DHCP Options Set.
- dhcp
Options stringId The ID of the DHCP Options Set to associate to the VPC.
- vpc
Id string The ID of the VPC to which we would like to associate a DHCP Options Set.
- dhcp_
options_ strid The ID of the DHCP Options Set to associate to the VPC.
- vpc_
id str The ID of the VPC to which we would like to associate a DHCP Options Set.
Outputs
All input properties are implicitly available as output properties. Additionally, the VpcDhcpOptionsAssociation resource produces the following output properties:
Look up an Existing VpcDhcpOptionsAssociation Resource
Get an existing VpcDhcpOptionsAssociation 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?: VpcDhcpOptionsAssociationState, opts?: CustomResourceOptions): VpcDhcpOptionsAssociationstatic get(resource_name, id, opts=None, dhcp_options_id=None, vpc_id=None, __props__=None);func GetVpcDhcpOptionsAssociation(ctx *Context, name string, id IDInput, state *VpcDhcpOptionsAssociationState, opts ...ResourceOption) (*VpcDhcpOptionsAssociation, error)public static VpcDhcpOptionsAssociation Get(string name, Input<string> id, VpcDhcpOptionsAssociationState? state, CustomResourceOptions? opts = null)- 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.
The following state arguments are supported:
- Dhcp
Options stringId The ID of the DHCP Options Set to associate to the VPC.
- Vpc
Id string The ID of the VPC to which we would like to associate a DHCP Options Set.
- Dhcp
Options stringId The ID of the DHCP Options Set to associate to the VPC.
- Vpc
Id string The ID of the VPC to which we would like to associate a DHCP Options Set.
- dhcp
Options stringId The ID of the DHCP Options Set to associate to the VPC.
- vpc
Id string The ID of the VPC to which we would like to associate a DHCP Options Set.
- dhcp_
options_ strid The ID of the DHCP Options Set to associate to the VPC.
- vpc_
id str The ID of the VPC to which we would like to associate a DHCP Options Set.
Package Details
- Repository
- https://github.com/pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
awsTerraform Provider.