diff --git a/mmv1/products/osconfig/api.yaml b/mmv1/products/osconfig/api.yaml index 8182a9f6760c..b38797f9a5eb 100644 --- a/mmv1/products/osconfig/api.yaml +++ b/mmv1/products/osconfig/api.yaml @@ -782,9 +782,6 @@ objects: A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z". - !ruby/object:Api::Type::NestedObject name: 'weekly' - exactly_one_of: - - recurring_schedule.0.weekly - - recurring_schedule.0.monthly description: | Schedule with weekly executions. properties: @@ -803,9 +800,6 @@ objects: - :SUNDAY - !ruby/object:Api::Type::NestedObject name: 'monthly' - exactly_one_of: - - recurring_schedule.0.weekly - - recurring_schedule.0.monthly description: | Schedule with monthly executions. properties: diff --git a/mmv1/products/osconfig/terraform.yaml b/mmv1/products/osconfig/terraform.yaml index 80c49f0c197d..373d6bb3d8ef 100644 --- a/mmv1/products/osconfig/terraform.yaml +++ b/mmv1/products/osconfig/terraform.yaml @@ -20,7 +20,11 @@ overrides: !ruby/object:Overrides::ResourceOverrides name: "os_config_patch_deployment_basic" primary_resource_id: "patch" vars: - instance_name: "patch-deploy-inst" + patch_deployment_id: "patch-deploy" + - !ruby/object:Provider::Terraform::Examples + name: "os_config_patch_deployment_daily" + primary_resource_id: "patch" + vars: patch_deployment_id: "patch-deploy" - !ruby/object:Provider::Terraform::Examples name: "os_config_patch_deployment_instance" @@ -32,7 +36,6 @@ overrides: !ruby/object:Overrides::ResourceOverrides name: "os_config_patch_deployment_full" primary_resource_id: "patch" vars: - instance_name: "patch-deploy-inst" patch_deployment_id: "patch-deploy" properties: patchDeploymentId: !ruby/object:Overrides::Terraform::PropertyOverride @@ -127,4 +130,4 @@ files: !ruby/object:Provider::Config::Files # These files have templating (ERB) code that will be run. # This is usually to add licensing info, autogeneration notices, etc. compile: -<%= lines(indent(compile('provider/terraform/product~compile.yaml'), 4)) -%> \ No newline at end of file +<%= lines(indent(compile('provider/terraform/product~compile.yaml'), 4)) -%> diff --git a/mmv1/templates/terraform/encoders/os_config_patch_deployment.go.erb b/mmv1/templates/terraform/encoders/os_config_patch_deployment.go.erb index 8be00aa3981f..a5660782d606 100644 --- a/mmv1/templates/terraform/encoders/os_config_patch_deployment.go.erb +++ b/mmv1/templates/terraform/encoders/os_config_patch_deployment.go.erb @@ -4,6 +4,8 @@ if obj["recurringSchedule"] != nil { obj["recurringSchedule"].(map[string]interface{})["frequency"] = "MONTHLY" } else if schedule["weekly"] != nil { obj["recurringSchedule"].(map[string]interface{})["frequency"] = "WEEKLY" + } else { + obj["recurringSchedule"].(map[string]interface{})["frequency"] = "DAILY" } } diff --git a/mmv1/templates/terraform/examples/os_config_patch_deployment_basic.tf.erb b/mmv1/templates/terraform/examples/os_config_patch_deployment_basic.tf.erb index fb97a8ef0a15..d80c0cd9e93f 100644 --- a/mmv1/templates/terraform/examples/os_config_patch_deployment_basic.tf.erb +++ b/mmv1/templates/terraform/examples/os_config_patch_deployment_basic.tf.erb @@ -1,5 +1,5 @@ resource "google_os_config_patch_deployment" "<%= ctx[:primary_resource_id] %>" { - patch_deployment_id = "<%= ctx[:vars]['instance_name'] %>" + patch_deployment_id = "<%= ctx[:vars]['patch_deployment_id'] %>" instance_filter { all = true diff --git a/mmv1/templates/terraform/examples/os_config_patch_deployment_daily.tf.erb b/mmv1/templates/terraform/examples/os_config_patch_deployment_daily.tf.erb new file mode 100644 index 000000000000..7ee009d374aa --- /dev/null +++ b/mmv1/templates/terraform/examples/os_config_patch_deployment_daily.tf.erb @@ -0,0 +1,20 @@ +resource "google_os_config_patch_deployment" "<%= ctx[:primary_resource_id] %>" { + patch_deployment_id = "<%= ctx[:vars]['patch_deployment_id'] %>" + + instance_filter { + all = true + } + + recurring_schedule { + time_zone { + id = "America/New_York" + } + + time_of_day { + hours = 0 + minutes = 30 + seconds = 30 + nanos = 20 + } + } +} diff --git a/mmv1/templates/terraform/examples/os_config_patch_deployment_full.tf.erb b/mmv1/templates/terraform/examples/os_config_patch_deployment_full.tf.erb index 53030f0d1ba4..2033a86bf7a6 100644 --- a/mmv1/templates/terraform/examples/os_config_patch_deployment_full.tf.erb +++ b/mmv1/templates/terraform/examples/os_config_patch_deployment_full.tf.erb @@ -1,5 +1,5 @@ resource "google_os_config_patch_deployment" "<%= ctx[:primary_resource_id] %>" { - patch_deployment_id = "<%= ctx[:vars]['instance_name'] %>" + patch_deployment_id = "<%= ctx[:vars]['patch_deployment_id'] %>" instance_filter { group_labels { diff --git a/mmv1/templates/terraform/examples/os_config_patch_deployment_instance.tf.erb b/mmv1/templates/terraform/examples/os_config_patch_deployment_instance.tf.erb index d210b42c7e50..726a58bf1517 100644 --- a/mmv1/templates/terraform/examples/os_config_patch_deployment_instance.tf.erb +++ b/mmv1/templates/terraform/examples/os_config_patch_deployment_instance.tf.erb @@ -26,7 +26,7 @@ resource "google_compute_instance" "foobar" { } resource "google_os_config_patch_deployment" "<%= ctx[:primary_resource_id] %>" { - patch_deployment_id = "<%= ctx[:vars]['instance_name'] %>" + patch_deployment_id = "<%= ctx[:vars]['patch_deployment_id'] %>" instance_filter { instances = [google_compute_instance.foobar.id] @@ -56,4 +56,4 @@ resource "google_os_config_patch_deployment" "<%= ctx[:primary_resource_id] %>" month_day = 1 } } -} \ No newline at end of file +}