rubrikinc / terraform-provider-polaris

Terraform provider for the Polaris platform
MIT License
2 stars 9 forks source link

INVALID_ARGUMENT: invalid request: specific_input is empty #158

Closed DamaniN closed 1 month ago

DamaniN commented 2 months ago

Expected Behavior

Adding a subscription with the CLOUD_NATIVE_ARCHIVAL_ENCRYPTION feature enabled works as advertised.

Current Behavior

Adding a subscription with the CLOUD_NATIVE_ARCHIVAL_ENCRYPTION feature enabled gives the error:

Error: failed to add subscription: failed to request addAzureCloudAccountWithoutOauth: graphql response body is an error (status code 200): INVALID_ARGUMENT: invalid request: specific_input is empty (code: 400, traceId: 6cKeNbntPA1Jt50pqf1k7A==)

My guess is that this is caused because there's no way to provide the Managed Identity that goes along with the CLOUD_NATIVE_ARCHIVAL_ENCRYPTION feature. Normally, you have to create a Managed Identity and supply its details along with the details for the CLOUD_NATIVE_ARCHIVAL_ENCRYPTION feature.

Failure Information (for bugs)

Using this code:

resource "polaris_azure_subscription" "cloud_native_archival_encryption" {
  count = contains(var.rsc_azure_features, "CLOUD_NATIVE_ARCHIVAL_ENCRYPTION") ? 1 : 0
  delete_snapshots_on_destroy = var.delete_snapshots_on_destroy == true ? true : false
  subscription_id             = element(split("/", data.azurerm_subscription.current.id), 2)
  subscription_name           = data.azurerm_subscription.current.display_name
  tenant_domain               = var.rsc_service_principal_tenant_domain

  cloud_native_archival_encryption {
    regions = var.regions_to_protect
    resource_group_name   = var.azure_resource_group_name
    resource_group_region = var.azure_resource_group_region
    resource_group_tags   = var.azure_resource_group_tags
  }
}

Gives this error:

╷
│ Error: failed to add subscription: failed to request addAzureCloudAccountWithoutOauth: graphql response body is an error (status code 200): INVALID_ARGUMENT: invalid request: specific_input is empty (code: 400, traceId: 6cKeNbntPA1Jt50pqf1k7A==)
│ 
│   with module.polaris-azure-cloud-native_subscription_1.polaris_azure_subscription.cloud_native_archival_encryption[0],
│   on ../terraform-azure-polaris-cloud-native_subscription/main.tf line 100, in resource "polaris_azure_subscription" "cloud_native_archival_encryption":
│  100: resource "polaris_azure_subscription" "cloud_native_archival_encryption" {
│ 
╵

Steps to Reproduce

See above.

Context

terraform init -upgrade                                           

Initializing the backend...
Upgrading modules...
- polaris-azure-cloud-native_subscription_1 in ../terraform-azure-polaris-cloud-native_subscription
- polaris-azure-cloud-native_tenant in ../terraform-azure-polaris-cloud-native_tenant

Initializing provider plugins...
- Finding rubrikinc/polaris versions matching "0.9.0-beta.1"...
- Finding latest version of hashicorp/time...
- Finding latest version of hashicorp/azurerm...
- Finding latest version of hashicorp/azuread...
- Using previously-installed rubrikinc/polaris v0.9.0-beta.1
- Using previously-installed hashicorp/time v0.11.1
- Using previously-installed hashicorp/azurerm v3.100.0
- Using previously-installed hashicorp/azuread v2.48.0

Failure Logs

N/A

johan3141592 commented 1 month ago

The latest beta release (v0.9.0-beta.2) add fields for providing a managed identity for the cloud_native_archival_encryption feature. See the documentation for additional information.