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

Configure BastionHost.network resource and add example manifest #775

Merged
merged 1 commit into from
Jul 4, 2024

Conversation

turkenf
Copy link
Collaborator

@turkenf turkenf commented Jul 3, 2024

Description of your changes

This PR includes configuring the BastionHost.network resource and adding the example manifest.

I have:

  • Read and followed Crossplane's contribution process.
  • Run make reviewable to ensure this PR is ready for review.
  • Added backport release-x.y labels to auto-backport this PR if necessary.

How has this code been tested

Manually and uptest: https://github.com/crossplane-contrib/provider-upjet-azure/actions/runs/9779701746

NAME                                                  SYNCED   READY   EXTERNAL-NAME    AGE
bastionhost.network.azure.upbound.io/examplebastion   True     True    examplebastion   12m

@turkenf
Copy link
Collaborator Author

turkenf commented Jul 3, 2024

/test-examples="examples/network/v1beta1/bastionhost.yaml"

@@ -655,6 +655,8 @@ var TerraformPluginSDKExternalNameConfigs = map[string]config.ExternalName{
"azurerm_web_application_firewall_policy": config.TemplatedStringAsIdentifier("name", "/subscriptions/{{ .setup.configuration.subscription_id }}/resourceGroups/{{ .parameters.resource_group_name }}/providers/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies/{{ .external_name }}"),
// /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resGroup1/providers/Microsoft.Network/vpnServerConfigurations/serverConfiguration1/configurationPolicyGroups/configurationPolicyGroup1
"azurerm_vpn_server_configuration_policy_group": config.TemplatedStringAsIdentifier("name", "{{ .parameters.vpn_server_configuration_id }}/configurationPolicyGroups/{{ .external_name }}"),
// /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Network/bastionHosts/instance1
"azurerm_bastion_host": config.IdentifierFromProvider,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

When we set the external name configuration to the following, the update fails in the first reconcile:

"azurerm_bastion_host": config.TemplatedStringAsIdentifier("name", "/subscriptions/{{ .setup.configuration.subscription_id }}/resourceGroups/{{ .parameters.resource_group_name }}/providers/Microsoft.Network/bastionHosts/{{ .exteranl_name }}"),

Got the following error:

    message: 'async update failed: refuse to update the external resource because
      the following update requires replacing it: cannot change the value of the argument
      "name" from "fatihtest" to "/subscriptions/038f2b7c-3265-43b8-8624-c9ad5da610a8/resourceGroups/fatihtest/providers/Microsoft.Network/bastionHosts/fatihtest"'

Therefore it is set to IdentifierFromProvider

Copy link
Collaborator

Choose a reason for hiding this comment

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

{{ .exteranl_name }}

was there a typo?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good catch, @ytsarev; in case of a typo, I expect the resource not to be created. I will try and update. Thank you

Copy link
Collaborator Author

@turkenf turkenf Jul 3, 2024

Choose a reason for hiding this comment

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

Fixing the typo eliminated the issue 🤔 I updated the description and PR.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Cool, thanks a lot!

Signed-off-by: Fatih Türken <turkenf@gmail.com>
@turkenf
Copy link
Collaborator Author

turkenf commented Jul 3, 2024

/test-examples="examples/network/v1beta1/bastionhost.yaml"

Copy link
Collaborator

@mergenci mergenci left a comment

Choose a reason for hiding this comment

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

Thanks @turkenf 🙌 LGTM.

@turkenf turkenf merged commit 503a129 into crossplane-contrib:main Jul 4, 2024
12 checks passed
@turkenf turkenf deleted the add-bastion-host branch July 4, 2024 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants