-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
azurerm_windows[linux]_function[web]_app
, azurerm_windows[linux]_function[web]_app_slot
- add description
property for ip_restriction
block
#24527
Merged
Merged
Changes from 3 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
2670ffe
add description for ip restriction block
xiaxyi be79bbc
merging upstream
xiaxyi 5af6654
update
xiaxyi 5a6deed
Merge remote-tracking branch 'upstream/main' into app/ip-description
xiaxyi 3f6fe86
update test cases
xiaxyi a741623
Merge remote-tracking branch 'origin/app/ip-description' into app/ip-…
xiaxyi edb6e3b
Merge remote-tracking branch 'upstream/main' into app/ip-description
xiaxyi d116f98
add linter ignore
xiaxyi 6ce7e4e
add ignore linter
xiaxyi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,7 @@ type IpRestriction struct { | |
Priority int64 `tfschema:"priority"` | ||
Action string `tfschema:"action"` | ||
Headers []IpRestrictionHeaders `tfschema:"headers"` | ||
Description string `tfschema:"description"` | ||
} | ||
|
||
type IpRestrictionHeaders struct { | ||
|
@@ -104,6 +105,13 @@ func IpRestrictionSchema() *pluginsdk.Schema { | |
}, | ||
|
||
"headers": IpRestrictionHeadersSchema(), | ||
|
||
"description": { | ||
Type: pluginsdk.TypeString, | ||
Optional: true, | ||
ValidateFunc: validation.StringIsNotEmpty, | ||
Description: "The description of the IP restriction rule.", | ||
}, | ||
}, | ||
}, | ||
} | ||
|
@@ -153,6 +161,12 @@ func IpRestrictionSchemaComputed() *pluginsdk.Schema { | |
}, | ||
|
||
"headers": IpRestrictionHeadersSchemaComputed(), | ||
|
||
"description": { | ||
Type: pluginsdk.TypeString, | ||
Computed: true, | ||
Description: "The description of the ip restriction rule.", | ||
}, | ||
}, | ||
}, | ||
} | ||
|
@@ -1157,6 +1171,12 @@ func ExpandIpRestrictions(restrictions []IpRestriction) (*[]webapps.IPSecurityRe | |
|
||
restriction.Priority = pointer.To(v.Priority) | ||
|
||
if v.Description != "" { | ||
restriction.Description = utils.String(v.Description) | ||
} | ||
|
||
restriction.Priority = utils.Int64(v.Priority) | ||
|
||
restriction.Action = pointer.To(v.Action) | ||
|
||
restriction.Headers = expandIpRestrictionHeaders(v.Headers) | ||
|
@@ -1492,6 +1512,11 @@ func FlattenIpRestrictions(ipRestrictionsList *[]webapps.IPSecurityRestriction) | |
ipRestriction.Action = *v.Action | ||
} | ||
|
||
ipRestriction.Headers = flattenIpRestrictionHeaders(pointer.From(v.Headers)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This line appears to have been duplicated? (L1520 below) |
||
if v.Description != nil { | ||
ipRestriction.Description = *v.Description | ||
} | ||
|
||
ipRestriction.Headers = flattenIpRestrictionHeaders(pointer.From(v.Headers)) | ||
|
||
ipRestrictions = append(ipRestrictions, ipRestriction) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we replace these with
pointer.To()
as we're aiming to remove theutils
package?