dhcp_option#

Autogenerated using pop-create-idem

hub.exec.boto3.client.ec2.associate_dhcp_options hub.exec.boto3.client.ec2.create_dhcp_options hub.exec.boto3.client.ec2.delete_dhcp_options hub.exec.boto3.client.ec2.describe_dhcp_options

async idem_aws.states.aws.ec2.dhcp_option.present(hub, ctx, name: str, dhcp_configurations: List[NewDhcpConfiguration] = None, resource_id: str = None, tags: Dict[str, Any] = None, vpc_id: List[str] = None) Dict[str, Any][source]#

Creates a set of DHCP options for your VPC.

After creating the set, you must associate it with the VPC, causing all existing and new instances that you launch in the VPC to use this set of DHCP options. The following are the individual DHCP options you can specify. For more information about the options, see RFC 2132.

domain-name-servers - The IP addresses of up to four domain name servers, or AmazonProvidedDNS. The default DHCP option set specifies AmazonProvidedDNS. If specifying more than one domain name server, specify the IP addresses in a single parameter, separated by commas. To have your instance receive a custom DNS hostname as specified in domain-name, you must set domain-name-servers to a custom DNS server.

domain-name - If you’re using AmazonProvidedDNS in us-east-1, specify ec2.internal. If you’re using AmazonProvidedDNS in another Region, specify region.compute.internal (for example, ap-northeast-1.compute.internal). Otherwise, specify a domain name (for example, ExampleCompany.com). This value is used to complete unqualified DNS hostnames. Important: Some Linux operating systems accept multiple domain names separated by spaces. However, Windows and other Linux operating systems treat the value as a single domain, which results in unexpected behavior. If your DHCP options set is associated with a VPC that has instances with multiple operating systems, specify only one domain name.

ntp-servers - The IP addresses of up to four Network Time Protocol (NTP) servers.

netbios-name-servers - The IP addresses of up to four NetBIOS name servers.

netbios-node-type - The NetBIOS node type (1, 2, 4, or 8).

We recommend that you specify 2 (broadcast and multicast are not currently supported). For more information about these node types, see RFC 2132. Your VPC automatically starts out with a set of DHCP options that includes only a DNS server that we provide (AmazonProvidedDNS). If you create a set of options, and if your VPC has an internet gateway, make sure to set the domain-name-servers option either to AmazonProvidedDNS or to a domain name server of your choice. For more information, see DHCP options sets in the Amazon Virtual Private Cloud User Guide.

Parameters:
  • name (str) – An Idem name to identify the dhcp option resource.

  • dhcp_configurations (list) –

    A DHCP configuration option.

    • Key (str, Optional):

      The name of a DHCP option. Options are domain-name-servers|domain-name|ntp-servers|netbios-name-servers|netbios-node-type.

    • Values (list[str], Optional):

      One or more values for the DHCP option.

      • Value (str):

        The attribute value. The value is case-sensitive.

  • resource_id (str, Optional) – AWS DHCP Option Set ID.

  • tags (dict or list, Optional) –

    Dict in the format of {tag-key: tag-value} or List of tags in the format of [{“Key”: tag-key, “Value”: tag-value}] to associate with the dhcp option resource. Defaults to None.

    • Key (str):

      The key of the tag. Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws: .

    • Value (str):

      The value of the tag. Tag values are case-sensitive and accept a maximum of 255 Unicode characters.

  • vpc_id (list, Optional) – The list of AWS VPC ID that needs to be associated with dhcp options set.

Request Syntax:
[dhcp_option-name]:
  aws.ec2.dhcp_option.present:
    - resource_id: 'string'
    - dhcp_configurations:
        - Key: 'string'
          Values: List
              - Value: 'string'
    - vpc_id: 'List'
    - tags:
        - Key: 'string'
          Value: 'string'
Returns:

Dict[str, Any]

Examples

my-dhcp-option:
  aws.ec2.dhcp_option.present:
    - dhcp_configurations:
        - Key: domain-name-servers
          Values:
                - Value : 10.2.5.1
                - Value : 10.2.5.2
    - vpc_id:
      - vpc-76db75b8
    - tags:
        - Key: test_name
          Value: test-dhcp
async idem_aws.states.aws.ec2.dhcp_option.absent(hub, ctx, name: str, resource_id: str = None) Dict[str, Any][source]#

Deletes the specified set of DHCP options.

You must disassociate the set of DHCP options before you can delete it. You can disassociate the set of DHCP options by associating either a new set of options or the default set of options with the VPC.

Parameters:
  • name (str) – An Idem name to identify the dhcp option resource.

  • resource_id (str, Optional) – AWS DHCP Option Set ID. Idem automatically considers this resource being absent if this field is not specified.

Request Syntax:
[dhcp_option-name]:
  aws.ec2.dhcp_option.absent:
    - name: 'string'
    - resource_id: 'string'
Returns:

Dict[str, Any]

Examples

resource_is_absent:
  aws.ec2.dhcp_option.absent:
    - name: value
async idem_aws.states.aws.ec2.dhcp_option.describe(hub, ctx) Dict[str, Dict[str, Any]][source]#

Describe the resource in a way that can be recreated/managed with the corresponding “present” function

Describes one or more of your DHCP options sets. For more information, see DHCP options sets in the Amazon Virtual Private Cloud User Guide.

Returns:

Dict[str, Any]

Examples

$ idem describe aws.ec2.dhcp_option