Skip to content

Commit

Permalink
add egress regex
Browse files Browse the repository at this point in the history
  • Loading branch information
ajeyaraj-crusoe authored and tkralj-1 committed Jan 9, 2024
1 parent 0d25ea0 commit 7209e56
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/firewall_rule/firewall_rule_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func (r *firewallRuleResource) Schema(ctx context.Context, req resource.SchemaRe
"direction": schema.StringAttribute{
Required: true,
PlanModifiers: []planmodifier.String{stringplanmodifier.RequiresReplace()},
Validators: []validator.String{validators.RegexValidator{RegexPattern: "^ingress"}}, // TODO: support egress once supported by API
Validators: []validator.String{validators.RegexValidator{RegexPattern: "^(ingress|egress)"}},
},
"protocols": schema.StringAttribute{
Required: true,
Expand Down Expand Up @@ -125,7 +125,7 @@ func (r *firewallRuleResource) Create(ctx context.Context, req resource.CreateRe
}

projectID := ""
if plan.ProjectID.ValueString() == ""{
if plan.ProjectID.ValueString() == "" {
project, err := common.GetFallbackProject(ctx, r.client, &resp.Diagnostics)
if err != nil {
resp.Diagnostics.AddError("Failed to create firewall rule",
Expand Down

0 comments on commit 7209e56

Please sign in to comment.