Skip to content

modify_public_ip_dns_name_options

modify_public_ip_dns_name_options(
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    network_interface_id: Optional[NetworkInterfaceId] = None,
    hostname_type: Optional[PublicIpDnsOption] = None,
    dry_run: Optional[Boolean] = None,
) -> ModifyPublicIpDnsNameOptionsResult

Modify public hostname options for a network interface. For more information, see EC2 instance hostnames, DNS names, and domains in the Amazon EC2 User Guide.

Parameters:

  • network_interface_id (Optional[NetworkInterfaceId], default: None ) –

    A network interface ID.

  • hostname_type (Optional[PublicIpDnsOption], default: None ) –

    The public hostname type. For more information, see EC2 instance hostnames, DNS names, and domains in the Amazon EC2 User Guide.

    • public-dual-stack-dns-name: A dual-stack public hostname for a network interface. Requests from within the VPC resolve to both the private IPv4 address and the IPv6 Global Unicast Address of the network interface. Requests from the internet resolve to both the public IPv4 and the IPv6 GUA address of the network interface.

    • public-ipv4-dns-name: An IPv4-enabled public hostname for a network interface. Requests from within the VPC resolve to the private primary IPv4 address of the network interface. Requests from the internet resolve to the public IPv4 address of the network interface.

    • public-ipv6-dns-name: An IPv6-enabled public hostname for a network interface. Requests from within the VPC or from the internet resolve to the IPv6 GUA of the network interface.

  • dry_run (Optional[Boolean], default: None ) –

    Checks whether you have the required permissions for the operation, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Raises:

Source code in docs_src/capo_ec2/_services/ec2.py
def modify_public_ip_dns_name_options(
    self,
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    network_interface_id: Optional[
        "capo_ec2.types.network_interface_id.NetworkInterfaceId"
    ] = None,
    hostname_type: Optional[
        "capo_ec2.types.public_ip_dns_option.PublicIpDnsOption"
    ] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
) -> "capo_ec2.types.modify_public_ip_dns_name_options_result.ModifyPublicIpDnsNameOptionsResult":
    """<p>Modify public hostname options for a network interface. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-naming.html">EC2 instance hostnames, DNS names, and domains</a> in the <i>Amazon EC2 User Guide</i>.</p>

    Args:
        network_interface_id: <p>A network interface ID.</p>
        hostname_type: <p>The public hostname type. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-naming.html">EC2 instance hostnames, DNS names, and domains</a> in the <i>Amazon EC2 User Guide</i>.</p> <ul> <li> <p> <code>public-dual-stack-dns-name</code>: A dual-stack public hostname for a network interface. Requests from within the VPC resolve to both the private IPv4 address and the IPv6 Global Unicast Address of the network interface. Requests from the internet resolve to both the public IPv4 and the IPv6 GUA address of the network interface.</p> </li> <li> <p> <code>public-ipv4-dns-name</code>: An IPv4-enabled public hostname for a network interface. Requests from within the VPC resolve to the private primary IPv4 address of the network interface. Requests from the internet resolve to the public IPv4 address of the network interface.</p> </li> <li> <p> <code>public-ipv6-dns-name</code>: An IPv6-enabled public hostname for a network interface. Requests from within the VPC or from the internet resolve to the IPv6 GUA of the network interface. </p> </li> </ul>
        dry_run: <p>Checks whether you have the required permissions for the operation, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>

    Raises:
        capo_ec2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_ec2.types.modify_public_ip_dns_name_options_request.ModifyPublicIpDnsNameOptionsRequest]",
    ) -> OperationResponse[
        "capo_ec2.types.modify_public_ip_dns_name_options_result.ModifyPublicIpDnsNameOptionsResult"
    ]:
        import capo_ec2._operations.amazon_ec2.modify_public_ip_dns_name_options

        output, http_response = (
            capo_ec2._operations.amazon_ec2.modify_public_ip_dns_name_options.modify_public_ip_dns_name_options(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ModifyPublicIpDnsNameOptions")
    )
    input_: capo_ec2.types.modify_public_ip_dns_name_options_request.ModifyPublicIpDnsNameOptionsRequest = {}
    if network_interface_id is not None:
        input_["network_interface_id"] = network_interface_id
    if hostname_type is not None:
        input_["hostname_type"] = hostname_type
    if dry_run is not None:
        input_["dry_run"] = dry_run

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output