https://pulumi.com logo
Title
s

sparse-apartment-71989

07/09/2021, 10:41 PM
I’m trying to troubleshoot some basic network setup in the Civo cloud. What I do is this: 1. Provision a network 2. Provision a firewall 3. Provision 2 rules for http (80) and https (443) using a CIDR block for our network The issue I’m having is on step 3. One of the two rules gets provisioned, but the other errors out with an unhelpful UnknownError error message:
Type                        Name                Status                  Info
 +   pulumi:pulumi:Stack         acme_iac-dev   **creating failed**     1 error; 2 messages
 +   ├─ civo:index:Network       acme-network   created                 
 +   ├─ civo:index:Firewall      acme-firewall  created                 
 +   ├─ civo:index:FirewallRule  rule-2         created                 
 +   └─ civo:index:FirewallRule  rule-1         **creating failed**     1 error
 
Diagnostics:
  civo:index:FirewallRule (rule-1):
    error: 1 error occurred:
        * [ERR] failed to create a new firewall: UnknownError
 
  pulumi:pulumi:Stack (acme_iac-dev):
    error: update failed
 
  civo:index:FirewallRule (rule-1):
    error: 1 error occurred:
        * [ERR] failed to create a new firewall: UnknownError

Resources:
    + 4 created

Duration: 9s
It fails reliably, but I’m just sure why. If I comment out the code for rule-2, rule-1 gets created fine. Same if I comment out the code to create *rule-1*; that is, rule-2 gets created fine. I feel like I’m missing something fundamental about Pulumi. 😜 I’m open to suggestions. Thanks in advance!
b

billowy-army-68599

07/10/2021, 1:08 AM
could you share your code?
s

sparse-apartment-71989

07/12/2021, 2:59 PM
Sure. I boiled it down to the minimal representation for posting here and tested it, but am getting the same error:
import * as civo from '@pulumi/civo'

const network = new civo.Network('jf-network', {label: 'jf-network'})
const firewall = new civo.Firewall('jf-firewall', {name: 'jf-firewall', networkId: network.id})

const CIDRs = ['0.0.0.0/0']
const httpRule = new civo.FirewallRule('http', {
    firewallId: firewall.id, label: 'http rule',
    cidrs: CIDRs, startPort: '80', endPort: '80', protocol: 'tcp'
  }
)
const httpsRule = new civo.FirewallRule('https', {
    firewallId: firewall.id, label: 'https rule',
    cidrs: CIDRs, startPort: '443', endPort: '443', protocol: 'tcp'
  }
)

export const networkName = network.name
export const firewallName = firewall.name
b

billowy-army-68599

07/12/2021, 4:48 PM
hey @sparse-apartment-71989 it appears to be this issue in the upstream provider: https://github.com/civo/terraform-provider-civo/issues/41 try this:
import * as civo from '@pulumi/civo'

const network = new civo.Network('jf-network', {label: 'jf-network'})
const firewall = new civo.Firewall('jf-firewall', {name: 'jf-firewall', networkId: network.id})
const CIDRs = ['0.0.0.0/0']
const httpRule = new civo.FirewallRule('http', {
    firewallId: firewall.id, label: 'http rule',
    cidrs: CIDRs, startPort: '80', endPort: '80', protocol: 'tcp'
  }
)
const httpsRule = new civo.FirewallRule('https', {
    firewallId: firewall.id, label: 'https rule',
    cidrs: CIDRs, startPort: '443', endPort: '443', protocol: 'tcp'
  }, { dependsOn: httpRule }
)
export const networkName = network.name
export const firewallName = firewall.name
s

sparse-apartment-71989

07/12/2021, 5:45 PM
Thanks so much! I should have checked the Issues myself. I momentarily forgot about Pulumi being open source. :-)
@billowy-army-68599 That worked like a charm! Thanks for your help.
b

billowy-army-68599

07/12/2021, 6:23 PM
👍