flag to setup networking without firewall rules
This commit is contained in:
parent
472a7820eb
commit
f4020835d6
|
@ -40,8 +40,7 @@ type Config struct {
|
||||||
PublicIPAddress string `mapstructure:"public_ip_address"`
|
PublicIPAddress string `mapstructure:"public_ip_address"`
|
||||||
SecurityGroups []string `mapstructure:"security_groups"`
|
SecurityGroups []string `mapstructure:"security_groups"`
|
||||||
ServiceOffering string `mapstructure:"service_offering"`
|
ServiceOffering string `mapstructure:"service_offering"`
|
||||||
CreateNetworkACL bool `mapstructure:"create_network_acl"`
|
PreventFirewallChanges bool `mapstructure:"prevent_firewall_changes"`
|
||||||
CreateFirewallRule bool `mapstructure:"create_firewall_rule"`
|
|
||||||
SourceISO string `mapstructure:"source_iso"`
|
SourceISO string `mapstructure:"source_iso"`
|
||||||
SourceTemplate string `mapstructure:"source_template"`
|
SourceTemplate string `mapstructure:"source_template"`
|
||||||
TemporaryKeypairName string `mapstructure:"temporary_keypair_name"`
|
TemporaryKeypairName string `mapstructure:"temporary_keypair_name"`
|
||||||
|
|
|
@ -117,7 +117,12 @@ func (s *stepSetupNetworking) Run(_ context.Context, state multistep.StateBag) m
|
||||||
// Store the port forward ID.
|
// Store the port forward ID.
|
||||||
state.Put("port_forward_id", forward.Id)
|
state.Put("port_forward_id", forward.Id)
|
||||||
|
|
||||||
if network.Vpcid != "" && config.CreateNetworkACL {
|
if config.PreventFirewallChanges {
|
||||||
|
ui.Message("Networking has been setup (without firewall changes)!")
|
||||||
|
return multistep.ActionContinue
|
||||||
|
}
|
||||||
|
|
||||||
|
if network.Vpcid != "" {
|
||||||
ui.Message("Creating network ACL rule...")
|
ui.Message("Creating network ACL rule...")
|
||||||
|
|
||||||
if network.Aclid == "" {
|
if network.Aclid == "" {
|
||||||
|
@ -149,7 +154,7 @@ func (s *stepSetupNetworking) Run(_ context.Context, state multistep.StateBag) m
|
||||||
|
|
||||||
// Store the network ACL rule ID.
|
// Store the network ACL rule ID.
|
||||||
state.Put("network_acl_rule_id", aclRule.Id)
|
state.Put("network_acl_rule_id", aclRule.Id)
|
||||||
} else if config.CreateFirewallRule {
|
} else {
|
||||||
ui.Message("Creating firewall rule...")
|
ui.Message("Creating firewall rule...")
|
||||||
|
|
||||||
// Create a new parameter struct.
|
// Create a new parameter struct.
|
||||||
|
|
Loading…
Reference in New Issue