

# SwapEnvironmentCNAMEs


Swaps the CNAMEs of two environments.

## Request Parameters


 For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

 ** DestinationEnvironmentId **   
The ID of the destination environment.  
 Condition: You must specify at least the `DestinationEnvironmentID` or the `DestinationEnvironmentName`. You may also specify both. You must specify the `SourceEnvironmentId` with the `DestinationEnvironmentId`.   
Type: String  
Required: No

 ** DestinationEnvironmentName **   
The name of the destination environment.  
 Condition: You must specify at least the `DestinationEnvironmentID` or the `DestinationEnvironmentName`. You may also specify both. You must specify the `SourceEnvironmentName` with the `DestinationEnvironmentName`.   
Type: String  
Length Constraints: Minimum length of 4. Maximum length of 40.  
Required: No

 ** SourceEnvironmentId **   
The ID of the source environment.  
 Condition: You must specify at least the `SourceEnvironmentID` or the `SourceEnvironmentName`. You may also specify both. If you specify the `SourceEnvironmentId`, you must specify the `DestinationEnvironmentId`.   
Type: String  
Required: No

 ** SourceEnvironmentName **   
The name of the source environment.  
 Condition: You must specify at least the `SourceEnvironmentID` or the `SourceEnvironmentName`. You may also specify both. If you specify the `SourceEnvironmentName`, you must specify the `DestinationEnvironmentName`.   
Type: String  
Length Constraints: Minimum length of 4. Maximum length of 40.  
Required: No

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

## Examples


### Example


This example illustrates one usage of SwapEnvironmentCNAMEs.

#### Sample Request


```
https://elasticbeanstalk.us-west-2.amazonaws.com/?SourceEnvironmentName=SampleApp
&DestinationEnvironmentName=SampleApp2
&Operation=SwapEnvironmentCNAMEs
&AuthParams
```

#### Sample Response


```
<SwapEnvironmentCNAMEsResponse xmlns="http://elasticbeanstalk.amazonaws.com/docs/2010-12-01/">
  <ResponseMetadata>
    <RequestId>f4e1b145-9080-11e0-8e5a-a558e0ce1fc4</RequestId>
  </ResponseMetadata>
</SwapEnvironmentCNAMEsResponse>
```

## See Also


For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/elasticbeanstalk-2010-12-01/SwapEnvironmentCNAMEs) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/elasticbeanstalk-2010-12-01/SwapEnvironmentCNAMEs) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/elasticbeanstalk-2010-12-01/SwapEnvironmentCNAMEs) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/elasticbeanstalk-2010-12-01/SwapEnvironmentCNAMEs) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/elasticbeanstalk-2010-12-01/SwapEnvironmentCNAMEs) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/elasticbeanstalk-2010-12-01/SwapEnvironmentCNAMEs) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/elasticbeanstalk-2010-12-01/SwapEnvironmentCNAMEs) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/elasticbeanstalk-2010-12-01/SwapEnvironmentCNAMEs) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/elasticbeanstalk-2010-12-01/SwapEnvironmentCNAMEs) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/elasticbeanstalk-2010-12-01/SwapEnvironmentCNAMEs) 