modify_vpc_attribute
async
¶
modify_vpc_attribute(
*,
config_overrides: Optional[AsyncEC2ClientConfig] = None,
enable_dns_hostnames: Optional[AttributeBooleanValue] = None,
enable_dns_support: Optional[AttributeBooleanValue] = None,
vpc_id: Optional[VpcId] = None,
enable_network_address_usage_metrics: Optional[AttributeBooleanValue] = None,
) -> None
Modifies the specified attribute of the specified VPC.
Parameters:
-
enable_dns_hostnames(Optional[AttributeBooleanValue], default:None) –Indicates whether the instances launched in the VPC get DNS hostnames. If enabled, instances in the VPC get DNS hostnames; otherwise, they do not.
You cannot modify the DNS resolution and DNS hostnames attributes in the same request. Use separate requests for each attribute. You can only enable DNS hostnames if you've enabled DNS support.
-
enable_dns_support(Optional[AttributeBooleanValue], default:None) –Indicates whether the DNS resolution is supported for the VPC. If enabled, queries to the Amazon provided DNS server at the 169.254.169.253 IP address, or the reserved IP address at the base of the VPC network range "plus two" succeed. If disabled, the Amazon provided DNS service in the VPC that resolves public DNS hostnames to IP addresses is not enabled.
You cannot modify the DNS resolution and DNS hostnames attributes in the same request. Use separate requests for each attribute.
-
vpc_id(Optional[VpcId], default:None) –The ID of the VPC.
-
enable_network_address_usage_metrics(Optional[AttributeBooleanValue], default:None) –Indicates whether Network Address Usage metrics are enabled for your VPC.
Raises:
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
To modify the enableDnsSupport attribute This example modifies the enableDnsSupport attribute. This attribute indicates whether DNS resolution is enabled for the VPC. If this attribute is true, the Amazon DNS server resolves DNS hostnames for instances in the VPC to their corresponding IP addresses; otherwise, it does not.
>>> await client.modify_vpc_attribute(vpc_id='vpc-a01106c2', enable_dns_support={'Value': False})
To modify the enableDnsHostnames attribute
This example modifies the enableDnsHostnames attribute. This attribute indicates whether instances launched in the VPC get DNS hostnames. If this attribute is true, instances in the VPC get DNS hostnames; otherwise, they do not.
Source code in docs_src/capo_ec2/_services/async_ec2.py
54667 54668 54669 54670 54671 54672 54673 54674 54675 54676 54677 54678 54679 54680 54681 54682 54683 54684 54685 54686 54687 54688 54689 54690 54691 54692 54693 54694 54695 54696 54697 54698 54699 54700 54701 54702 54703 54704 54705 54706 54707 54708 54709 54710 54711 54712 54713 54714 54715 54716 54717 54718 54719 54720 54721 54722 54723 54724 54725 54726 54727 54728 54729 54730 54731 54732 54733 54734 54735 54736 54737 54738 | |