From aaf9827b1cd22c9271a9d8fb85fd68e0a673b34f Mon Sep 17 00:00:00 2001 From: Deepanjan Bhattacharyya Date: Tue, 20 Feb 2024 08:56:13 -0800 Subject: [PATCH] Expose ipv6cidr when auto assigned --- src/main/java/gyro/aws/ec2/VpcResource.java | 31 +++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/main/java/gyro/aws/ec2/VpcResource.java b/src/main/java/gyro/aws/ec2/VpcResource.java index 60ecc4030..aa0b14f24 100644 --- a/src/main/java/gyro/aws/ec2/VpcResource.java +++ b/src/main/java/gyro/aws/ec2/VpcResource.java @@ -19,6 +19,7 @@ import java.util.Collections; import java.util.HashSet; import java.util.Set; +import java.util.concurrent.TimeUnit; import com.psddev.dari.util.ObjectUtils; import gyro.aws.AwsCredentials; @@ -27,12 +28,14 @@ import gyro.core.GyroException; import gyro.core.GyroUI; import gyro.core.Type; +import gyro.core.Wait; import gyro.core.resource.Id; import gyro.core.resource.Output; import gyro.core.resource.TestValue; import gyro.core.resource.Updatable; import gyro.core.scope.State; import gyro.core.validation.Required; +import org.apache.commons.lang3.StringUtils; import software.amazon.awssdk.services.ec2.Ec2Client; import software.amazon.awssdk.services.ec2.model.AttributeBooleanValue; import software.amazon.awssdk.services.ec2.model.ClassicLinkDnsSupport; @@ -84,6 +87,7 @@ public class VpcResource extends Ec2TaggableResource implements Copyable { + Vpc vpcResponse = getVpc(client); + + setIpv6CidrBlock(vpcResponse.ipv6CidrBlockAssociationSet().isEmpty() + ? null : vpcResponse.ipv6CidrBlockAssociationSet().get(0).ipv6CidrBlock()); + return !StringUtils.isBlank(getIpv6CidrBlock()); + }); + } + + modifySettings(client, new HashSet<>()); }