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

Added keys to output for cog service account #2825

Merged
merged 16 commits into from
Feb 4, 2019

Conversation

JimPaine
Copy link
Contributor

@JimPaine JimPaine commented Feb 1, 2019

When creating a cognitive service account the keys were not returned so you were unable to configure downstream services.

Related Issue #2567

Key things to note:

  • I couldn't see tests around the other outputs so haven't modified them, i.e. "endpoint" happy to add if it is felt to be required.
  • I also noticed that some resource change the terminology around key names for eg. key1 -> primary key but I have left to match the RESTful api and GO SDK.

(fixes #2567)

@ghost ghost added the size/XS label Feb 1, 2019
katbyte
katbyte previously requested changes Feb 1, 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 @JimPaine,

Thank you for the enhancement! It is a bit weird for it to be key1 and key2, what does the portal say? I think we should align most closely with that over the API.

We should add a check to the tests to ensure the properties are set:

resource.TestCheckResourceAttrSet(resourceName, "key1"),

Also could we add these new properties to the documentation?

azurerm/resource_arm_cognitive_account.go Outdated Show resolved Hide resolved
azurerm/resource_arm_cognitive_account.go Outdated Show resolved Hide resolved
azurerm/resource_arm_cognitive_account.go Show resolved Hide resolved
azurerm/resource_arm_cognitive_account.go Outdated Show resolved Hide resolved
azurerm/resource_arm_cognitive_account.go Outdated Show resolved Hide resolved
azurerm/resource_arm_cognitive_account.go Outdated Show resolved Hide resolved
@JimPaine
Copy link
Contributor Author

JimPaine commented Feb 1, 2019

Hi @katbyte It is also in the portal as key1 and key2 so while it may seem a little odd it is probably best to keep it aligned? I will work on the requested changes so thanks for the feedback.

@ghost ghost added size/XS and removed size/S labels Feb 1, 2019
Copy link
Contributor Author

@JimPaine JimPaine left a comment

Choose a reason for hiding this comment

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

Suggested changes made and I have also commented on the points around what to do when we fail to get the keys, agreed with the thoughts and have wrapped up the err rather than removing the resource.

azurerm/resource_arm_cognitive_account.go Show resolved Hide resolved
@ghost ghost added size/S documentation and removed size/XS labels Feb 1, 2019
@JimPaine
Copy link
Contributor Author

JimPaine commented Feb 1, 2019

Tests and documents updated

@ghost ghost removed the waiting-response label Feb 1, 2019
Copy link
Contributor

@tombuildsstuff tombuildsstuff left a comment

Choose a reason for hiding this comment

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

hey @JimPaine

Thanks for this PR :)

I've taken a look through and whilst this LGTM I've got some questions around the naming of the fields - I believe it'd be better to match the naming of the other resources; what do you think?

Thanks!

azurerm/resource_arm_cognitive_account.go Outdated Show resolved Hide resolved
azurerm/resource_arm_cognitive_account.go Outdated Show resolved Hide resolved
Copy link
Contributor Author

@JimPaine JimPaine left a comment

Choose a reason for hiding this comment

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

@tombuildsstuff Updated keys to match terraform naming rather than the API, ensuring a consistency between documentation and resources.

Copy link
Contributor

@tombuildsstuff tombuildsstuff left a comment

Choose a reason for hiding this comment

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

hey @JimPaine

Thanks for pushing those changes - there's a couple of minor docs phasing changes which could make more sense upon reflection (which I'm going to push a commit for) but this otherwise LGTM 👍

Thanks!

website/docs/r/cognitive_account.html.markdown Outdated Show resolved Hide resolved
website/docs/r/cognitive_account.html.markdown Outdated Show resolved Hide resolved
@tombuildsstuff
Copy link
Contributor

Tests pass:

screenshot 2019-02-04 at 15 22 46

@tombuildsstuff tombuildsstuff dismissed katbyte’s stale review February 4, 2019 15:23

dismissing since changes have been pushed

@tombuildsstuff tombuildsstuff added this to the 1.22.0 milestone Feb 4, 2019
@tombuildsstuff tombuildsstuff merged commit 6748dd5 into hashicorp:master Feb 4, 2019
tombuildsstuff added a commit that referenced this pull request Feb 4, 2019
@ghost
Copy link

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

@ghost ghost locked and limited conversation to collaborators Mar 7, 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.

Output the access keys and endpoint url for azurerm_cognitive_account
3 participants