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

azurerm_appplication_insights - Add support for connection_string #8699

Merged

Conversation

sas-pemcne
Copy link
Contributor

I've added support for connection_string property to the application_insight resource. This fixes #8669 and #1303.

The connection string value is generated on the Azure side, this should just surface the value in the outputs for the resource. Tested this change with new, existing resources, and imported resources.

I've added the value into the documentation markup too but let me know if I missed any references.

Copy link
Member

@mbfrahry mbfrahry left a comment

Choose a reason for hiding this comment

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

Hey @sas-pemcne. This looks nearly there. Just a few quick fixes and we'll be good to go

@@ -34,6 +34,7 @@ output "application_insights_instrumentation_key" {
* `app_id` - The App ID associated with this Application Insights component.
* `application_type` - The type of the component.
* `instrumentation_key` - The instrumentation key of the Application Insights component.
* `connection_string` - The connection string of the Application Insights component.
Copy link
Member

Choose a reason for hiding this comment

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

We'll want to add this to the ## Attributes Reference section in this file as well

Copy link
Member

Choose a reason for hiding this comment

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

And we should add (Sensitive). too

Suggested change
* `connection_string` - The connection string of the Application Insights component.
* `connection_string` - The connection string of the Application Insights component. (Sensitive).

@@ -35,6 +35,11 @@ func dataSourceArmApplicationInsights() *schema.Resource {
Computed: true,
},

"connection_string": {
Type: schema.TypeString,
Computed: true,
Copy link
Member

Choose a reason for hiding this comment

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

We should mark this as sensitive here as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Interesting.. I was copying the instrumentation_key property which is marked sensitive at the resource and not sensitive at the data source level. Did you want to be consistent with instrumentation_key or mark connection_string as sensitive?

Copy link
Member

Choose a reason for hiding this comment

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

It's weird that it's marked as sensitive in one place and not the other with instrumentation_key. I'm not sure why that's the case but let's keep it consistent with the resource and mark connection_string as Sensitive.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good, I was guessing it was an oversight at some point. I'll get those changes pushed up.

@sas-pemcne sas-pemcne force-pushed the app-insights-connection-string branch from afe04d6 to 87e45c8 Compare October 2, 2020 14:59
@mbfrahry mbfrahry changed the title Add support for connection_string property to application-insights resource azurerm_appplication_insights - Add support for connection_string Oct 2, 2020
Copy link
Member

@mbfrahry mbfrahry left a comment

Choose a reason for hiding this comment

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

LGTM!

@mbfrahry mbfrahry merged commit 135e2fb into hashicorp:master Oct 2, 2020
mbfrahry added a commit that referenced this pull request Oct 2, 2020
@katbyte katbyte added this to the v2.31.0 milestone Oct 3, 2020
@ghost
Copy link

ghost commented Oct 8, 2020

This has been released in version 2.31.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 = "~> 2.31.0"
}
# ... other configuration ...

@ghost
Copy link

ghost commented Nov 2, 2020

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 👉 [email protected]. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Nov 2, 2020
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.

Add Connection String attribute to Application Insights Resource
3 participants