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

New Resource & DataSource: azurerm_healthcare_service #4221

Merged
merged 105 commits into from Oct 25, 2019

Conversation

kutsovmqs
Copy link
Contributor

@kutsovmqs kutsovmqs commented Sep 3, 2019

Fixes #3989

MedalLance and others added 3 commits July 29, 2019 12:02
have been performed using the Azure SDK for Go and the fiunctionality
added to the functions in resource_arm_fhir_api_service.

DEVOPS-1201
@ghost ghost added the size/XL label Sep 3, 2019
@katbyte katbyte changed the title Fhir api rm tests New Resource & DataSource: azurerm_fhir_api_service Sep 3, 2019
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 for the pr @kutsovmqs,

I wonder if this resource would be better named azurerm_healthcare_service? the kind property indicates it might support other types then FHIR eventually.

@katbyte katbyte changed the title New Resource & DataSource: azurerm_fhir_api_service New Resource & DataSource: azurerm_healthcare_service Sep 5, 2019
@MedalLance
Copy link

Hi @katbyte, thank you for your comment and updates, and sorry we didn't put a description of what this PR is. I can see we need to resolve some conflicts, and I have a couple of questions, if you have the time. Also, this is our first adventure into extending the Azure Provider, so please don't hesitate to let us know what else we may need to do. If it helps, I am on the Terraform-Azure Slack channel.

You are correct about the general aspect of the healthcare services client vs. being FHIR specific. Since this is still in preview mode, there hasn't been a lot of information released as to what other kinds of services (and their requirements) will be offered. Since our organization is primarily interested in the FHIR API, we made our changes with this in mind. We will rename the resources, and do you think we need to do anything else in that regard? At least for now?

Also, the Azure healthcare apis package is still in preview mode, and is projected to be released this quarter (2019Q3). We do not know what, if any, changes will be made. Is it better to wait until the formal Azure release, or can we look to merge this now and update it afterwards?

Thank you so much,
-Lance

@katbyte katbyte added this to the v1.34.0 milestone Sep 10, 2019
@ghost ghost added size/XXL and removed size/XL labels Sep 11, 2019
@ghost ghost added size/XS and removed size/XXL labels Sep 11, 2019
@ghost ghost added size/XL and removed size/XS labels Sep 11, 2019
@ghost ghost added size/XXL dependencies and removed size/XL labels Sep 11, 2019
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.

Hi @kutsovmqs,

Thank you for the revisions. This is looking pretty good now. I've left some more comments inline with the biggest change being the switch to use TypeSets. Sorry i missed that earlier, this change is so that if a user rearranges the items it won't trigger a plan.


func TestAccAzureRMDataSourceHealthcareService(t *testing.T) {
dataSourceName := "data.azurerm_healthcare_service.test"
ri := acctest.RandIntRange(10000, 99999)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think testacc19101706384399625 is 24 characters 🤔

Comment on lines 101 to 104
Elem: &schema.Schema{
Type: schema.TypeString,
ValidateFunc: validate.NoEmptyStrings,
},
Copy link
Collaborator

Choose a reason for hiding this comment

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

Type int shouldn't have Elem set?

Choose a reason for hiding this comment

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

Removed.

azurerm/data_source_healthcare_service.go Outdated Show resolved Hide resolved
azurerm/data_source_healthcare_service.go Outdated Show resolved Hide resolved
azurerm/data_source_healthcare_service.go Outdated Show resolved Hide resolved
website/docs/d/healthcare_service.html.markdown Outdated Show resolved Hide resolved
website/docs/d/healthcare_service.html.markdown Outdated Show resolved Hide resolved
website/docs/r/healthcare_service.html.markdown Outdated Show resolved Hide resolved
* `cosmosdb_offer_throughput` - The provisioned throughput for the backing database. Range of `400`-`1000`. Defaults to `400`.
* `tags` - A mapping of tags to assign to the resource.

Authentication Configuration
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could we use the same pattern here as the rest of the provider docs? ie:

* `identity` - An `identity` block as defined below, which contains the Managed Service Identity information for this App Service.

---

A `identity` block exports the following:

* `principal_id` - The Principal ID for the Service Principal associated with the Managed Service Identity of this App Service.

Choose a reason for hiding this comment

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

The resource documentation has been updated with this suggestion and more.

azurerm/data_source_healthcare_service_test.go Outdated Show resolved Hide resolved
MedalLance and others added 13 commits October 23, 2019 09:22
Co-Authored-By: kt <kt@katbyte.me>
Co-Authored-By: kt <kt@katbyte.me>
Co-Authored-By: kt <kt@katbyte.me>
Co-Authored-By: kt <kt@katbyte.me>
Co-Authored-By: kt <kt@katbyte.me>
Some typing changes to TypeSet. Minor refactoring.
Documentation updates.
@MedalLance
Copy link

Hi @katbyte, thank you for the review. We've made some more changes to accommodate almost all of your requests and suggestions. There is one request for capitalization that we can not accommodate, and that is mentioned above. Also, could you please expand on your comments regarding the random int. All acceptance tests pass with the code as it is now.

We'd love to get this into 1.36, and I'll be available to work on any additional requests. I am on the Azure Provider Slack channel (MedalLance) if you'd like to chat. Thank you very much.

@ghost ghost removed the waiting-response label Oct 24, 2019
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 for the revisions @kutsovmqs,

Not to much left now, look forward to getting this merged once the comments i've left inline are addressed.

Comment on lines 103 to 109
A `cors_configuration` exports the following:

* `allow_credentials` - (Boolean) If credentials are allowed via CORS.
* `allowed_headers` - A set of headers allowed via CORS.
* `allowed_methods` - The methods allowed via CORS.
* `allowed_origins` - A set of origins allowed via CORS.
* `max_age_in_seconds` - The max age allowed via CORS.
Copy link
Collaborator

Choose a reason for hiding this comment

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

as these are set above we don't need to add them to the list of exported properties

Choose a reason for hiding this comment

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

Removed


The following arguments are supported:

* `name` - (Required) The name of the service instance. Used for service endpoint, must be unique within the audience and can contain only lowercase letters, numbers and the '-' character.
Copy link
Collaborator

Choose a reason for hiding this comment

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

We usually don't detail the valid names here, instead we catch them with validation functions.

Choose a reason for hiding this comment

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

Removed

Comment on lines 85 to 100
* `access_policy_object_ids` - A set of Azure object id's that are allowed to access the Service.
* `authentication_configuration` - An `authentication_configuration` block as defined below.
* `cors_configuration` - A `cors_configuration` object as defined below.
* `cosmosdb_throughput` - The provisioned throughput for the backing database.
* `kind` - The kind or type of Healthcare Service defined.
* `location` - The Azure Region where the Service should was created.
* `name` - The account name of the Service.
* `resource_group_name` - The resource group in which the Service was created.
* `tags` - The mapping of tags to assigned to the resource.

---
An `authentication_configuration` exports the following:

* `audience` - The audience that receives authentication tokens for the service.
* `authority` - The Azure Active Directory (tenant) that serves as the authentication authority to access the service.
* `smart_proxy_enabled` - (Boolean) If the 'SMART on FHIR' option is enabled for mobile and web implementations.
Copy link
Collaborator

Choose a reason for hiding this comment

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

These are all assignable and above so we don't need to relist them here

Choose a reason for hiding this comment

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

Removed


~> **Please Note**: Not all locations support this resource. Some are `West US 2`, `North Central US`, and `UK West`.

* `kind` - The type of the service. i.e.: "fhir", "fhir-Stu3" and "fhir-R4".
Copy link
Collaborator

Choose a reason for hiding this comment

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

We don't usually list possible types in the dat source

Suggested change
* `kind` - The type of the service. i.e.: "fhir", "fhir-Stu3" and "fhir-R4".
* `kind` - The type of the service. i.e.

Choose a reason for hiding this comment

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

Removed in commit

Comment on lines 53 to 67
* `tags` - A mapping of tags to assign to the resource.

Authentication Configuration

* `authority` - The Azure Active Directory (tenant) that serves as the authentication authority to access the service.
* `audience` - The intended audience to receive authentication tokens for the service..
* `smart_proxy_enabled` - Enabled status of the 'SMART on FHIR' option for mobile and web implementations.

CORS Configuration

* `allowed_origins` - The origins to be allowed via CORS.
* `allowed_headers` - The headers to be allowed via CORS.
* `allowed_methods` - The methods to be allowed via CORS.
* `max_age_in_seconds` - The max age to be allowed via CORS.
* `allow_credentials` - If credentials are allowed via CORS.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could we make these the same as the resource?

* `authentication_configuration` - An `authentication_configuration` block as defined below.

...

---
An `authentication_configuration` exports the following:

* `audience` - The audience that receives authentication tokens for the service.
* `authority` - The Azure Active Directory (tenant) that serves as the authentication authority to access the service.
* `smart_proxy_enabled` - (Boolean) If the 'SMART on FHIR' option is enabled for mobile and web implementations.
...

Choose a reason for hiding this comment

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

Done

)

func TestAccAzureRMHealthcareService_basic(t *testing.T) {
ri := acctest.RandIntRange(10000, 99999)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could we use the standard tf.AccRandTimeInt here? if need /10 or /100 for it to fit

Choose a reason for hiding this comment

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

Done

Copy link

Choose a reason for hiding this comment

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

For this and the data source test, we switched to tf. AccRandTimeInt / 10 and changed the prefix to testacc for a format of testacc19102406571368976, as suggested. Hopefully this will be random enough to be unique and still be 24 chars.


func TestAccAzureRMDataSourceHealthcareService(t *testing.T) {
dataSourceName := "data.azurerm_healthcare_service.test"
ri := acctest.RandIntRange(10000, 99999)
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is still a concern

@MedalLance
Copy link

Hi @katbyte, I've made the requested changes. Please take a look and let me know you think. Thank you.

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 for the updates @kutsovmqs! Aside from a few minor changes to the docs which i just pushed this LGTM 👍

@katbyte katbyte merged commit a975734 into hashicorp:master Oct 25, 2019
katbyte added a commit that referenced this pull request Oct 25, 2019
@ghost
Copy link

ghost commented Oct 29, 2019

This has been released in version 1.36.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example:

provider "azurerm" {
    version = "~> 1.36.0"
}
# ... other configuration ...

@ghost
Copy link

ghost commented Nov 24, 2019

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@hashicorp hashicorp locked and limited conversation to collaborators Nov 24, 2019
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.

Support for Azure API for FHIR®
5 participants