Skip to content

EC2  >  Operations  >  modify_vpc_tenancy

modify_vpc_tenancy

Operation

modify_vpc_tenancy async

modify_vpc_tenancy(request: ModifyVpcTenancyInput | ModifyVpcTenancyInputDict, /, *, plugins: list[Plugin] | None = None) -> ModifyVpcTenancyOutput
modify_vpc_tenancy(*, plugins: list[Plugin] | None = None, **kwargs: Unpack[ModifyVpcTenancyInputDict]) -> ModifyVpcTenancyOutput

Modifies the instance tenancy attribute of the specified VPC. You can change the instance tenancy attribute of a VPC to default only. You cannot change the instance tenancy attribute to dedicated.

After you modify the tenancy of the VPC, any new instances that you launch into the VPC have a tenancy of default, unless you specify otherwise during launch. The tenancy of any existing instances in the VPC is not affected.

For more information, see Dedicated Instances in the Amazon EC2 User Guide.

Parameters:

Name Type Description Default
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None

Returns:

Type Description
ModifyVpcTenancyOutput

An instance of ModifyVpcTenancyOutput.

Input

Pass the input fields as keyword arguments, or pass a model or dictionary as the first positional argument. Pass plugins separately as a keyword argument.

Model

ModifyVpcTenancyInput dataclass

Bases: _SerdeShape

Dataclass for ModifyVpcTenancyInput structure.

Attributes
dry_run class-attribute instance-attribute
dry_run: bool | None = ...

Checks whether you have the required permissions for the action, 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.

instance_tenancy class-attribute instance-attribute
instance_tenancy: str | None = ...

The instance tenancy attribute for the VPC.

vpc_id class-attribute instance-attribute
vpc_id: str | None = ...

The ID of the VPC.

Dictionaries

ModifyVpcTenancyInputDict

Bases: TypedDict

Dictionary form of ModifyVpcTenancyInput.

Attributes
dry_run instance-attribute
dry_run: bool | None

Checks whether you have the required permissions for the action, 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.

instance_tenancy instance-attribute
instance_tenancy: Required[str]

The instance tenancy attribute for the VPC.

vpc_id instance-attribute
vpc_id: Required[str]

The ID of the VPC.

Output

ModifyVpcTenancyOutput dataclass

Bases: _SerdeShape

Dataclass for ModifyVpcTenancyOutput structure.

Attributes

response_metadata class-attribute instance-attribute
response_metadata: ResponseMetadata = ...

Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.

return_value class-attribute instance-attribute
return_value: bool | None = ...

Returns true if the request succeeds; otherwise, returns an error.