//snippet-sourcedescription:[ReleaseAddress.java demonstrates how to release an elastic IP address.]
//snippet-keyword:[SDK for Java 2.0]
//snippet-keyword:[Code Sample]
//snippet-service:[ec2]
//snippet-sourcetype:[full-example]
//snippet-sourcedate:[]
//snippet-sourceauthor:[soo-aws]
/*
 * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License").
 * You may not use this file except in compliance with the License.
 * A copy of the License is located at
 *
 *  http://aws.amazon.com/apache2.0
 *
 * or in the "license" file accompanying this file. This file is distributed
 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
 * express or implied. See the License for the specific language governing
 * permissions and limitations under the License.
 */
package com.example.ec2;
// snippet-start:[ec2.java2.release_instance.complete]
// snippet-start:[ec2.java2.release_instance.import]

import software.amazon.awssdk.services.ec2.Ec2Client;
import software.amazon.awssdk.services.ec2.model.ReleaseAddressRequest;
import software.amazon.awssdk.services.ec2.model.ReleaseAddressResponse;
 
// snippet-end:[ec2.java2.release_instance.import]
/**
 * Releases an elastic IP address
 */
public class ReleaseAddress
{
    public static void main(String[] args)
    {
        final String USAGE =
            "To run this example, supply an allocation ID.\n" +
            "Ex: ReleaseAddress <allocation_id>\n";

        if (args.length != 1) {
            System.out.println(USAGE);
            System.exit(1);
        }

        String alloc_id = args[0];
        // snippet-start:[ec2.java2.release_instance.main]

        Ec2Client ec2 = Ec2Client.create();

        ReleaseAddressRequest request = ReleaseAddressRequest.builder()
            .allocationId(alloc_id).build();

        ReleaseAddressResponse response = ec2.releaseAddress(request);

        // snippet-end:[ec2.java2.release_instance.main]
        System.out.printf(
            "Successfully released elastic IP address %s", alloc_id);
    }
}
 
// snippet-end:[ec2.java2.release_instance.complete]

@@ -250,16 +250,26 @@
 cedate:%5B
+11/02/2020
 %5D%0D%0A//sni
@@ -292,14 +292,15 @@
 r:%5Bs
-oo-aws
+cmacdon
 %5D%0D%0A/
@@ -326,10 +326,10 @@
 0-20
-19
+20
  Ama
@@ -1237,17 +1237,16 @@
 ponse;%0D%0A
- 
 %0D%0A// sni
@@ -1367,11 +1367,12 @@
 ress
+ %7B
 %0D%0A
-%7B
 %0D%0A  
@@ -1411,21 +1411,16 @@
 %5B%5D args)
-%0D%0A   
  %7B%0D%0A    
@@ -1445,16 +1445,20 @@
 SAGE =%0D%0A
+    
         
@@ -1514,16 +1514,28 @@
 .%5Cn%22 +%0D%0A
+            
         
@@ -1716,18 +1716,17 @@
 ng alloc
-_i
+I
 d = args
@@ -1925,16 +1925,20 @@
         
+    
 .allocat
@@ -1948,18 +1948,17 @@
 Id(alloc
-_i
+I
 d).build
@@ -2136,16 +2136,20 @@
         
+    
 %22Success
@@ -2192,18 +2192,17 @@
 %22, alloc
-_i
+I
 d);%0D%0A   
@@ -2208,17 +2208,16 @@
   %7D%0D%0A%7D%0D%0A
- 
 %0D%0A// sni

Update ReleaseAddress.java