class AwsNetworkService {

    public List<String> getVpcCidrs(AuthenticatedContext ac, CloudStack stack) {
        AwsNetworkView awsNetworkView = new AwsNetworkView(stack.getNetwork());
        if (awsNetworkView.isExistingVPC()) {
            String region = ac.getCloudContext().getLocation().getRegion().value();
            AmazonEC2Client ec2Client = awsClient.createAccess(new AwsCredentialView(ac.getCloudCredential()), region);

            DescribeVpcsRequest vpcRequest = new DescribeVpcsRequest().withVpcIds(awsNetworkView.getExistingVpc());
            Vpc vpc = ec2Client.describeVpcs(vpcRequest).getVpcs().get(0);
            List<String> cidrBlockAssociationSet = vpc.getCidrBlockAssociationSet().stream()
                    .map(VpcCidrBlockAssociation::getCidrBlock)
                    .collect(Collectors.toList());
            LOGGER.info("VPC associated CIDR blocks: [{}]", cidrBlockAssociationSet);
            return cidrBlockAssociationSet;
        } else {
            return Collections.emptyList();
        }
    }

}