From 41e7589ebc4c94b07cdfc34346597cd9e3119209 Mon Sep 17 00:00:00 2001 From: Seth Vargo Date: Fri, 21 Aug 2020 19:06:51 -0400 Subject: [PATCH 1/2] Drop recommendation to use -provider= on import This was deprecated in 0.12 and is removed in 0.13. --- templates/terraform/resource.html.markdown.erb | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/templates/terraform/resource.html.markdown.erb b/templates/terraform/resource.html.markdown.erb index 9c2017316773..dd8d043c2990 100644 --- a/templates/terraform/resource.html.markdown.erb +++ b/templates/terraform/resource.html.markdown.erb @@ -185,13 +185,10 @@ This resource provides the following ``` <% import_id_formats_from_resource(object).map{ |id| id.gsub('%', '') }.each do |id_format| -%> -$ terraform import <% if object.min_version.name == 'beta' %>-provider=google-beta <% end -%><%= terraform_name -%>.default <%= id_format %> +$ terraform import <%= terraform_name -%>.default <%= id_format %> <% end -%> ``` --> If you're importing a resource with beta features, make sure to include `-provider=google-beta` -as an argument so that Terraform uses the correct provider to import your resource. - <% end -%> <% if object.base_url.include?("{{project}}") || object.supports_indirect_user_project_override -%> ## User Project Overrides From 8ec2e4bafc18970b7ee09946a96f2556711a48b5 Mon Sep 17 00:00:00 2001 From: Seth Vargo Date: Tue, 25 Aug 2020 11:19:41 -0400 Subject: [PATCH 2/2] Cleanup remaining references --- templates/terraform/resource_iam.html.markdown.erb | 7 ++----- .../website/docs/guides/provider_versions.html.markdown | 2 +- .../website/docs/r/google_kms_crypto_key_iam.html.markdown | 3 --- .../website/docs/r/google_kms_key_ring_iam.html.markdown | 3 --- .../docs/r/google_service_account_iam.html.markdown | 4 ++-- .../website/docs/r/monitoring_dashboard.html.markdown | 3 --- 6 files changed, 5 insertions(+), 17 deletions(-) diff --git a/templates/terraform/resource_iam.html.markdown.erb b/templates/terraform/resource_iam.html.markdown.erb index 9a8f20dee6d4..d062fbe2d628 100644 --- a/templates/terraform/resource_iam.html.markdown.erb +++ b/templates/terraform/resource_iam.html.markdown.erb @@ -262,7 +262,7 @@ Any variables not passed in the import command will be taken from the provider c IAM member imports use space-delimited identifiers: the resource in question, the role, and the member identity, e.g. ``` -$ terraform import <% if object.min_version.name == 'beta' %>-provider=google-beta <% end -%><%= resource_ns_iam -%>_member.editor "<%= all_formats.first.gsub('{{name}}', "{{#{object.name.underscore}}}") -%> <%= object.iam_policy.allowed_iam_role -%> user:jane@example.com" +$ terraform import <%= resource_ns_iam -%>_member.editor "<%= all_formats.first.gsub('{{name}}', "{{#{object.name.underscore}}}") -%> <%= object.iam_policy.allowed_iam_role -%> user:jane@example.com" ``` IAM binding imports use space-delimited identifiers: the resource in question and the role, e.g. @@ -272,12 +272,9 @@ $ terraform import <%= resource_ns_iam -%>_binding.editor "<%= all_formats.first IAM policy imports use the identifier of the resource in question, e.g. ``` -$ terraform import <% if object.min_version.name == 'beta' %>-provider=google-beta <% end -%><%= resource_ns_iam -%>_policy.editor <%= all_formats.first.gsub('{{name}}', "{{#{object.name.underscore}}}") %> +$ terraform import <%= resource_ns_iam -%>_policy.editor <%= all_formats.first.gsub('{{name}}', "{{#{object.name.underscore}}}") %> ``` --> If you're importing a resource with beta features, make sure to include `-provider=google-beta` -as an argument so that Terraform uses the correct provider to import your resource. - -> **Custom Roles**: If you're importing a IAM resource with a custom role, make sure to use the full name of the custom role, e.g. `[projects/my-project|organizations/my-org]/roles/my-custom-role`. diff --git a/third_party/terraform/website/docs/guides/provider_versions.html.markdown b/third_party/terraform/website/docs/guides/provider_versions.html.markdown index 6c126f7736db..2196f9730456 100644 --- a/third_party/terraform/website/docs/guides/provider_versions.html.markdown +++ b/third_party/terraform/website/docs/guides/provider_versions.html.markdown @@ -112,7 +112,7 @@ with the `-provider` flag, similarly to if you were using a provider alias. ```bash -terraform import -provider=google-beta google_compute_instance.beta-instance my-instance +terraform import google_compute_instance.beta-instance my-instance ``` ## Converting resources between versions diff --git a/third_party/terraform/website/docs/r/google_kms_crypto_key_iam.html.markdown b/third_party/terraform/website/docs/r/google_kms_crypto_key_iam.html.markdown index 6761e0720fbe..d802bdaf7feb 100644 --- a/third_party/terraform/website/docs/r/google_kms_crypto_key_iam.html.markdown +++ b/third_party/terraform/website/docs/r/google_kms_crypto_key_iam.html.markdown @@ -196,6 +196,3 @@ IAM policy imports use the identifier of the resource in question. This policy ``` $ terraform import google_kms_crypto_key_iam_policy.crypto_key your-project-id/location-name/key-ring-name/key-name ``` - --> If you're importing a resource with beta features, make sure to include `-provider=google-beta` -as an argument so that Terraform uses the correct provider to import your resource. diff --git a/third_party/terraform/website/docs/r/google_kms_key_ring_iam.html.markdown b/third_party/terraform/website/docs/r/google_kms_key_ring_iam.html.markdown index 0aa98b6ba449..f8c521ba4ffb 100644 --- a/third_party/terraform/website/docs/r/google_kms_key_ring_iam.html.markdown +++ b/third_party/terraform/website/docs/r/google_kms_key_ring_iam.html.markdown @@ -199,6 +199,3 @@ IAM policy imports use the identifier of the resource in question. This policy ``` $ terraform import google_kms_key_ring_iam_policy.key_ring_iam your-project-id/location-name/key-ring-name ``` - --> If you're importing a resource with beta features, make sure to include `-provider=google-beta` -as an argument so that Terraform uses the correct provider to import your resource. diff --git a/third_party/terraform/website/docs/r/google_service_account_iam.html.markdown b/third_party/terraform/website/docs/r/google_service_account_iam.html.markdown index 5bd5551aef2e..75eea008302f 100644 --- a/third_party/terraform/website/docs/r/google_service_account_iam.html.markdown +++ b/third_party/terraform/website/docs/r/google_service_account_iam.html.markdown @@ -194,7 +194,7 @@ full name of the custom role, e.g. `[projects/my-project|organizations/my-org]/r With conditions: ``` -$ terraform import -provider=google-beta google_service_account_iam_binding.admin-account-iam "projects/{your-project-id}/serviceAccounts/{your-service-account-email} iam.serviceAccountUser expires_after_2019_12_31" +$ terraform import google_service_account_iam_binding.admin-account-iam "projects/{your-project-id}/serviceAccounts/{your-service-account-email} iam.serviceAccountUser expires_after_2019_12_31" -$ terraform import -provider=google-beta google_service_account_iam_member.admin-account-iam "projects/{your-project-id}/serviceAccounts/{your-service-account-email} iam.serviceAccountUser user:foo@example.com expires_after_2019_12_31" +$ terraform import google_service_account_iam_member.admin-account-iam "projects/{your-project-id}/serviceAccounts/{your-service-account-email} iam.serviceAccountUser user:foo@example.com expires_after_2019_12_31" ``` diff --git a/third_party/terraform/website/docs/r/monitoring_dashboard.html.markdown b/third_party/terraform/website/docs/r/monitoring_dashboard.html.markdown index 54633a2b2b84..d154a14276d8 100644 --- a/third_party/terraform/website/docs/r/monitoring_dashboard.html.markdown +++ b/third_party/terraform/website/docs/r/monitoring_dashboard.html.markdown @@ -148,9 +148,6 @@ $ terraform import google_monitoring_dashboard.default project/{{project}}/dashb $ terraform import google_monitoring_dashboard.default {{dashboard_id}} ``` --> If you're importing a resource with beta features, make sure to include `-provider=google-beta` -as an argument so that Terraform uses the correct provider to import your resource. - ## User Project Overrides This resource supports [User Project Overrides](https://www.terraform.io/docs/providers/google/guides/provider_reference.html#user_project_override).