modify_vpc_attribute
¶
modify_vpc_attribute(
*,
config_overrides: Optional[EC2ClientConfig] = 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.
>>> 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/ec2.py
53917 53918 53919 53920 53921 53922 53923 53924 53925 53926 53927 53928 53929 53930 53931 53932 53933 53934 53935 53936 53937 53938 53939 53940 53941 53942 53943 53944 53945 53946 53947 53948 53949 53950 53951 53952 53953 53954 53955 53956 53957 53958 53959 53960 53961 53962 53963 53964 53965 53966 53967 53968 53969 53970 53971 53972 53973 53974 53975 53976 53977 53978 53979 53980 53981 53982 53983 53984 53985 53986 53987 | |