code.dwrz.net

Go monorepo.
Log | Files | Refs

api_op_AssociateVPCWithHostedZone.go (5428B)


      1 // Code generated by smithy-go-codegen DO NOT EDIT.
      2 
      3 package route53
      4 
      5 import (
      6 	"context"
      7 	awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
      8 	"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
      9 	"github.com/aws/aws-sdk-go-v2/service/route53/types"
     10 	"github.com/aws/smithy-go/middleware"
     11 	smithyhttp "github.com/aws/smithy-go/transport/http"
     12 )
     13 
     14 // Associates an Amazon VPC with a private hosted zone. To perform the association,
     15 // the VPC and the private hosted zone must already exist. You can't convert a
     16 // public hosted zone into a private hosted zone. If you want to associate a VPC
     17 // that was created by using one Amazon Web Services account with a private hosted
     18 // zone that was created by using a different account, the Amazon Web Services
     19 // account that created the private hosted zone must first submit a
     20 // CreateVPCAssociationAuthorization request. Then the account that created the VPC
     21 // must submit an AssociateVPCWithHostedZone request. When granting access, the
     22 // hosted zone and the Amazon VPC must belong to the same partition. A partition is
     23 // a group of Amazon Web Services Regions. Each Amazon Web Services account is
     24 // scoped to one partition. The following are the supported partitions:
     25 //
     26 // * aws -
     27 // Amazon Web Services Regions
     28 //
     29 // * aws-cn - China Regions
     30 //
     31 // * aws-us-gov - Amazon Web
     32 // Services GovCloud (US) Region
     33 //
     34 // For more information, see Access Management
     35 // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in
     36 // the Amazon Web Services General Reference.
     37 func (c *Client) AssociateVPCWithHostedZone(ctx context.Context, params *AssociateVPCWithHostedZoneInput, optFns ...func(*Options)) (*AssociateVPCWithHostedZoneOutput, error) {
     38 	if params == nil {
     39 		params = &AssociateVPCWithHostedZoneInput{}
     40 	}
     41 
     42 	result, metadata, err := c.invokeOperation(ctx, "AssociateVPCWithHostedZone", params, optFns, c.addOperationAssociateVPCWithHostedZoneMiddlewares)
     43 	if err != nil {
     44 		return nil, err
     45 	}
     46 
     47 	out := result.(*AssociateVPCWithHostedZoneOutput)
     48 	out.ResultMetadata = metadata
     49 	return out, nil
     50 }
     51 
     52 // A complex type that contains information about the request to associate a VPC
     53 // with a private hosted zone.
     54 type AssociateVPCWithHostedZoneInput struct {
     55 
     56 	// The ID of the private hosted zone that you want to associate an Amazon VPC with.
     57 	// Note that you can't associate a VPC with a hosted zone that doesn't have an
     58 	// existing VPC association.
     59 	//
     60 	// This member is required.
     61 	HostedZoneId *string
     62 
     63 	// A complex type that contains information about the VPC that you want to
     64 	// associate with a private hosted zone.
     65 	//
     66 	// This member is required.
     67 	VPC *types.VPC
     68 
     69 	// Optional: A comment about the association request.
     70 	Comment *string
     71 
     72 	noSmithyDocumentSerde
     73 }
     74 
     75 // A complex type that contains the response information for the
     76 // AssociateVPCWithHostedZone request.
     77 type AssociateVPCWithHostedZoneOutput struct {
     78 
     79 	// A complex type that describes the changes made to your hosted zone.
     80 	//
     81 	// This member is required.
     82 	ChangeInfo *types.ChangeInfo
     83 
     84 	// Metadata pertaining to the operation's result.
     85 	ResultMetadata middleware.Metadata
     86 
     87 	noSmithyDocumentSerde
     88 }
     89 
     90 func (c *Client) addOperationAssociateVPCWithHostedZoneMiddlewares(stack *middleware.Stack, options Options) (err error) {
     91 	err = stack.Serialize.Add(&awsRestxml_serializeOpAssociateVPCWithHostedZone{}, middleware.After)
     92 	if err != nil {
     93 		return err
     94 	}
     95 	err = stack.Deserialize.Add(&awsRestxml_deserializeOpAssociateVPCWithHostedZone{}, middleware.After)
     96 	if err != nil {
     97 		return err
     98 	}
     99 	if err = addSetLoggerMiddleware(stack, options); err != nil {
    100 		return err
    101 	}
    102 	if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
    103 		return err
    104 	}
    105 	if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
    106 		return err
    107 	}
    108 	if err = addResolveEndpointMiddleware(stack, options); err != nil {
    109 		return err
    110 	}
    111 	if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
    112 		return err
    113 	}
    114 	if err = addRetryMiddlewares(stack, options); err != nil {
    115 		return err
    116 	}
    117 	if err = addHTTPSignerV4Middleware(stack, options); err != nil {
    118 		return err
    119 	}
    120 	if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
    121 		return err
    122 	}
    123 	if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
    124 		return err
    125 	}
    126 	if err = addClientUserAgent(stack); err != nil {
    127 		return err
    128 	}
    129 	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
    130 		return err
    131 	}
    132 	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
    133 		return err
    134 	}
    135 	if err = addOpAssociateVPCWithHostedZoneValidationMiddleware(stack); err != nil {
    136 		return err
    137 	}
    138 	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateVPCWithHostedZone(options.Region), middleware.Before); err != nil {
    139 		return err
    140 	}
    141 	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
    142 		return err
    143 	}
    144 	if err = addResponseErrorMiddleware(stack); err != nil {
    145 		return err
    146 	}
    147 	if err = addSanitizeURLMiddleware(stack); err != nil {
    148 		return err
    149 	}
    150 	if err = addRequestResponseLogging(stack, options); err != nil {
    151 		return err
    152 	}
    153 	return nil
    154 }
    155 
    156 func newServiceMetadataMiddleware_opAssociateVPCWithHostedZone(region string) *awsmiddleware.RegisterServiceMetadata {
    157 	return &awsmiddleware.RegisterServiceMetadata{
    158 		Region:        region,
    159 		ServiceID:     ServiceID,
    160 		SigningName:   "route53",
    161 		OperationName: "AssociateVPCWithHostedZone",
    162 	}
    163 }