Skip to content

Commit

Permalink
Promote Billing Budgets to GA (#4273) (#8023)
Browse files Browse the repository at this point in the history
* promote billing budgets to GA

Co-authored-by: upodroid <cy@borg.dev>

* fix how the deprecations are being handled

Co-authored-by: upodroid <cy@borg.dev>

* patch doc location

Co-authored-by: upodroid <cy@borg.dev>

* fix the nested fields

Co-authored-by: upodroid <cy@borg.dev>

* fix imports

* set more fields to computed

* rejig MM to allow generated importless tests

Co-authored-by: upodroid <cy@borg.dev>
Signed-off-by: Modular Magician <magic-modules@google.com>

Co-authored-by: upodroid <cy@borg.dev>
  • Loading branch information
modular-magician and upodroid authored Dec 15, 2020
1 parent 16e0de1 commit 179ede2
Show file tree
Hide file tree
Showing 140 changed files with 2,411 additions and 205 deletions.
6 changes: 6 additions & 0 deletions .changelog/4273.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
```release-note:breaking-change
billing: import support for `google_billing_budget` never functioned correctly, and has been removed.
```
```release-note:enhancement
billing: promoted `google_billing_budget` to GA
```
3 changes: 3 additions & 0 deletions google/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ type Config struct {
BigQueryBasePath string
BigqueryDataTransferBasePath string
BigtableBasePath string
BillingBasePath string
BinaryAuthorizationBasePath string
CloudAssetBasePath string
CloudBuildBasePath string
Expand Down Expand Up @@ -166,6 +167,7 @@ var AppEngineDefaultBasePath = "https://appengine.googleapis.com/v1/"
var BigQueryDefaultBasePath = "https://bigquery.googleapis.com/bigquery/v2/"
var BigqueryDataTransferDefaultBasePath = "https://bigquerydatatransfer.googleapis.com/v1/"
var BigtableDefaultBasePath = "https://bigtableadmin.googleapis.com/v2/"
var BillingDefaultBasePath = "https://billingbudgets.googleapis.com/v1/"
var BinaryAuthorizationDefaultBasePath = "https://binaryauthorization.googleapis.com/v1/"
var CloudAssetDefaultBasePath = "https://cloudasset.googleapis.com/v1/"
var CloudBuildDefaultBasePath = "https://cloudbuild.googleapis.com/v1/"
Expand Down Expand Up @@ -952,6 +954,7 @@ func ConfigureBasePaths(c *Config) {
c.BigQueryBasePath = BigQueryDefaultBasePath
c.BigqueryDataTransferBasePath = BigqueryDataTransferDefaultBasePath
c.BigtableBasePath = BigtableDefaultBasePath
c.BillingBasePath = BillingDefaultBasePath
c.BinaryAuthorizationBasePath = BinaryAuthorizationDefaultBasePath
c.CloudAssetBasePath = CloudAssetDefaultBasePath
c.CloudBuildBasePath = CloudBuildDefaultBasePath
Expand Down
14 changes: 12 additions & 2 deletions google/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,14 @@ func Provider() *schema.Provider {
"GOOGLE_BIGTABLE_CUSTOM_ENDPOINT",
}, BigtableDefaultBasePath),
},
"billing_custom_endpoint": {
Type: schema.TypeString,
Optional: true,
ValidateFunc: validateCustomEndpoint,
DefaultFunc: schema.MultiEnvDefaultFunc([]string{
"GOOGLE_BILLING_CUSTOM_ENDPOINT",
}, BillingDefaultBasePath),
},
"binary_authorization_custom_endpoint": {
Type: schema.TypeString,
Optional: true,
Expand Down Expand Up @@ -687,9 +695,9 @@ func Provider() *schema.Provider {
return provider
}

// Generated resources: 176
// Generated resources: 177
// Generated IAM resources: 75
// Total generated resources: 251
// Total generated resources: 252
func ResourceMap() map[string]*schema.Resource {
resourceMap, _ := ResourceMapWithErrors()
return resourceMap
Expand Down Expand Up @@ -725,6 +733,7 @@ func ResourceMapWithErrors() (map[string]*schema.Resource, error) {
"google_bigquery_routine": resourceBigQueryRoutine(),
"google_bigquery_data_transfer_config": resourceBigqueryDataTransferConfig(),
"google_bigtable_app_profile": resourceBigtableAppProfile(),
"google_billing_budget": resourceBillingBudget(),
"google_binary_authorization_attestor": resourceBinaryAuthorizationAttestor(),
"google_binary_authorization_attestor_iam_binding": ResourceIamBinding(BinaryAuthorizationAttestorIamSchema, BinaryAuthorizationAttestorIamUpdaterProducer, BinaryAuthorizationAttestorIdParseFunc),
"google_binary_authorization_attestor_iam_member": ResourceIamMember(BinaryAuthorizationAttestorIamSchema, BinaryAuthorizationAttestorIamUpdaterProducer, BinaryAuthorizationAttestorIdParseFunc),
Expand Down Expand Up @@ -1142,6 +1151,7 @@ func providerConfigure(ctx context.Context, d *schema.ResourceData, p *schema.Pr
config.BigQueryBasePath = d.Get("big_query_custom_endpoint").(string)
config.BigqueryDataTransferBasePath = d.Get("bigquery_data_transfer_custom_endpoint").(string)
config.BigtableBasePath = d.Get("bigtable_custom_endpoint").(string)
config.BillingBasePath = d.Get("billing_custom_endpoint").(string)
config.BinaryAuthorizationBasePath = d.Get("binary_authorization_custom_endpoint").(string)
config.CloudAssetBasePath = d.Get("cloud_asset_custom_endpoint").(string)
config.CloudBuildBasePath = d.Get("cloud_build_custom_endpoint").(string)
Expand Down
8 changes: 7 additions & 1 deletion google/resource_active_directory_domain_generated_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,13 @@ func testAccCheckActiveDirectoryDomainDestroyProducer(t *testing.T) func(s *terr
return err
}

_, err = sendRequest(config, "GET", "", url, config.userAgent, nil)
billingProject := ""

if config.BillingProject != "" {
billingProject = config.BillingProject
}

_, err = sendRequest(config, "GET", billingProject, url, config.userAgent, nil)
if err == nil {
return fmt.Errorf("ActiveDirectoryDomain still exists at %s", url)
}
Expand Down
8 changes: 7 additions & 1 deletion google/resource_app_engine_domain_mapping_generated_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,13 @@ func testAccCheckAppEngineDomainMappingDestroyProducer(t *testing.T) func(s *ter
return err
}

_, err = sendRequest(config, "GET", "", url, config.userAgent, nil)
billingProject := ""

if config.BillingProject != "" {
billingProject = config.BillingProject
}

_, err = sendRequest(config, "GET", billingProject, url, config.userAgent, nil)
if err == nil {
return fmt.Errorf("AppEngineDomainMapping still exists at %s", url)
}
Expand Down
8 changes: 7 additions & 1 deletion google/resource_app_engine_firewall_rule_generated_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,13 @@ func testAccCheckAppEngineFirewallRuleDestroyProducer(t *testing.T) func(s *terr
return err
}

_, err = sendRequest(config, "GET", "", url, config.userAgent, nil)
billingProject := ""

if config.BillingProject != "" {
billingProject = config.BillingProject
}

_, err = sendRequest(config, "GET", billingProject, url, config.userAgent, nil)
if err == nil {
return fmt.Errorf("AppEngineFirewallRule still exists at %s", url)
}
Expand Down
8 changes: 7 additions & 1 deletion google/resource_big_query_dataset_generated_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,13 @@ func testAccCheckBigQueryDatasetDestroyProducer(t *testing.T) func(s *terraform.
return err
}

_, err = sendRequest(config, "GET", "", url, config.userAgent, nil)
billingProject := ""

if config.BillingProject != "" {
billingProject = config.BillingProject
}

_, err = sendRequest(config, "GET", billingProject, url, config.userAgent, nil)
if err == nil {
return fmt.Errorf("BigQueryDataset still exists at %s", url)
}
Expand Down
8 changes: 7 additions & 1 deletion google/resource_big_query_routine_generated_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,13 @@ func testAccCheckBigQueryRoutineDestroyProducer(t *testing.T) func(s *terraform.
return err
}

_, err = sendRequest(config, "GET", "", url, config.userAgent, nil)
billingProject := ""

if config.BillingProject != "" {
billingProject = config.BillingProject
}

_, err = sendRequest(config, "GET", billingProject, url, config.userAgent, nil)
if err == nil {
return fmt.Errorf("BigQueryRoutine still exists at %s", url)
}
Expand Down
8 changes: 7 additions & 1 deletion google/resource_bigtable_app_profile_generated_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,13 @@ func testAccCheckBigtableAppProfileDestroyProducer(t *testing.T) func(s *terrafo
return err
}

_, err = sendRequest(config, "GET", "", url, config.userAgent, nil)
billingProject := ""

if config.BillingProject != "" {
billingProject = config.BillingProject
}

_, err = sendRequest(config, "GET", billingProject, url, config.userAgent, nil)
if err == nil {
return fmt.Errorf("BigtableAppProfile still exists at %s", url)
}
Expand Down
Loading

0 comments on commit 179ede2

Please sign in to comment.