diff --git a/.ci/ci.yml.tmpl b/.ci/ci.yml.tmpl index 0c09f3c37a1f..de645d661533 100644 --- a/.ci/ci.yml.tmpl +++ b/.ci/ci.yml.tmpl @@ -192,7 +192,7 @@ jobs: - put: {{v.short_name}}-intermediate params: - repository: terraform-diff/new + repository: terraform-diff/{{k}}/new branch_file: magic-modules-branched/branchname force: true get_params: @@ -200,7 +200,7 @@ jobs: - put: {{v.short_name}}-intermediate params: - repository: terraform-diff/old + repository: terraform-diff/{{k}}/old branch_file: magic-modules-previous/branchname force: true get_params: diff --git a/.ci/magic-modules/diff-terraform.sh b/.ci/magic-modules/diff-terraform.sh index acc398f625ac..596ea881a016 100755 --- a/.ci/magic-modules/diff-terraform.sh +++ b/.ci/magic-modules/diff-terraform.sh @@ -82,5 +82,7 @@ for mm_dir in magic-modules-branched magic-modules-previous; do done -git clone "magic-modules-branched/build/$SHORT_NAME" "./terraform-diff/new" -git clone "magic-modules-previous/build/$SHORT_NAME" "./terraform-diff/old" +mkdir "./terraform-diff/$VERSION" + +git clone "magic-modules-branched/build/$SHORT_NAME" "./terraform-diff/$VERSION/new" +git clone "magic-modules-previous/build/$SHORT_NAME" "./terraform-diff/$VERSION/old" diff --git a/build/terraform b/build/terraform index 7ba8fef5fc0e..1ed9f43abe5a 160000 --- a/build/terraform +++ b/build/terraform @@ -1 +1 @@ -Subproject commit 7ba8fef5fc0e41b9442a263d2c7716a51ef1dc20 +Subproject commit 1ed9f43abe5a1118143bc460594341338ffc598d diff --git a/build/terraform-beta b/build/terraform-beta index f9c2705788ec..0574383c5b92 160000 --- a/build/terraform-beta +++ b/build/terraform-beta @@ -1 +1 @@ -Subproject commit f9c2705788ec0273a269fb149a676ca9077229e3 +Subproject commit 0574383c5b921b76b03bbb3a0791763f8e3155d6 diff --git a/build/terraform-mapper b/build/terraform-mapper index af8ba4e287cf..4700f1232f79 160000 --- a/build/terraform-mapper +++ b/build/terraform-mapper @@ -1 +1 @@ -Subproject commit af8ba4e287cf4b1f5b631dc16ed7b74fb4aff136 +Subproject commit 4700f1232f799d729d3422bb3e51055522ec4fb0 diff --git a/products/appengine/ansible.yaml b/products/appengine/ansible.yaml index 5f4928d134d7..c540de908491 100644 --- a/products/appengine/ansible.yaml +++ b/products/appengine/ansible.yaml @@ -20,6 +20,8 @@ datasources: !ruby/object:Overrides::ResourceOverrides DomainMapping: !ruby/object:Overrides::Ansible::ResourceOverride exclude: true overrides: !ruby/object:Overrides::ResourceOverrides + ApplicationUrlDispatchRules: !ruby/object:Overrides::Ansible::ResourceOverride + exclude: true FirewallRule: !ruby/object:Overrides::Ansible::ResourceOverride # Because of lack of state, Ansible treats identity # differently than Terraform. diff --git a/products/appengine/api.yaml b/products/appengine/api.yaml index 347e7819b4fb..d33bfd8087bc 100644 --- a/products/appengine/api.yaml +++ b/products/appengine/api.yaml @@ -446,3 +446,60 @@ objects: Instance class that is used to run this version. Valid values are AutomaticScaling F1, F2, F4, F4_1G (Only AutomaticScaling is supported at the moment) + - !ruby/object:Api::Resource + name: 'ApplicationUrlDispatchRules' + description: | + Rules to match an HTTP request and dispatch that request to a service. + base_url: 'apps/{{project}}' + create_url: 'apps/{{project}}?updateMask=dispatch_rules' + create_verb: :PATCH + delete_url: 'apps/{{project}}?updateMask=dispatch_rules' + delete_verb: :PATCH + update_url: 'apps/{{project}}?updateMask=dispatch_rules' + update_verb: :PATCH + references: !ruby/object:Api::Resource::ReferenceLinks + api: 'https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps#UrlDispatchRule' + async: !ruby/object:Api::Async + operation: !ruby/object:Api::Async::Operation + path: 'name' + base_url: '{{op_id}}' + wait_ms: 1000 + result: !ruby/object:Api::Async::Result + path: 'response' + status: !ruby/object:Api::Async::Status + path: 'status' + complete: 'DONE' + allowed: + - 'PENDING' + - 'RUNNING' + - 'DONE' + error: !ruby/object:Api::Async::Error + path: 'error/errors' + message: 'message' + properties: + - !ruby/object:Api::Type::Array + name: 'dispatchRules' + required: true + description: | + Rules to match an HTTP request and dispatch that request to a service. + item_type: !ruby/object:Api::Type::NestedObject + properties: + - !ruby/object:Api::Type::String + name: 'domain' + default_value: '*' + description: | + Domain name to match against. The wildcard "*" is supported if specified before a period: "*.". + Defaults to matching all domains: "*". + - !ruby/object:Api::Type::String + name: 'path' + description: | + Pathname within the host. Must start with a "/". A single "*" can be included at the end of the path. + The sum of the lengths of the domain and path may not exceed 100 characters. + required: true + - !ruby/object:Api::Type::String + name: 'service' + description: | + Pathname within the host. Must start with a "/". A single "*" can be included at the end of the path. + The sum of the lengths of the domain and path may not exceed 100 characters. + required: true + diff --git a/products/appengine/inspec.yaml b/products/appengine/inspec.yaml index 70f55cc33388..44be027a00e9 100644 --- a/products/appengine/inspec.yaml +++ b/products/appengine/inspec.yaml @@ -14,6 +14,8 @@ --- !ruby/object:Provider::Inspec::Config legacy_name: appengine overrides: !ruby/object:Overrides::ResourceOverrides + ApplicationUrlDispatchRules: !ruby/object:Overrides::Inspec::ResourceOverride + exclude: true DomainMapping: !ruby/object:Overrides::Inspec::ResourceOverride exclude: true FirewallRule: !ruby/object:Overrides::Inspec::ResourceOverride diff --git a/products/appengine/terraform.yaml b/products/appengine/terraform.yaml index 506900f045d9..2dcbb57e9843 100644 --- a/products/appengine/terraform.yaml +++ b/products/appengine/terraform.yaml @@ -27,7 +27,7 @@ overrides: !ruby/object:Overrides::ResourceOverrides StandardAppVersion: !ruby/object:Overrides::Terraform::ResourceOverride id_format: "apps/{{project}}/services/{{service}}/versions/{{version_id}}" import_format: ["apps/{{project}}/services/{{service}}/versions/{{version_id}}"] - mutex: "apps/{{project}}/services/{{service}}" + mutex: "apps/{{project}}" parameters: service: !ruby/object:Overrides::Terraform::PropertyOverride default_from_api: true @@ -43,7 +43,7 @@ overrides: !ruby/object:Overrides::ResourceOverrides If set to `true`, the service will be deleted if it is the last version. custom_code: !ruby/object:Provider::Terraform::CustomCode custom_delete: templates/terraform/custom_delete/appversion_delete.go.erb - test_check_destroy: templates/terraform/custom_check_destroy/appengine_version.go.erb + test_check_destroy: templates/terraform/custom_check_destroy/appengine.go.erb properties: id: !ruby/object:Overrides::Terraform::PropertyOverride name: 'version_id' @@ -93,6 +93,19 @@ overrides: !ruby/object:Overrides::ResourceOverrides update_mask_fields: - "ssl_settings.certificate_id" - "ssl_settings.ssl_management_type" + ApplicationUrlDispatchRules: !ruby/object:Overrides::Terraform::ResourceOverride + id_format: "{{project}}" + import_format: ["{{project}}"] + mutex: "apps/{{project}}" + custom_code: !ruby/object:Provider::Terraform::CustomCode + test_check_destroy: templates/terraform/custom_check_destroy/appengine.go.erb + examples: + - !ruby/object:Provider::Terraform::Examples + name: "app_engine_application_url_dispatch_rules_basic" + primary_resource_id: "service_rules" + vars: + project: "my-project" + bucket_name: "appengine-test-bucket" # This is for copying files over files: !ruby/object:Provider::Config::Files diff --git a/templates/terraform/custom_check_destroy/appengine_version.go.erb b/templates/terraform/custom_check_destroy/appengine.go.erb similarity index 100% rename from templates/terraform/custom_check_destroy/appengine_version.go.erb rename to templates/terraform/custom_check_destroy/appengine.go.erb diff --git a/templates/terraform/examples/app_engine_application_url_dispatch_rules_basic.tf.erb b/templates/terraform/examples/app_engine_application_url_dispatch_rules_basic.tf.erb new file mode 100644 index 000000000000..7fc7237b0b5c --- /dev/null +++ b/templates/terraform/examples/app_engine_application_url_dispatch_rules_basic.tf.erb @@ -0,0 +1,43 @@ +resource "google_storage_bucket" "bucket" { + name = "<%= ctx[:vars]['bucket_name'] %>" +} + +resource "google_storage_bucket_object" "object" { + name = "hello-world.zip" + bucket = "${google_storage_bucket.bucket.name}" + source = "./test-fixtures/appengine/hello-world.zip" +} + +resource "google_app_engine_standard_app_version" "myapp_v1" { + version_id = "v1" + service = "myapp" + runtime = "nodejs10" + noop_on_destroy = true + entrypoint { + shell = "node ./app.js" + } + deployment { + zip { + source_url = "https://storage.googleapis.com/${google_storage_bucket.bucket.name}/hello-world.zip" + } + } + env_variables = { + port = "8080" + } + depends_on = ["google_storage_bucket_object.object"] + +} + +resource "google_app_engine_application_url_dispatch_rules" "service_rules" { + # project = "my-project" + dispatch_rules { + domain = "*" + path = "/default/*" + service = "default" + } + dispatch_rules { + domain = "*" + path = "/myapp/*" + service = "${google_app_engine_standard_app_version.myapp_v1.service}" + } +} diff --git a/third_party/terraform/resources/resource_compute_instance_group.go b/third_party/terraform/resources/resource_compute_instance_group.go index d4f9ad3542a9..176a16a2518e 100644 --- a/third_party/terraform/resources/resource_compute_instance_group.go +++ b/third_party/terraform/resources/resource_compute_instance_group.go @@ -49,7 +49,7 @@ func resourceComputeInstanceGroup() *schema.Resource { Optional: true, Computed: true, Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, + Set: selfLinkRelativePathHash, }, "named_port": { diff --git a/third_party/terraform/website-compiled/google.erb b/third_party/terraform/website-compiled/google.erb index b57105ae4d61..57728087c777 100644 --- a/third_party/terraform/website-compiled/google.erb +++ b/third_party/terraform/website-compiled/google.erb @@ -235,6 +235,9 @@