Skip to content

modify_availability_zone_group async

modify_availability_zone_group(
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    group_name: Optional[String] = None,
    opt_in_status: Optional[ModifyAvailabilityZoneOptInStatus] = None,
    dry_run: Optional[Boolean] = None,
) -> ModifyAvailabilityZoneGroupResult

Changes the opt-in status of the specified zone group for your account.

Parameters:

  • group_name (Optional[String], default: None ) –

    The name of the Availability Zone group, Local Zone group, or Wavelength Zone group.

  • opt_in_status (Optional[ModifyAvailabilityZoneOptInStatus], default: None ) –

    Indicates whether to opt in to the zone group. The only valid value is opted-in. You must contact Amazon Web Services Support to opt out of a Local Zone or Wavelength Zone group.

  • dry_run (Optional[Boolean], default: 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.

Raises:

Source code in docs_src/capo_ec2/_services/async_ec2.py
async def modify_availability_zone_group(
    self,
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    group_name: Optional["capo_ec2.types.string.String"] = None,
    opt_in_status: Optional[
        "capo_ec2.types.modify_availability_zone_opt_in_status.ModifyAvailabilityZoneOptInStatus"
    ] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
) -> "capo_ec2.types.modify_availability_zone_group_result.ModifyAvailabilityZoneGroupResult":
    """<p>Changes the opt-in status of the specified zone group for your account.</p>

    Args:
        group_name: <p>The name of the Availability Zone group, Local Zone group, or Wavelength Zone group.</p>
        opt_in_status: <p>Indicates whether to opt in to the zone group. The only valid value is <code>opted-in</code>. You must contact Amazon Web Services Support to opt out of a Local Zone or Wavelength Zone group.</p>
        dry_run: <p>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 <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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_ec2.types.modify_availability_zone_group_request.ModifyAvailabilityZoneGroupRequest]",
    ) -> AsyncOperationResponse[
        "capo_ec2.types.modify_availability_zone_group_result.ModifyAvailabilityZoneGroupResult"
    ]:
        import capo_ec2._operations.amazon_ec2.modify_availability_zone_group

        (
            output,
            http_response,
        ) = await capo_ec2._operations.amazon_ec2.modify_availability_zone_group.async_modify_availability_zone_group(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ModifyAvailabilityZoneGroup")
    )
    input_: capo_ec2.types.modify_availability_zone_group_request.ModifyAvailabilityZoneGroupRequest = {}
    if group_name is not None:
        input_["group_name"] = group_name
    if opt_in_status is not None:
        input_["opt_in_status"] = opt_in_status
    if dry_run is not None:
        input_["dry_run"] = dry_run

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output