Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

r/azurerm_healthcare_fhir - public_network_access_enabled added #18566

Merged

Conversation

aristosvo
Copy link
Collaborator

@aristosvo aristosvo commented Sep 28, 2022

Fixes #18549

No acctest added, as it is only one Computed property and would need an extensive setup:

provider "azurerm" {
  features {}
}

resource "azurerm_resource_group" "example" {
  name     = "${var.prefix}-resources"
  location = var.location
}

resource "azurerm_virtual_network" "example" {
  name                = "${var.prefix}-vnet"
  address_space       = ["10.0.0.0/16"]
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name
}

resource "azurerm_subnet" "endpoint" {
  name                 = "endpoint"
  resource_group_name  = azurerm_resource_group.example.name
  virtual_network_name = azurerm_virtual_network.example.name
  address_prefixes     = ["10.0.2.0/24"]

  enforce_private_link_endpoint_network_policies = true
}

resource "azurerm_private_dns_zone" "example" {
  name                = "privatelink.azurehealthcareapis.com"
  resource_group_name = azurerm_resource_group.example.name
}

resource "azurerm_private_dns_zone" "example2" {
  name                = "privatelink.dicom.azurehealthcareapis.com"
  resource_group_name = azurerm_resource_group.example.name
}

resource "azurerm_healthcare_workspace" "example" {
  name                = "${var.prefix}hcws"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name
}

resource "azurerm_healthcare_fhir_service" "example" {
  name                = "${var.prefix}-fhir"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name
  workspace_id        = azurerm_healthcare_workspace.example.id
  kind                = "fhir-R4"

  authentication {
    authority = "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47"
    audience  = "https://acctestfhir.fhir.azurehealthcareapis.com"
  }
}

resource "azurerm_private_endpoint" "example" {
  name                = "${var.prefix}-pe"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name
  subnet_id           = azurerm_subnet.endpoint.id

  private_dns_zone_group {
    name                 = "private-dns-zone-group"
    private_dns_zone_ids = [azurerm_private_dns_zone.example.id, azurerm_private_dns_zone.example2.id]
  }

  private_service_connection {
    name                           = "hcws-connection"
    is_manual_connection           = false
    private_connection_resource_id = azurerm_healthcare_workspace.example.id
    subresource_names              = ["healthcareworkspace"]
  }
}

Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @aristosvo - we do have an existing test failing:

------- Stdout: -------
=== RUN   TestAccHealthcareApiFhirService_publicNetworkingDisabled
=== PAUSE TestAccHealthcareApiFhirService_publicNetworkingDisabled
=== CONT  TestAccHealthcareApiFhirService_publicNetworkingDisabled
    testcase.go:110: Step 3/6 error: After applying this test step, the plan was not empty.
        stdout:
        
        
        Terraform used the selected providers to generate the following execution
        plan. Resource actions are indicated with the following symbols:
          ~ update in-place
        
        Terraform will perform the following actions:
        
          # azurerm_healthcare_fhir_service.test will be updated in-place
          ~ resource "azurerm_healthcare_fhir_service" "test" {
                id                                  = "/subscriptions/*******/resourceGroups/acctestRG-healthcareapi-220928174902951730/providers/Microsoft.HealthcareApis/workspaces/acc220928174902951730/fhirservices/fhir220928174902951730"
                name                                = "fhir220928174902951730"
              ~ public_network_access_enabled       = true -> false
                tags                                = {}
                # (6 unchanged attributes hidden)
        
                # (1 unchanged block hidden)
            }
        
        Plan: 0 to add, 1 to change, 0 to destroy.
--- FAIL: TestAccHealthcareApiFhirService_publicNetworkingDisabled (877.62s)
FAIL

@aristosvo
Copy link
Collaborator Author

Thanks for reviewing!

I've changed some code afterwards, removing the need/fuctionality requiring this test and causing this test failure.

Restarted a test run on TC.

Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @aristosvo - LGTM 🔍

@katbyte katbyte merged commit de3db67 into hashicorp:main Sep 29, 2022
katbyte added a commit that referenced this pull request Sep 29, 2022
@github-actions github-actions bot added this to the v3.25.0 milestone Sep 29, 2022
@github-actions
Copy link

This functionality has been released in v3.25.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Azure FHIR Service cannot disable public network access
2 participants