-
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
New Resource: azurerm_bastion_host #4096
New Resource: azurerm_bastion_host #4096
Conversation
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.
Hi @DanielMabbett,
Thank you for this PR. Overall this is off to a great start but there are some things that need to be addressed. I've left some comments inline but a short summary of them is:
- This will need master merged in or rebased fo fix the merge conflicts
- on create/read we should use expand/flatten functions for sub blocks
- we need to read back in all properties after creation
- we should add a
complete
test that uses all properties (dns_name)
Just for everyones info: This will require the network client to use the 2019-06-01 api rather than the existing 2018-12-01 version. This will have to be done in a separate PR as this will affect other network resources deployed in Azure Terraform provider. |
@DanielMabbett, it looks like we've already updated the network package in 1.34: #4291 |
Ah perfect. I will update the code to reflect the API shortly |
…form-provider-azurerm into feature/azure-bastion-host-apiupdate
…piupdate Feature/azure bastion host apiupdate
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.
Thanks for the revisions @DanielMabbett,
Aside from a couple minor comments inline this is looking good! However when i run the tests on our CI server i'm getting:
=== RUN TestAccAzureRMBastionHost_basic
=== PAUSE TestAccAzureRMBastionHost_basic
=== CONT TestAccAzureRMBastionHost_basic
--- FAIL: TestAccAzureRMBastionHost_basic (252.87s)
testing.go:569: Step 0 error: errors during apply:
Error: Error waiting for creation/update of Bastion Host "acctestBastion2vwe" (Resource Group "acctestRG-191007203045052833"): Code="VmssGatewayDeploymentFailed" Message="The gateway deployment operation failed due to an intermittent error. Please try again." Details=[]
on /opt/teamcity-agent/temp/buildTmp/tf-test821609061/main.tf line 29:
(source code not available)
testing.go:630: Error destroying resource! WARNING: Dangling resources
may exist. The full state and error is shown below.
Error: errors during apply: 2 problems:
- Error deleting Subnet "AzureBastionSubnet" (Virtual Network "acctestVNet2vwe" / Resource Group "acctestRG-191007203045052833"): network.SubnetsClient#Delete: Failure sending request: StatusCode=400 -- Original Error: Code="InUseSubnetCannotBeDeleted" Message="Subnet AzureBastionSubnet is in use by /subscriptions/1a6092a6-137e-4025-9a7c-ef77f76f2c02/resourceGroups/acctestRG-191007203045052833/providers/Microsoft.Network/bastionHosts/acctestBastion2vwe/bastionHostIpConfigurations/configuration and cannot be deleted. In order to delete the subnet, delete all the resources within the subnet. See aka.ms/deletesubnet." Details=[]
- Error deleting Public IP "acctestBastionPIP191007203045052833" (Resource Group "acctestRG-191007203045052833"): network.PublicIPAddressesClient#Delete: Failure sending request: StatusCode=400 -- Original Error: Code="PublicIPAddressCannotBeDeleted" Message="Public IP address /subscriptions/1a6092a6-137e-4025-9a7c-ef77f76f2c02/resourceGroups/acctestRG-191007203045052833/providers/Microsoft.Network/publicIPAddresses/acctestBastionPIP191007203045052833 can not be deleted since it is still allocated to resource /subscriptions/1a6092a6-137e-4025-9a7c-ef77f76f2c02/resourceGroups/acctestRG-191007203045052833/providers/Microsoft.Network/bastionHosts/acctestBastion2vwe/bastionHostIpConfigurations/configuration. In order to delete the public IP, disassociate/detach the Public IP address from the resource. To learn how to do this, see aka.ms/deletepublicip." Details=[]
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.
Thanks for fixing that @DanielMabbett, LGTM and the tests now pass! however linting is failing because of an extra whitespace. you can fix it by running make whitespace
and committing the change (i tried myself but i don't have push access to the branch)
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 ... |
Hello I just did use the new resource "azurerm_bastion_host" and do thank you for the release but I faced this error, seems that some characters like "-" are prohibited, hardcoded in the resource itself. I can attest because I used to create the bastion host with arm template and creating those resource with this character is supported by Microsoft.
|
Hi @JamesDLD , Thanks for letting us know. I will take a look at this. Can you put your comment above into a new request and I will get working on fixing that for you. |
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! |
This should fix the feature request issue:
#3829
I have: