Add option to enable/disable create firewall/acl rules

This commit is contained in:
Sergio Millan Rodriguez 2018-07-13 17:56:04 +02:00
parent 4078cfe162
commit eae0556dc5
2 changed files with 4 additions and 2 deletions

View File

@ -40,6 +40,8 @@ type Config struct {
PublicIPAddress string `mapstructure:"public_ip_address"`
SecurityGroups []string `mapstructure:"security_groups"`
ServiceOffering string `mapstructure:"service_offering"`
CreateNetworkACL bool `mapstructure:"create_network_acl"`
CreateFirewallRule bool `mapstructure:"create_firewall_rule"`
SourceISO string `mapstructure:"source_iso"`
SourceTemplate string `mapstructure:"source_template"`
TemporaryKeypairName string `mapstructure:"temporary_keypair_name"`

View File

@ -117,7 +117,7 @@ func (s *stepSetupNetworking) Run(_ context.Context, state multistep.StateBag) m
// Store the port forward ID.
state.Put("port_forward_id", forward.Id)
if network.Vpcid != "" {
if network.Vpcid != "" && config.CreateNetworkACL {
ui.Message("Creating network ACL rule...")
if network.Aclid == "" {
@ -149,7 +149,7 @@ func (s *stepSetupNetworking) Run(_ context.Context, state multistep.StateBag) m
// Store the network ACL rule ID.
state.Put("network_acl_rule_id", aclRule.Id)
} else {
} else if config.CreateFirewallRule {
ui.Message("Creating firewall rule...")
// Create a new parameter struct.