-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #316 from dbt-labs/release-0.3.22
Release 0.3.22
- Loading branch information
Showing
19 changed files
with
1,315 additions
and
13 deletions.
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
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
page_title: "dbtcloud_account_features Resource - dbtcloud" | ||
subcategory: "" | ||
description: |- | ||
Manages dbt Cloud global features at the account level, like Advanced CI. The same feature should not be configured in different resources to avoid conflicts. | ||
When destroying the resource or removing the value for an attribute, the features status will not be changed. Deactivating features will require applying them wih the value set to false. | ||
--- | ||
|
||
# dbtcloud_account_features (Resource) | ||
|
||
|
||
Manages dbt Cloud global features at the account level, like Advanced CI. The same feature should not be configured in different resources to avoid conflicts. | ||
|
||
When destroying the resource or removing the value for an attribute, the features status will not be changed. Deactivating features will require applying them wih the value set to `false`. | ||
|
||
|
||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Optional | ||
|
||
- `advanced_ci` (Boolean) Whether advanced CI is enabled. | ||
- `partial_parsing` (Boolean) Whether partial parsing is enabled. | ||
- `repo_caching` (Boolean) Whether repository caching is enabled. | ||
|
||
### Read-Only | ||
|
||
- `id` (String) The ID of the account. |
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 |
---|---|---|
@@ -0,0 +1,82 @@ | ||
--- | ||
page_title: "dbtcloud_ip_restrictions_rule Resource - dbtcloud" | ||
subcategory: "" | ||
description: |- | ||
Manages IP restriction rules in dbt Cloud. IP restriction rules allow you to control access to your dbt Cloud instance based on IP address ranges. | ||
--- | ||
|
||
# dbtcloud_ip_restrictions_rule (Resource) | ||
|
||
|
||
Manages IP restriction rules in dbt Cloud. IP restriction rules allow you to control access to your dbt Cloud instance based on IP address ranges. | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
resource "dbtcloud_ip_restrictions_rule" "test" { | ||
name = "My restriction rule" | ||
description = "Important description" | ||
cidrs = [ | ||
{ | ||
cidr = "::ffff:106:708" # IPv6 config | ||
}, | ||
{ | ||
cidr = "1.6.7.10/24" # /24 for adding a range of addresses via netmask | ||
} | ||
] | ||
type = "deny" | ||
rule_set_enabled = false | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `cidrs` (Attributes Set) Set of CIDR ranges for this rule (see [below for nested schema](#nestedatt--cidrs)) | ||
- `name` (String) The name of the IP restriction rule | ||
- `rule_set_enabled` (Boolean) Whether the IP restriction rule set is enabled or not. Important!: This value needs to be the same for all rules if multiple rules are defined. All rules must be active or inactive at the same time. | ||
- `type` (String) The type of the IP restriction rule (allow or deny) | ||
|
||
### Optional | ||
|
||
- `description` (String) A description of the IP restriction rule | ||
|
||
### Read-Only | ||
|
||
- `id` (Number) The ID of the IP restriction rule | ||
|
||
<a id="nestedatt--cidrs"></a> | ||
### Nested Schema for `cidrs` | ||
|
||
Optional: | ||
|
||
- `cidr` (String) IP CIDR range (can be IPv4 or IPv6) | ||
|
||
Read-Only: | ||
|
||
- `cidr_ipv6` (String) IPv6 CIDR range (read-only) | ||
- `id` (Number) ID of the CIDR range | ||
- `ip_restriction_rule_id` (Number) ID of the IP restriction rule | ||
|
||
## Import | ||
|
||
Import is supported using the following syntax: | ||
|
||
```shell | ||
# using import blocks (requires Terraform >= 1.5) | ||
import { | ||
to = dbtcloud_ip_restrictions_rule.my_rule | ||
id = "ip_restriction_rule_id" | ||
} | ||
|
||
import { | ||
to = dbtcloud_ip_restrictions_rule.my_rule | ||
id = "12345" | ||
} | ||
|
||
# using the older import command | ||
terraform import dbtcloud_ip_restrictions_rule.my_rule "ip_restriction_rule_id" | ||
terraform import dbtcloud_ip_restrictions_rule.my_rule 12345 | ||
``` |
14 changes: 14 additions & 0 deletions
14
examples/resources/dbtcloud_ip_restrictions_rule/import.sh
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# using import blocks (requires Terraform >= 1.5) | ||
import { | ||
to = dbtcloud_ip_restrictions_rule.my_rule | ||
id = "ip_restriction_rule_id" | ||
} | ||
|
||
import { | ||
to = dbtcloud_ip_restrictions_rule.my_rule | ||
id = "12345" | ||
} | ||
|
||
# using the older import command | ||
terraform import dbtcloud_ip_restrictions_rule.my_rule "ip_restriction_rule_id" | ||
terraform import dbtcloud_ip_restrictions_rule.my_rule 12345 |
14 changes: 14 additions & 0 deletions
14
examples/resources/dbtcloud_ip_restrictions_rule/resource.tf
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
resource "dbtcloud_ip_restrictions_rule" "test" { | ||
name = "My restriction rule" | ||
description = "Important description" | ||
cidrs = [ | ||
{ | ||
cidr = "::ffff:106:708" # IPv6 config | ||
}, | ||
{ | ||
cidr = "1.6.7.10/24" # /24 for adding a range of addresses via netmask | ||
} | ||
] | ||
type = "deny" | ||
rule_set_enabled = false | ||
} |
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 |
---|---|---|
@@ -0,0 +1,73 @@ | ||
package dbt_cloud | ||
|
||
import ( | ||
"encoding/json" | ||
"fmt" | ||
"net/http" | ||
"strings" | ||
) | ||
|
||
type AccountFeaturesResponse struct { | ||
Data AccountFeatures `json:"data"` | ||
Status ResponseStatus `json:"status"` | ||
Extra ResponseExtra `json:"extra"` | ||
} | ||
|
||
type AccountFeatures struct { | ||
AdvancedCI bool `json:"advanced-ci"` | ||
PartialParsing bool `json:"partial-parsing"` | ||
RepoCaching bool `json:"repo-caching"` | ||
} | ||
|
||
type AccountFeatureUpdateRequest struct { | ||
Feature string `json:"feature"` | ||
Value bool `json:"value"` | ||
} | ||
|
||
func (c *Client) GetAccountFeatures() (*AccountFeatures, error) { | ||
req, err := http.NewRequest( | ||
"GET", | ||
fmt.Sprintf("%s/private/accounts/%d/features/", c.HostURL, c.AccountID), | ||
nil, | ||
) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
body, err := c.doRequest(req) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
featuresResponse := AccountFeaturesResponse{} | ||
err = json.Unmarshal(body, &featuresResponse) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
return &featuresResponse.Data, nil | ||
} | ||
|
||
func (c *Client) UpdateAccountFeature(feature string, value bool) error { | ||
updateRequest := AccountFeatureUpdateRequest{ | ||
Feature: feature, | ||
Value: value, | ||
} | ||
|
||
updateData, err := json.Marshal(updateRequest) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
req, err := http.NewRequest( | ||
"POST", | ||
fmt.Sprintf("%s/private/accounts/%d/features/", c.HostURL, c.AccountID), | ||
strings.NewReader(string(updateData)), | ||
) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
_, err = c.doRequest(req) | ||
return err | ||
} |
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.