@Override
public List<Resource> create(GccProvisionContextObject pO, int index, List<Resource> resources) throws Exception {
Stack stack = stackRepository.findById(pO.getStackId());
Firewall firewall = new Firewall();
Firewall.Allowed allowed1 = new Firewall.Allowed();
allowed1.setIPProtocol("tcp");
allowed1.setPorts(ImmutableList.of("1-65535"));
Firewall.Allowed allowed2 = new Firewall.Allowed();
allowed2.setIPProtocol("icmp");
Firewall.Allowed allowed3 = new Firewall.Allowed();
allowed3.setIPProtocol("udp");
allowed3.setPorts(ImmutableList.of("1-65535"));
firewall.setAllowed(ImmutableList.of(allowed1, allowed2, allowed3));
firewall.setName(stack.getName() + "out");
firewall.setSourceRanges(ImmutableList.of("0.0.0.0/0"));
firewall.setNetwork(String.format("https://www.googleapis.com/compute/v1/projects/%s/global/networks/%s",
pO.getProjectId(), pO.filterResourcesByType(ResourceType.GCC_NETWORK).get(0).getResourceName()));
Compute.Firewalls.Insert firewallInsert = pO.getCompute().firewalls().insert(pO.getProjectId(), firewall);
firewallInsert.execute();
return Arrays.asList(new Resource(resourceType(), stack.getName() + "out", stack));
}