Skip to content

Commit

Permalink
Composer 3 GA (GoogleCloudPlatform#12234)
Browse files Browse the repository at this point in the history
  • Loading branch information
spapi17 authored Nov 14, 2024
1 parent ea78f58 commit ce73272
Show file tree
Hide file tree
Showing 16 changed files with 42 additions and 125 deletions.
8 changes: 1 addition & 7 deletions mmv1/products/composer/UserWorkloadsConfigMap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@ name: 'UserWorkloadsConfigMap'
description: |
User workloads ConfigMap used by Airflow tasks that run with Kubernetes Executor or KubernetesPodOperator.
Intended for Composer 3 Environments.
min_version: 'beta'
references:
guides:
# TODO: add v1 reference when this is moved to ga
api: 'https://cloud.google.com/composer/docs/reference/rest/v1beta1/projects.locations.environments.userWorkloadsConfigMaps'
api: 'https://cloud.google.com/composer/docs/reference/rest/v1/projects.locations.environments.userWorkloadsConfigMaps'
docs:
base_url: 'projects/{{project}}/locations/{{region}}/environments/{{environment}}/userWorkloadsConfigMaps'
self_link: 'projects/{{project}}/locations/{{region}}/environments/{{environment}}/userWorkloadsConfigMaps/{{name}}'
Expand All @@ -41,15 +39,13 @@ parameters:
type: String
description: |
The location or Compute Engine region for the environment.
min_version: 'beta'
url_param_only: true
immutable: true
default_from_api: true
- name: 'environment'
type: String
description: |
Environment where the Kubernetes ConfigMap will be stored and used.
min_version: 'beta'
url_param_only: true
required: true
immutable: true
Expand All @@ -60,7 +56,6 @@ properties:
type: String
description: |
Name of the Kubernetes ConfigMap.
min_version: 'beta'
required: true
immutable: true
custom_flatten: 'templates/terraform/custom_flatten/name_from_self_link.tmpl'
Expand All @@ -72,5 +67,4 @@ properties:
description: |
The "data" field of Kubernetes ConfigMap, organized in key-value pairs.
For details see: https://kubernetes.io/docs/concepts/configuration/configmap/
min_version: 'beta'
immutable: false
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
resource "google_composer_environment" "environment" {
provider = google-beta
name = "{{index $.Vars "environment_name"}}"
region = "us-central1"
config {
Expand All @@ -10,7 +9,6 @@ resource "google_composer_environment" "environment" {
}

resource "google_composer_user_workloads_config_map" "{{$.PrimaryResourceId}}" {
provider = google-beta
name = "{{index $.Vars "config_map_name"}}"
region = "us-central1"
environment = google_composer_environment.environment.name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ import (
"github.com/hashicorp/terraform-provider-google/google/services/{{ $service }}"
{{- end }}

{{ if eq $.TargetVersionName `ga` }}
"github.com/hashicorp/terraform-provider-google/google/services/composer"
{{- end }}
"github.com/hashicorp/terraform-provider-google/google/services/container"
"github.com/hashicorp/terraform-provider-google/google/services/containeraws"
"github.com/hashicorp/terraform-provider-google/google/services/containerazure"
Expand Down Expand Up @@ -67,10 +64,8 @@ var handwrittenDatasources = map[string]*schema.Resource{
"google_cloud_run_v2_job": cloudrunv2.DataSourceGoogleCloudRunV2Job(),
"google_cloud_run_v2_service": cloudrunv2.DataSourceGoogleCloudRunV2Service(),
"google_composer_environment": composer.DataSourceGoogleComposerEnvironment(),
{{- if ne $.TargetVersionName "ga" }}
"google_composer_user_workloads_config_map": composer.DataSourceGoogleComposerUserWorkloadsConfigMap(),
"google_composer_user_workloads_secret": composer.DataSourceGoogleComposerUserWorkloadsSecret(),
{{- end }}
"google_composer_image_versions": composer.DataSourceGoogleComposerImageVersions(),
"google_compute_address": compute.DataSourceGoogleComputeAddress(),
"google_compute_addresses": compute.DataSourceGoogleComputeAddresses(),
Expand Down Expand Up @@ -323,9 +318,7 @@ var handwrittenResources = map[string]*schema.Resource{
"google_billing_subaccount": resourcemanager.ResourceBillingSubaccount(),
"google_cloudfunctions_function": cloudfunctions.ResourceCloudFunctionsFunction(),
"google_composer_environment": composer.ResourceComposerEnvironment(),
{{- if ne $.TargetVersionName "ga" }}
"google_composer_user_workloads_secret": composer.ResourceComposerUserWorkloadsSecret(),
{{- end }}
"google_compute_attached_disk": compute.ResourceComputeAttachedDisk(),
"google_compute_instance": compute.ResourceComputeInstance(),
"google_compute_disk_async_replication": compute.ResourceComputeDiskAsyncReplication(),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package composer

{{ if ne $.TargetVersionName `ga` -}}
import (
"fmt"

Expand Down Expand Up @@ -48,4 +47,3 @@ func dataSourceGoogleComposerUserWorkloadsConfigMapRead(d *schema.ResourceData,

return nil
}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package composer_test

{{ if ne $.TargetVersionName `ga` -}}
import (
"fmt"
"testing"
Expand Down Expand Up @@ -56,4 +55,3 @@ data "google_composer_user_workloads_config_map" "test" {
}
`, context)
}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package composer

{{ if ne $.TargetVersionName `ga` -}}
import (
"fmt"

Expand Down Expand Up @@ -60,4 +59,3 @@ func dataSourceGoogleComposerUserWorkloadsSecretRead(d *schema.ResourceData, met

return nil
}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package composer_test

{{ if ne $.TargetVersionName `ga` -}}
import (
"errors"
"fmt"
Expand Down Expand Up @@ -99,4 +98,3 @@ data "google_composer_user_workloads_secret" "test" {
}
`, context)
}
{{- end }}
Loading

0 comments on commit ce73272

Please sign in to comment.