api_op_CreateReusableDelegationSet.go (6826B)
1 // Code generated by smithy-go-codegen DO NOT EDIT. 2 3 package route53 4 5 import ( 6 "context" 7 "fmt" 8 awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" 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 // Creates a delegation set (a group of four name servers) that can be reused by 15 // multiple hosted zones that were created by the same Amazon Web Services account. 16 // You can also create a reusable delegation set that uses the four name servers 17 // that are associated with an existing hosted zone. Specify the hosted zone ID in 18 // the CreateReusableDelegationSet request. You can't associate a reusable 19 // delegation set with a private hosted zone. For information about using a 20 // reusable delegation set to configure white label name servers, see Configuring 21 // White Label Name Servers (https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/white-label-name-servers.html) 22 // . The process for migrating existing hosted zones to use a reusable delegation 23 // set is comparable to the process for configuring white label name servers. You 24 // need to perform the following steps: 25 // - Create a reusable delegation set. 26 // - Recreate hosted zones, and reduce the TTL to 60 seconds or less. 27 // - Recreate resource record sets in the new hosted zones. 28 // - Change the registrar's name servers to use the name servers for the new 29 // hosted zones. 30 // - Monitor traffic for the website or application. 31 // - Change TTLs back to their original values. 32 // 33 // If you want to migrate existing hosted zones to use a reusable delegation set, 34 // the existing hosted zones can't use any of the name servers that are assigned to 35 // the reusable delegation set. If one or more hosted zones do use one or more name 36 // servers that are assigned to the reusable delegation set, you can do one of the 37 // following: 38 // - For small numbers of hosted zones—up to a few hundred—it's relatively easy 39 // to create reusable delegation sets until you get one that has four name servers 40 // that don't overlap with any of the name servers in your hosted zones. 41 // - For larger numbers of hosted zones, the easiest solution is to use more 42 // than one reusable delegation set. 43 // - For larger numbers of hosted zones, you can also migrate hosted zones that 44 // have overlapping name servers to hosted zones that don't have overlapping name 45 // servers, then migrate the hosted zones again to use the reusable delegation set. 46 func (c *Client) CreateReusableDelegationSet(ctx context.Context, params *CreateReusableDelegationSetInput, optFns ...func(*Options)) (*CreateReusableDelegationSetOutput, error) { 47 if params == nil { 48 params = &CreateReusableDelegationSetInput{} 49 } 50 51 result, metadata, err := c.invokeOperation(ctx, "CreateReusableDelegationSet", params, optFns, c.addOperationCreateReusableDelegationSetMiddlewares) 52 if err != nil { 53 return nil, err 54 } 55 56 out := result.(*CreateReusableDelegationSetOutput) 57 out.ResultMetadata = metadata 58 return out, nil 59 } 60 61 type CreateReusableDelegationSetInput struct { 62 63 // A unique string that identifies the request, and that allows you to retry 64 // failed CreateReusableDelegationSet requests without the risk of executing the 65 // operation twice. You must use a unique CallerReference string every time you 66 // submit a CreateReusableDelegationSet request. CallerReference can be any unique 67 // string, for example a date/time stamp. 68 // 69 // This member is required. 70 CallerReference *string 71 72 // If you want to mark the delegation set for an existing hosted zone as reusable, 73 // the ID for that hosted zone. 74 HostedZoneId *string 75 76 noSmithyDocumentSerde 77 } 78 79 type CreateReusableDelegationSetOutput struct { 80 81 // A complex type that contains name server information. 82 // 83 // This member is required. 84 DelegationSet *types.DelegationSet 85 86 // The unique URL representing the new reusable delegation set. 87 // 88 // This member is required. 89 Location *string 90 91 // Metadata pertaining to the operation's result. 92 ResultMetadata middleware.Metadata 93 94 noSmithyDocumentSerde 95 } 96 97 func (c *Client) addOperationCreateReusableDelegationSetMiddlewares(stack *middleware.Stack, options Options) (err error) { 98 if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { 99 return err 100 } 101 err = stack.Serialize.Add(&awsRestxml_serializeOpCreateReusableDelegationSet{}, middleware.After) 102 if err != nil { 103 return err 104 } 105 err = stack.Deserialize.Add(&awsRestxml_deserializeOpCreateReusableDelegationSet{}, middleware.After) 106 if err != nil { 107 return err 108 } 109 if err := addProtocolFinalizerMiddlewares(stack, options, "CreateReusableDelegationSet"); err != nil { 110 return fmt.Errorf("add protocol finalizers: %v", err) 111 } 112 113 if err = addlegacyEndpointContextSetter(stack, options); err != nil { 114 return err 115 } 116 if err = addSetLoggerMiddleware(stack, options); err != nil { 117 return err 118 } 119 if err = addClientRequestID(stack); err != nil { 120 return err 121 } 122 if err = addComputeContentLength(stack); err != nil { 123 return err 124 } 125 if err = addResolveEndpointMiddleware(stack, options); err != nil { 126 return err 127 } 128 if err = addComputePayloadSHA256(stack); err != nil { 129 return err 130 } 131 if err = addRetry(stack, options); err != nil { 132 return err 133 } 134 if err = addRawResponseToMetadata(stack); err != nil { 135 return err 136 } 137 if err = addRecordResponseTiming(stack); err != nil { 138 return err 139 } 140 if err = addClientUserAgent(stack, options); err != nil { 141 return err 142 } 143 if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { 144 return err 145 } 146 if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { 147 return err 148 } 149 if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { 150 return err 151 } 152 if err = addOpCreateReusableDelegationSetValidationMiddleware(stack); err != nil { 153 return err 154 } 155 if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateReusableDelegationSet(options.Region), middleware.Before); err != nil { 156 return err 157 } 158 if err = addRecursionDetection(stack); err != nil { 159 return err 160 } 161 if err = addRequestIDRetrieverMiddleware(stack); err != nil { 162 return err 163 } 164 if err = addResponseErrorMiddleware(stack); err != nil { 165 return err 166 } 167 if err = addSanitizeURLMiddleware(stack); err != nil { 168 return err 169 } 170 if err = addRequestResponseLogging(stack, options); err != nil { 171 return err 172 } 173 if err = addDisableHTTPSMiddleware(stack, options); err != nil { 174 return err 175 } 176 return nil 177 } 178 179 func newServiceMetadataMiddleware_opCreateReusableDelegationSet(region string) *awsmiddleware.RegisterServiceMetadata { 180 return &awsmiddleware.RegisterServiceMetadata{ 181 Region: region, 182 ServiceID: ServiceID, 183 OperationName: "CreateReusableDelegationSet", 184 } 185 }