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

Implement azurerm_automation_certificate #4785

Merged
merged 13 commits into from
Dec 18, 2019
Merged

Implement azurerm_automation_certificate #4785

merged 13 commits into from
Dec 18, 2019

Conversation

dowlingw
Copy link
Contributor

@dowlingw dowlingw commented Nov 1, 2019

Implement azurerm_automation_certificate as requested in #3881

Overview of changes:

  • Added CertificateClient to automation client
  • Implemented new resource type azurerm_automation_certificate
  • Resource documentation for website

Notes
This is my first attempt at Terraform provider code, any feedback about how this could be done better or differently would be appreciated.

I've elected to set Computed: true on the is_exportable and thumbprint resource properties, even though these can be set on the Create/Update calls - these are extracted from the provided certificate and returned in any REST responses. I've validated this for the thumbprint property but not for is_exportable. I can't imagine anyone would need to doubly specify this.

@dowlingw dowlingw changed the title [WIP] adding azurerm_automation_certificate [WIP] adding azurerm_automation_certificate Nov 1, 2019
katbyte
katbyte previously requested changes Nov 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.

Thanks for the new resource @dowlingw,

Overall this is off to a great start! i've left some comments inline that need to be addressed before merge

azurerm/resource_arm_automation_certificate.go Outdated Show resolved Hide resolved
azurerm/resource_arm_automation_certificate.go Outdated Show resolved Hide resolved
azurerm/resource_arm_automation_certificate.go Outdated Show resolved Hide resolved
website/docs/r/automation_certificate.html.markdown Outdated Show resolved Hide resolved
azurerm/resource_arm_automation_certificate.go Outdated Show resolved Hide resolved
@katbyte katbyte added this to the v1.37.0 milestone Nov 1, 2019
@dowlingw dowlingw changed the title [WIP] adding azurerm_automation_certificate Implement azurerm_automation_certificate Nov 6, 2019
@dowlingw dowlingw requested a review from katbyte November 6, 2019 16:33
@tombuildsstuff tombuildsstuff modified the milestones: v1.37.0, v1.38.0 Nov 21, 2019
@tombuildsstuff tombuildsstuff modified the milestones: v1.38.0, v1.39.0 Dec 3, 2019
@dowlingw
Copy link
Contributor Author

dowlingw commented Dec 6, 2019

I think this should be ready to go, please have a look and let me know if you've got any further feedback <3

@tombuildsstuff tombuildsstuff modified the milestones: v1.39.0, v1.40.0 Dec 12, 2019
dowlingw and others added 10 commits December 18, 2019 12:58
--
* Validation for schema elements
* Stop setting Computed properties on creation
* Renamed/ordered variables for readability and consistency
--
* Wrote script to re-generate test certificate
--
* Adding test for certificate rename
* Refactor back into single CreateUpdate method
@tombuildsstuff tombuildsstuff self-assigned this Dec 18, 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 @dowlingw

Thanks for this PR - apologies for the delayed review here!

Taking a look through this looks pretty good - I've left some minor comments inline (which, I hope you don't mind but I'm going to push a commit to fix & rebase this on top of master so that we can get this merged) - but this is otherwise looking good to me 👍

Thanks!

azurerm/resource_arm_automation_certificate.go Outdated Show resolved Hide resolved
azurerm/resource_arm_automation_certificate.go Outdated Show resolved Hide resolved
azurerm/resource_arm_automation_certificate.go Outdated Show resolved Hide resolved
azurerm/resource_arm_automation_certificate.go Outdated Show resolved Hide resolved
azurerm/resource_arm_automation_certificate_test.go Outdated Show resolved Hide resolved
azurerm/resource_arm_automation_certificate_test.go Outdated Show resolved Hide resolved
azurerm/resource_arm_automation_certificate_test.go Outdated Show resolved Hide resolved
azurerm/resource_arm_automation_certificate_test.go Outdated Show resolved Hide resolved
@tombuildsstuff
Copy link
Contributor

Tests pass:

$ acctests azurerm TestAccAzureRMAutomationCertificate_
=== RUN   TestAccAzureRMAutomationCertificate_basic
=== PAUSE TestAccAzureRMAutomationCertificate_basic
=== RUN   TestAccAzureRMAutomationCertificate_requiresImport
--- SKIP: TestAccAzureRMAutomationCertificate_requiresImport (0.00s)
    resource_arm_automation_certificate_test.go:44: Skipping since resources aren't required to be imported
=== RUN   TestAccAzureRMAutomationCertificate_complete
=== PAUSE TestAccAzureRMAutomationCertificate_complete
=== RUN   TestAccAzureRMAutomationCertificate_update
--- PASS: TestAccAzureRMAutomationCertificate_update (201.07s)
=== CONT  TestAccAzureRMAutomationCertificate_basic
--- PASS: TestAccAzureRMAutomationCertificate_basic (109.49s)
=== CONT  TestAccAzureRMAutomationCertificate_complete
--- PASS: TestAccAzureRMAutomationCertificate_complete (107.52s)
PASS
ok  	github.com/terraform-providers/terraform-provider-azurerm/azurerm	418.130s

@tombuildsstuff tombuildsstuff dismissed katbyte’s stale review December 18, 2019 13:02

dismissing since changes have been pushed

@tombuildsstuff tombuildsstuff removed the request for review from katbyte December 18, 2019 13:04
@dowlingw
Copy link
Contributor Author

No problems whatsoever, thanks for sorting those out - cheers :)

@tombuildsstuff tombuildsstuff merged commit 2ddeb9a into hashicorp:master Dec 18, 2019
tombuildsstuff added a commit that referenced this pull request Dec 18, 2019
@ghost
Copy link

ghost commented Jan 8, 2020

This has been released in version 1.40.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.40.0"
}
# ... other configuration ...

@ghost
Copy link

ghost commented Mar 28, 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 👉 hashibot-feedback@hashicorp.com. Thanks!

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

3 participants