associateVPCWithHostedZone method

Future<AssociateVPCWithHostedZoneResponse> associateVPCWithHostedZone({
  1. required String hostedZoneId,
  2. required VPC vpc,
  3. String? comment,
})

Associates an Amazon VPC with a private hosted zone.

The following are the supported partitions:

  • aws - Amazon Web Services Regions
  • aws-cn - China Regions
  • aws-us-gov - Amazon Web Services GovCloud (US) Region
For more information, see Access Management in the Amazon Web Services General Reference.

May throw ConflictingDomainExists. May throw InvalidInput. May throw InvalidVPCId. May throw LimitsExceeded. May throw NoSuchHostedZone. May throw NotAuthorizedException. May throw PriorRequestNotComplete. May throw PublicZoneVPCAssociation.

Parameter hostedZoneId : The ID of the private hosted zone that you want to associate an Amazon VPC with.

Note that you can't associate a VPC with a hosted zone that doesn't have an existing VPC association.

Parameter vpc : A complex type that contains information about the VPC that you want to associate with a private hosted zone.

Parameter comment : Optional: A comment about the association request.

Implementation

Future<AssociateVPCWithHostedZoneResponse> associateVPCWithHostedZone({
  required String hostedZoneId,
  required VPC vpc,
  String? comment,
}) async {
  final $result = await _protocol.send(
    method: 'POST',
    requestUri:
        '/2013-04-01/hostedzone/${Uri.encodeComponent(hostedZoneId)}/associatevpc',
    payload: AssociateVPCWithHostedZoneRequest(
            hostedZoneId: hostedZoneId, vpc: vpc, comment: comment)
        .toXml('AssociateVPCWithHostedZoneRequest'),
    exceptionFnMap: _exceptionFns,
  );
  return AssociateVPCWithHostedZoneResponse.fromXml($result.body);
}