api_op_CreateVPCAssociationAuthorization.go (3995B)
1 // Code generated by smithy-go-codegen DO NOT EDIT. 2 3 package route53 4 5 import ( 6 "context" 7 8 "github.com/aws/aws-sdk-go-v2/service/route53/types" 9 "github.com/aws/smithy-go/middleware" 10 ) 11 12 // Authorizes the Amazon Web Services account that created a specified VPC to 13 // submit an AssociateVPCWithHostedZone request to associate the VPC with a 14 // specified hosted zone that was created by a different account. To submit a 15 // CreateVPCAssociationAuthorization request, you must use the account that created 16 // the hosted zone. After you authorize the association, use the account that 17 // created the VPC to submit an AssociateVPCWithHostedZone request. 18 // 19 // If you want to associate multiple VPCs that you created by using one account 20 // with a hosted zone that you created by using a different account, you must 21 // submit one authorization request for each VPC. 22 func (c *Client) CreateVPCAssociationAuthorization(ctx context.Context, params *CreateVPCAssociationAuthorizationInput, optFns ...func(*Options)) (*CreateVPCAssociationAuthorizationOutput, error) { 23 if params == nil { 24 params = &CreateVPCAssociationAuthorizationInput{} 25 } 26 27 result, metadata, err := c.invokeOperation(ctx, "CreateVPCAssociationAuthorization", params, optFns, c.addOperationCreateVPCAssociationAuthorizationMiddlewares) 28 if err != nil { 29 return nil, err 30 } 31 32 out := result.(*CreateVPCAssociationAuthorizationOutput) 33 out.ResultMetadata = metadata 34 return out, nil 35 } 36 37 // A complex type that contains information about the request to authorize 38 // associating a VPC with your private hosted zone. Authorization is only required 39 // when a private hosted zone and a VPC were created by using different accounts. 40 type CreateVPCAssociationAuthorizationInput struct { 41 42 // The ID of the private hosted zone that you want to authorize associating a VPC 43 // with. 44 // 45 // This member is required. 46 HostedZoneId *string 47 48 // A complex type that contains the VPC ID and region for the VPC that you want to 49 // authorize associating with your hosted zone. 50 // 51 // This member is required. 52 VPC *types.VPC 53 54 noSmithyDocumentSerde 55 } 56 57 // A complex type that contains the response information from a 58 // CreateVPCAssociationAuthorization request. 59 type CreateVPCAssociationAuthorizationOutput struct { 60 61 // The ID of the hosted zone that you authorized associating a VPC with. 62 // 63 // This member is required. 64 HostedZoneId *string 65 66 // The VPC that you authorized associating with a hosted zone. 67 // 68 // This member is required. 69 VPC *types.VPC 70 71 // Metadata pertaining to the operation's result. 72 ResultMetadata middleware.Metadata 73 74 noSmithyDocumentSerde 75 } 76 77 func (c *Client) addOperationCreateVPCAssociationAuthorizationMiddlewares(stack *middleware.Stack, options Options) (err error) { 78 err = stack.Serialize.Add(&awsRestxml_serializeOpCreateVPCAssociationAuthorization{}, middleware.After) 79 if err != nil { 80 return err 81 } 82 err = stack.Deserialize.Add(&awsRestxml_deserializeOpCreateVPCAssociationAuthorization{}, middleware.After) 83 if err != nil { 84 return err 85 } 86 87 if err = addComputeContentLength(stack); err != nil { 88 return err 89 } 90 if err = addResolveEndpointMiddleware(stack, options); err != nil { 91 return err 92 } 93 if err = addComputePayloadSHA256(stack); err != nil { 94 return err 95 } 96 if err = addRecordResponseTiming(stack, options); err != nil { 97 return err 98 } 99 if err = addCredentialSource(stack, options); err != nil { 100 return err 101 } 102 if err = addOpCreateVPCAssociationAuthorizationValidationMiddleware(stack); err != nil { 103 return err 104 } 105 if err = addRequestIDRetrieverMiddleware(stack); err != nil { 106 return err 107 } 108 if err = addResponseErrorMiddleware(stack); err != nil { 109 return err 110 } 111 if err = addSanitizeURLMiddleware(stack); err != nil { 112 return err 113 } 114 if err = addRequestResponseLogging(stack, options); err != nil { 115 return err 116 } 117 if err = addDisableHTTPSMiddleware(stack, options); err != nil { 118 return err 119 } 120 if err = addInterceptors(stack, options); err != nil { 121 return err 122 } 123 return nil 124 }