-
Notifications
You must be signed in to change notification settings - Fork 389
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
[Synthetics] Add support for restricted roles for global variables #1178
Merged
Merged
Changes from 3 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
1d6ad1f
Update go client
romainberger 6ff5100
[Synthetics] Add support for restricted roles for global variables
romainberger 1ef657a
[Synthetics] Update description for secure parameter for global variable
romainberger de48e01
[Synthetics] Fix review
romainberger fab31c1
Regenerate docs
romainberger c57f68f
Update go client
romainberger c8513ea
[Synthetics] Add support for restricted roles for global variables
romainberger 540436a
[Synthetics] Update description for secure parameter for global variable
romainberger bf69541
[Synthetics] Fix review
romainberger 86ffa83
Regenerate docs
romainberger d364a5f
Merge branch 'master' of github.com:DataDog/terraform-provider-datado…
romainberger 3010387
Merge branch 'master' of github.com:DataDog/terraform-provider-datado…
romainberger 88c57bc
Merge branch 'rberger/SYA-1073/gv-restricted-roles' of github.com:Dat…
romainberger 072ec7b
[Synthetics] Fix dependencie and cassettes
romainberger 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 | ||||
---|---|---|---|---|---|---|
|
@@ -48,7 +48,7 @@ func resourceDatadogSyntheticsGlobalVariable() *schema.Resource { | |||||
Sensitive: true, | ||||||
}, | ||||||
"secure": { | ||||||
Description: "Sets the variable as secure. Defaults to `false`.", | ||||||
Description: "If set to true, the value of the global variable will be hidden. Defaults to `false`.", | ||||||
Default: false, | ||||||
Type: schema.TypeBool, | ||||||
Optional: true, | ||||||
|
@@ -99,6 +99,12 @@ func resourceDatadogSyntheticsGlobalVariable() *schema.Resource { | |||||
}, | ||||||
}, | ||||||
}, | ||||||
"restricted_roles": { | ||||||
Description: "A list of role identifiers to associate with the Synthetics global variable", | ||||||
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.
Suggested change
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. Danke! |
||||||
Type: schema.TypeSet, | ||||||
Elem: &schema.Schema{Type: schema.TypeString}, | ||||||
Optional: true, | ||||||
}, | ||||||
}, | ||||||
} | ||||||
} | ||||||
|
@@ -219,6 +225,14 @@ func buildSyntheticsGlobalVariableStruct(d *schema.ResourceData) *datadogV1.Synt | |||||
} | ||||||
} | ||||||
|
||||||
if restrictedRolesSet, ok := d.GetOk("restricted_roles"); ok { | ||||||
restrictedRoles := buildDatadogRestrictedRoles(restrictedRolesSet.(*schema.Set)) | ||||||
attributes := datadogV1.SyntheticsGlobalVariableAttributes{ | ||||||
RestrictedRoles: restrictedRoles, | ||||||
} | ||||||
syntheticsGlobalVariable.SetAttributes(attributes) | ||||||
} | ||||||
|
||||||
return syntheticsGlobalVariable | ||||||
} | ||||||
|
||||||
|
@@ -264,5 +278,12 @@ func updateSyntheticsGlobalVariableLocalState(d *schema.ResourceData, synthetics | |||||
d.Set("parse_test_options", []map[string]interface{}{localParseTestOptions}) | ||||||
} | ||||||
|
||||||
if syntheticsGlobalVariable.HasAttributes() { | ||||||
attributes := syntheticsGlobalVariable.GetAttributes() | ||||||
variableRestrictedRoles := attributes.GetRestrictedRoles() | ||||||
restrictedRoles := buildTerraformRestrictedRoles(&variableRestrictedRoles) | ||||||
d.Set("restricted_roles", restrictedRoles) | ||||||
} | ||||||
|
||||||
return nil | ||||||
} |
2 changes: 1 addition & 1 deletion
2
datadog/tests/cassettes/TestAccDatadogSyntheticsGlobalVariable_Basic.freeze
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 |
---|---|---|
@@ -1 +1 @@ | ||
2021-04-20T10:53:40.722265-04:00 | ||
2021-08-19T14:09:10.609931+02:00 |
289 changes: 213 additions & 76 deletions
289
datadog/tests/cassettes/TestAccDatadogSyntheticsGlobalVariable_Basic.yaml
Large diffs are not rendered by default.
Oops, something went wrong.
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
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.
Going to need to run
make docs
Also I think
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.
+1 on that, we try to avoid future tense as often as we can!