Skip to content

Commit

Permalink
Merge pull request #24 from PaloAltoNetworks/fw-id
Browse files Browse the repository at this point in the history
Expose firewall_id field in the ngfw resource
  • Loading branch information
panw-ppalkar authored Jun 17, 2024
2 parents 6953b2b + c3a426a commit 701a1fb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/data-sources/ngfw.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ data "cloudngfwaws_ngfw" "example" {
- `description` (String) The description.
- `endpoint_mode` (String) Set endpoint mode from the following options. Valid values are `ServiceManaged` or `CustomerManaged`.
- `endpoint_service_name` (String) The endpoint service name.
- `firewall_id` (String) The Id of the NGFW.
- `global_rulestack` (String) The global rulestack for this NGFW.
- `id` (String) The ID of this resource.
- `link_id` (String) The link ID.
Expand Down
1 change: 1 addition & 0 deletions docs/resources/ngfw.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ resource "aws_subnet" "subnet2" {
### Read-Only

- `endpoint_service_name` (String) The endpoint service name.
- `firewall_id` (String) The Id of the NGFW.
- `id` (String) The ID of this resource.
- `link_status` (String) The link status.
- `status` (List of Object) (see [below for nested schema](#nestedatt--status))
Expand Down
7 changes: 7 additions & 0 deletions internal/provider/ngfw.go
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,11 @@ func ngfwSchema(isResource bool, rmKeys []string) map[string]*schema.Schema {
Description: "The NGFW name.",
ForceNew: true,
},
"firewall_id": {
Type: schema.TypeString,
Computed: true,
Description: "The Id of the NGFW.",
},
"vpc_id": {
Type: schema.TypeString,
Required: true,
Expand Down Expand Up @@ -559,6 +564,7 @@ func loadNgfw(d *schema.ResourceData) ngfw.Info {

return ngfw.Info{
Name: d.Get("name").(string),
Id: d.Get("firewall_id").(string),
VpcId: d.Get("vpc_id").(string),
AccountId: d.Get("account_id").(string),
SubnetMappings: sm,
Expand Down Expand Up @@ -617,6 +623,7 @@ func saveNgfw(d *schema.ResourceData, o ngfw.ReadResponse) {
}

d.Set("name", o.Firewall.Name)
d.Set("firewall_id", o.Firewall.Id)
d.Set("account_id", o.Firewall.AccountId)
d.Set("subnet_mapping", sm)
d.Set("vpc_id", o.Firewall.VpcId)
Expand Down

0 comments on commit 701a1fb

Please sign in to comment.