-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Add subject alternative names to azurerm_key_vault_certificate #2123
Add subject alternative names to azurerm_key_vault_certificate #2123
Conversation
This is now somehow failing on linting with @tombuildsstuff do you have any idea how I can fix this? |
- SANS: when item was undefined, it always cause a diff in the plan - SANS: made the block optional as it should be
} | ||
} | ||
|
||
return policy | ||
} | ||
|
||
func expandKeyVaultSanProperty(input []interface{}) *[]string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a utils.ExpandStringArray
that does exactly this
Hi @draggeta, We have a I ran it and pushed up the changes |
@draggeta we're currently using Go 1.10 on this project (but Go 1.11 is the latest) - we'll be moving to this in the near future; of particular note between the two versions is how |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey @draggeta
I've taken a look through and left a couple of comments but this otherwise LGTM; if we can fix those up we should be able to run the tests and get this merged :)
Thanks!
Co-Authored-By: draggeta <draggeta@users.noreply.github.com>
Co-Authored-By: draggeta <draggeta@users.noreply.github.com>
Co-Authored-By: draggeta <draggeta@users.noreply.github.com>
Co-Authored-By: draggeta <draggeta@users.noreply.github.com>
@tombuildsstuff Well, that explains a lot, I'm using 1.11 😄 As for the changes. I implemented them, but now I always end up with 1 item for the SAN when importing or when it is not defined. That was why I had written the code like I did. I had forgotten about it. Am I correct in my assumption that this should be fixed with a DiffSuppressFunc? |
…form-provider-azurerm into add-subject-alternative-names-to-key-vault-certificates
@draggeta heh - thanks for pushing those changes too :)
Kinda; since this is a list we'll make this |
|
||
if upns := san.Upns; upns != nil { | ||
sanOutput["upns"] = *upns | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in retrospect (since they're returned from the API) - we'll want to always flatten these fields (even if there's no items returned) - as such we should be able to make this:
sanOutput["emails"] = utils.FlattenStringArray(san.Emails)
sanOutput["dns_names"] = utils.FlattenStringArray(san.DNSNames)
sanOutput["upns"] = utils.FlattenStringArray(san.Upns)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey @draggeta
Thanks for pushing those changes - this now LGTM 👍 - I'll kick off the test suite shortly
Thanks!
Ignoring a known test failure - the tests pass - thanks for this @draggeta :): |
hi @draggeta Just to let you know that this has been released as a part of v1.18 of the AzureRM Provider (the full changelog is available here). You can upgrade to this by specifying the version in the provider block (as shown below) and then running
Thanks! |
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! |
Because of hacktober I decided to just try my hand at this. Either way. This allows you to specify subject alternative names for the azurerm_key_vault_certificate resource. All combinations of FQDNs, email addresses and UPNs are possible.
Test results:
Closes #479
Also fixes #1309