Skip to content

Commit

Permalink
App Check service config (#9875) (hashicorp#6921)
Browse files Browse the repository at this point in the history
* App Check service config

* Add comment in custom destroy code

* Enable firebaseappcheck service

* App Check service config

* Remove unused custom code

* yaml file naming

* Clearer explanation on OFF

[upstream:964cb543e8aceca4f520c2355a4408509e7db9a2]

Signed-off-by: Modular Magician <magic-modules@google.com>
  • Loading branch information
modular-magician authored Jan 31, 2024
1 parent 8d1493b commit 79194d0
Show file tree
Hide file tree
Showing 14 changed files with 1,012 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .changelog/9875.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:new-resource
`google_firebase_app_check_service_config`
```
5 changes: 5 additions & 0 deletions .teamcity/components/generated/services.kt
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,11 @@ var services = mapOf(
"displayName" to "Firebase",
"path" to "./google-beta/services/firebase"
),
"firebaseappcheck" to mapOf(
"name" to "firebaseappcheck",
"displayName" to "Firebaseappcheck",
"path" to "./google-beta/services/firebaseappcheck"
),
"firebasedatabase" to mapOf(
"name" to "firebasedatabase",
"displayName" to "Firebasedatabase",
Expand Down
1 change: 1 addition & 0 deletions google-beta/fwmodels/provider_model.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ type ProviderModel struct {
EssentialContactsCustomEndpoint types.String `tfsdk:"essential_contacts_custom_endpoint"`
FilestoreCustomEndpoint types.String `tfsdk:"filestore_custom_endpoint"`
FirebaseCustomEndpoint types.String `tfsdk:"firebase_custom_endpoint"`
FirebaseAppCheckCustomEndpoint types.String `tfsdk:"firebase_app_check_custom_endpoint"`
FirebaseDatabaseCustomEndpoint types.String `tfsdk:"firebase_database_custom_endpoint"`
FirebaseExtensionsCustomEndpoint types.String `tfsdk:"firebase_extensions_custom_endpoint"`
FirebaseHostingCustomEndpoint types.String `tfsdk:"firebase_hosting_custom_endpoint"`
Expand Down
6 changes: 6 additions & 0 deletions google-beta/fwprovider/framework_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,12 @@ func (p *FrameworkProvider) Schema(_ context.Context, _ provider.SchemaRequest,
transport_tpg.CustomEndpointValidator(),
},
},
"firebase_app_check_custom_endpoint": &schema.StringAttribute{
Optional: true,
Validators: []validator.String{
transport_tpg.CustomEndpointValidator(),
},
},
"firebase_database_custom_endpoint": &schema.StringAttribute{
Optional: true,
Validators: []validator.String{
Expand Down
10 changes: 10 additions & 0 deletions google-beta/fwtransport/framework_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ type FrameworkProviderConfig struct {
EssentialContactsBasePath string
FilestoreBasePath string
FirebaseBasePath string
FirebaseAppCheckBasePath string
FirebaseDatabaseBasePath string
FirebaseExtensionsBasePath string
FirebaseHostingBasePath string
Expand Down Expand Up @@ -276,6 +277,7 @@ func (p *FrameworkProviderConfig) LoadAndValidateFramework(ctx context.Context,
p.EssentialContactsBasePath = data.EssentialContactsCustomEndpoint.ValueString()
p.FilestoreBasePath = data.FilestoreCustomEndpoint.ValueString()
p.FirebaseBasePath = data.FirebaseCustomEndpoint.ValueString()
p.FirebaseAppCheckBasePath = data.FirebaseAppCheckCustomEndpoint.ValueString()
p.FirebaseDatabaseBasePath = data.FirebaseDatabaseCustomEndpoint.ValueString()
p.FirebaseExtensionsBasePath = data.FirebaseExtensionsCustomEndpoint.ValueString()
p.FirebaseHostingBasePath = data.FirebaseHostingCustomEndpoint.ValueString()
Expand Down Expand Up @@ -961,6 +963,14 @@ func (p *FrameworkProviderConfig) HandleDefaults(ctx context.Context, data *fwmo
data.FirebaseCustomEndpoint = types.StringValue(customEndpoint.(string))
}
}
if data.FirebaseAppCheckCustomEndpoint.IsNull() {
customEndpoint := transport_tpg.MultiEnvDefault([]string{
"GOOGLE_FIREBASE_APP_CHECK_CUSTOM_ENDPOINT",
}, transport_tpg.DefaultBasePaths[transport_tpg.FirebaseAppCheckBasePathKey])
if customEndpoint != nil {
data.FirebaseAppCheckCustomEndpoint = types.StringValue(customEndpoint.(string))
}
}
if data.FirebaseDatabaseCustomEndpoint.IsNull() {
customEndpoint := transport_tpg.MultiEnvDefault([]string{
"GOOGLE_FIREBASE_DATABASE_CUSTOM_ENDPOINT",
Expand Down
6 changes: 6 additions & 0 deletions google-beta/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,11 @@ func Provider() *schema.Provider {
Optional: true,
ValidateFunc: transport_tpg.ValidateCustomEndpoint,
},
"firebase_app_check_custom_endpoint": {
Type: schema.TypeString,
Optional: true,
ValidateFunc: transport_tpg.ValidateCustomEndpoint,
},
"firebase_database_custom_endpoint": {
Type: schema.TypeString,
Optional: true,
Expand Down Expand Up @@ -1018,6 +1023,7 @@ func ProviderConfigure(ctx context.Context, d *schema.ResourceData, p *schema.Pr
config.EssentialContactsBasePath = d.Get("essential_contacts_custom_endpoint").(string)
config.FilestoreBasePath = d.Get("filestore_custom_endpoint").(string)
config.FirebaseBasePath = d.Get("firebase_custom_endpoint").(string)
config.FirebaseAppCheckBasePath = d.Get("firebase_app_check_custom_endpoint").(string)
config.FirebaseDatabaseBasePath = d.Get("firebase_database_custom_endpoint").(string)
config.FirebaseExtensionsBasePath = d.Get("firebase_extensions_custom_endpoint").(string)
config.FirebaseHostingBasePath = d.Get("firebase_hosting_custom_endpoint").(string)
Expand Down
6 changes: 4 additions & 2 deletions google-beta/provider/provider_mmv1_resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ import (
"github.com/hashicorp/terraform-provider-google-beta/google-beta/services/essentialcontacts"
"github.com/hashicorp/terraform-provider-google-beta/google-beta/services/filestore"
"github.com/hashicorp/terraform-provider-google-beta/google-beta/services/firebase"
"github.com/hashicorp/terraform-provider-google-beta/google-beta/services/firebaseappcheck"
"github.com/hashicorp/terraform-provider-google-beta/google-beta/services/firebasedatabase"
"github.com/hashicorp/terraform-provider-google-beta/google-beta/services/firebaseextensions"
"github.com/hashicorp/terraform-provider-google-beta/google-beta/services/firebasehosting"
Expand Down Expand Up @@ -427,9 +428,9 @@ var handwrittenIAMDatasources = map[string]*schema.Resource{
}

// Resources
// Generated resources: 431
// Generated resources: 432
// Generated IAM resources: 255
// Total generated resources: 686
// Total generated resources: 687
var generatedResources = map[string]*schema.Resource{
"google_folder_access_approval_settings": accessapproval.ResourceAccessApprovalFolderSettings(),
"google_organization_access_approval_settings": accessapproval.ResourceAccessApprovalOrganizationSettings(),
Expand Down Expand Up @@ -811,6 +812,7 @@ var generatedResources = map[string]*schema.Resource{
"google_firebase_apple_app": firebase.ResourceFirebaseAppleApp(),
"google_firebase_project": firebase.ResourceFirebaseProject(),
"google_firebase_web_app": firebase.ResourceFirebaseWebApp(),
"google_firebase_app_check_service_config": firebaseappcheck.ResourceFirebaseAppCheckServiceConfig(),
"google_firebase_database_instance": firebasedatabase.ResourceFirebaseDatabaseInstance(),
"google_firebase_extensions_instance": firebaseextensions.ResourceFirebaseExtensionsInstance(),
"google_firebase_hosting_channel": firebasehosting.ResourceFirebaseHostingChannel(),
Expand Down
Loading

0 comments on commit 79194d0

Please sign in to comment.