-
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_relay_hybrid_connection
#4832
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.
Hey @DSakura207. These changes look great. I've requested quite a few changes but the comments are almost entirely cleanup/organization focused so we maintain consistency in the provider codebase.
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" | ||
) | ||
|
||
func TestAccAzureRMHybridConnection_basic(t *testing.T) { |
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.
We should add Relay to these tests names to better categorize them at a glance
func TestAccAzureRMHybridConnection_basic(t *testing.T) { | |
func TestAccAzureRMRelayHybridConnection_basic(t *testing.T) { |
}) | ||
} | ||
|
||
func TestAccAzureRMHybridConnection_full(t *testing.T) { |
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.
func TestAccAzureRMHybridConnection_full(t *testing.T) { | |
func TestAccAzureRMRelayHybridConnection_full(t *testing.T) { |
}) | ||
} | ||
|
||
func TestAccAzureRMHybridConnection_update(t *testing.T) { |
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.
func TestAccAzureRMHybridConnection_update(t *testing.T) { | |
func TestAccAzureRMRelayHybridConnection_update(t *testing.T) { |
} | ||
|
||
func BuildClient(o *common.ClientOptions) *Client { | ||
NamespacesClient := relay.NewNamespacesClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) | ||
HybridConnectionsClient := relay.NewHybridConnectionsClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) |
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.
We should organize these like:
NamespacesClient := relay.NewNamespacesClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId)
o.ConfigureClient(&NamespacesClient.Client, o.ResourceManagerAuthorizer)
HybridConnectionsClient := relay.NewHybridConnectionsClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId)
o.ConfigureClient(&HybridConnectionsClient.Client, o.ResourceManagerAuthorizer)
@@ -396,6 +396,7 @@ func Provider() terraform.ResourceProvider { | |||
"azurerm_redis_cache": resourceArmRedisCache(), | |||
"azurerm_redis_firewall_rule": resourceArmRedisFirewallRule(), | |||
"azurerm_relay_namespace": resourceArmRelayNamespace(), | |||
"azurerm_relay_hybrid_connection": resourceArmHybridConnection(), |
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.
This should be moved up one to keep this list alphabetical
Pending: []string{"Pending"}, | ||
Target: []string{"Deleted"}, | ||
Refresh: hybridConnectionDeleteRefreshFunc(ctx, client, resourceGroup, relayNamespace, name), | ||
Timeout: 60 * time.Minute, |
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 the Timeout section defined in the schema, you defined the Delete timeout as 30 minutes. We should sync these up so this is either 30 minutes or the delete timeout defined above is 60 minutes.
|
||
resource "azurerm_relay_hybrid_connection" "test" { | ||
name = "acctestrnhc-%d" | ||
resource_group_name = "${azurerm_resource_group.test.name}" |
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.
Adding a space so the equals sign lines up a little better
resource_group_name = "${azurerm_resource_group.test.name}" | |
resource_group_name = "${azurerm_resource_group.test.name}" |
|
||
resource "azurerm_relay_hybrid_connection" "test" { | ||
name = "acctestrnhc-%d" | ||
resource_group_name = "${azurerm_resource_group.test.name}" |
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.
resource_group_name = "${azurerm_resource_group.test.name}" | |
resource_group_name = "${azurerm_resource_group.test.name}" |
} | ||
|
||
resource "azurerm_relay_hybrid_connection" "test" { | ||
name = "acctestrnhc-%d" |
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.
We should line all these equal signs up
%s | ||
|
||
resource "azurerm_relay_namespace" "import" { | ||
name = "acctestrnhc-%d" |
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.
We should line all these equal signs up
Also, thank you for submitting your first PR! This is a great start |
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.
Hello @mbfrahry , thanks for your quick reply. I've update my branch with your suggestions. Hopefully my finger is not fat so that the commit can pass checks 🤞
azurerm_relay_hybrid_connection
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.
This all looks great! Thanks for fixing it up.
@DSakura207, thanks again for working on this. It should make it into the next release |
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! |
--- PASS: TestAccAzureRMHybridConnection_basic
--- PASS: TestAccAzureRMHybridConnection_full
--- PASS: TestAccAzureRMHybridConnection_update
Resolution for #1320.
First time pull request 😄
The resource is Azure Relay Hybrid Connection. It is basically the same as Azure App Service Hybrid Connection, while the App Service version requires special user metadata and access policy.
More changes will come, but this is the foundation. To support App Service and App Service Plan, there will be more changes in another pull request.