Skip to content

Commit 701a1fb

Browse files
authored
Merge pull request #24 from PaloAltoNetworks/fw-id
Expose firewall_id field in the ngfw resource
2 parents 6953b2b + c3a426a commit 701a1fb

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

docs/data-sources/ngfw.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ data "cloudngfwaws_ngfw" "example" {
4242
- `description` (String) The description.
4343
- `endpoint_mode` (String) Set endpoint mode from the following options. Valid values are `ServiceManaged` or `CustomerManaged`.
4444
- `endpoint_service_name` (String) The endpoint service name.
45+
- `firewall_id` (String) The Id of the NGFW.
4546
- `global_rulestack` (String) The global rulestack for this NGFW.
4647
- `id` (String) The ID of this resource.
4748
- `link_id` (String) The link ID.

docs/resources/ngfw.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ resource "aws_subnet" "subnet2" {
101101
### Read-Only
102102

103103
- `endpoint_service_name` (String) The endpoint service name.
104+
- `firewall_id` (String) The Id of the NGFW.
104105
- `id` (String) The ID of this resource.
105106
- `link_status` (String) The link status.
106107
- `status` (List of Object) (see [below for nested schema](#nestedatt--status))

internal/provider/ngfw.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,11 @@ func ngfwSchema(isResource bool, rmKeys []string) map[string]*schema.Schema {
360360
Description: "The NGFW name.",
361361
ForceNew: true,
362362
},
363+
"firewall_id": {
364+
Type: schema.TypeString,
365+
Computed: true,
366+
Description: "The Id of the NGFW.",
367+
},
363368
"vpc_id": {
364369
Type: schema.TypeString,
365370
Required: true,
@@ -559,6 +564,7 @@ func loadNgfw(d *schema.ResourceData) ngfw.Info {
559564

560565
return ngfw.Info{
561566
Name: d.Get("name").(string),
567+
Id: d.Get("firewall_id").(string),
562568
VpcId: d.Get("vpc_id").(string),
563569
AccountId: d.Get("account_id").(string),
564570
SubnetMappings: sm,
@@ -617,6 +623,7 @@ func saveNgfw(d *schema.ResourceData, o ngfw.ReadResponse) {
617623
}
618624

619625
d.Set("name", o.Firewall.Name)
626+
d.Set("firewall_id", o.Firewall.Id)
620627
d.Set("account_id", o.Firewall.AccountId)
621628
d.Set("subnet_mapping", sm)
622629
d.Set("vpc_id", o.Firewall.VpcId)

0 commit comments

Comments
 (0)