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

azurerm_bastion_host: Adding zones property to resource and data source. #27909

Merged
merged 3 commits into from
Nov 8, 2024

Conversation

CorrenSoft
Copy link
Contributor

@CorrenSoft CorrenSoft commented Nov 5, 2024

Community Note

  • Please vote on this PR by adding a 👍 reaction to the original PR to help the community and maintainers prioritize for review
  • Please do not leave comments along the lines of "+1", "me too" or "any updates", they generate extra noise for PR followers and do not help prioritize for review

Description

  • Added zones property to resource and data source.
  • Updated Complete Test to include zones.
  • Updated Data Source test to use Complete config.
  • Updated docs.

PR Checklist

  • I have followed the guidelines in our Contributing Documentation.
  • I have checked to ensure there aren't other open Pull Requests for the same update/change.
  • I have checked if my changes close any open issues. If so please include appropriate closing keywords below.
  • I have updated/added Documentation as required written in a helpful and kind way to assist users that may be unfamiliar with the resource / data source.
  • I have used a meaningful PR title to help maintainers and other users understand this change and help prevent duplicate work.

Changes to existing Resource / Data Source

  • I have added an explanation of what my changes do and why I'd like you to include them (This may be covered by linking to an issue above, but may benefit from additional explanation).
  • I have written new tests for my resource or datasource changes & updated any relevent documentation.
  • I have successfully run tests with my changes locally. If not, please provide details on testing challenges that prevented you running the tests.

Testing

  • My submission includes Test coverage as described in the Contribution Guide and the tests pass.
make acctests SERVICE='network' TESTARGS='-run=TestAccBastionHost_'
=== RUN   TestAccBastionHost_basic
=== PAUSE TestAccBastionHost_basic
=== RUN   TestAccBastionHost_standardSku
=== PAUSE TestAccBastionHost_standardSku
=== RUN   TestAccBastionHost_complete
=== PAUSE TestAccBastionHost_complete
=== RUN   TestAccBastionHost_requiresImport
=== PAUSE TestAccBastionHost_requiresImport
=== RUN   TestAccBastionHost_scaleUnits
=== PAUSE TestAccBastionHost_scaleUnits
=== RUN   TestAccBastionHost_sku
=== PAUSE TestAccBastionHost_sku
=== RUN   TestAccBastionHost_developerSku
=== PAUSE TestAccBastionHost_developerSku
=== RUN   TestAccBastionHost_premiumSku
=== PAUSE TestAccBastionHost_premiumSku
=== CONT  TestAccBastionHost_basic
=== CONT  TestAccBastionHost_scaleUnits
=== CONT  TestAccBastionHost_developerSku
=== CONT  TestAccBastionHost_sku
=== CONT  TestAccBastionHost_complete
=== CONT  TestAccBastionHost_standardSku
=== CONT  TestAccBastionHost_requiresImport
=== CONT  TestAccBastionHost_premiumSku
--- PASS: TestAccBastionHost_developerSku (390.34s)
--- PASS: TestAccBastionHost_standardSku (1164.83s)
--- PASS: TestAccBastionHost_requiresImport (1178.79s)
--- PASS: TestAccBastionHost_complete (1207.11s)
--- PASS: TestAccBastionHost_premiumSku (1325.62s)
--- PASS: TestAccBastionHost_basic (1353.50s)
--- PASS: TestAccBastionHost_sku (1688.30s)
--- PASS: TestAccBastionHost_scaleUnits (1881.51s)
PASS
ok      github.com/hashicorp/terraform-provider-azurerm/internal/services/network       1881.726s
make acctests SERVICE='network' TESTARGS='-run=TestAccBastionHostDataSource_'

=== RUN   TestAccBastionHostDataSource_complete
=== PAUSE TestAccBastionHostDataSource_complete
=== CONT  TestAccBastionHostDataSource_complete
--- PASS: TestAccBastionHostDataSource_complete (1052.24s)
PASS
ok      github.com/hashicorp/terraform-provider-azurerm/internal/services/network       1052.699s

Change Log

Below please provide what should go into the changelog (if anything) conforming to the Changelog Format documented here.

This is a (please select all that apply):

  • Bug Fix
  • New Feature (ie adding a service, resource, or data source)
  • Enhancement
  • Breaking Change

Related Issue(s)

Fixes #27783

Note

If this PR changes meaningfully during the course of review please update the title and description as required.

Updating Basic Test to include zones.
Updated docs.
}

resource "azurerm_bastion_host" "test" {
name = "acctestBastion%s"
location = azurerm_resource_group.test.location
resource_group_name = azurerm_resource_group.test.name
zones = azurerm_public_ip.test.zones
Copy link
Member

Choose a reason for hiding this comment

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

The basic test config should only include properties that are Required, could you move this to the complete test config?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, will do that.
What should I do with the data source test? Initially included the field in the Basic because is the dataset used in that test, Should I update it to use the Complete instead?

Copy link
Member

Choose a reason for hiding this comment

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

Yep I would update the data source test to use the complete config

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I made the changes (and updated the PR description accordingly)

Copy link
Member

@stephybun stephybun left a comment

Choose a reason for hiding this comment

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

Thanks @CorrenSoft, the check in the basic acceptance test needs to be removed, once that's done this should be good to go.

@@ -27,6 +27,7 @@ func TestAccBastionHost_basic(t *testing.T) {
Config: r.basic(data),
Check: acceptance.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
check.That(data.ResourceName).Key("zones.#").HasValue("3"),
Copy link
Member

Choose a reason for hiding this comment

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

Can we remove this check since it's not valid for the basic test anymore

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch, thank you :)

Copy link
Member

@stephybun stephybun left a comment

Choose a reason for hiding this comment

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

Thanks @CorrenSoft LGTM 👾

stephybun added a commit that referenced this pull request Nov 8, 2024
@stephybun stephybun merged commit e85a546 into hashicorp:main Nov 8, 2024
34 checks passed
@github-actions github-actions bot added this to the v4.10.0 milestone Nov 8, 2024
@CorrenSoft CorrenSoft deleted the feature/27783 branch November 12, 2024 18:46
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 13, 2024
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.

Support for Zones in BastionHosts
2 participants