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

Add location specifiers to network resources #2023

Conversation

jemrobinson
Copy link
Member

✅ Checklist

  • You have given your pull request a meaningful title (e.g. Enable foobar integration rather than 515 foobar).
  • You are targeting the appropriate branch. If you're not certain which one this is, it should be develop.
  • Your branch is up-to-date with the target branch (it probably was when you started, but it may have changed since then).

🚦 Depends on

n/a

⤴️ Summary

Add location specifiers to virtual networks and NSGs as these will otherwise use the default location (which may not be correct).

🌂 Related issues

Closes #2022

🔬 Tests

Tested on previously-broken SRE deployment

@jemrobinson jemrobinson requested a review from a team as a code owner July 17, 2024 11:00
@jemrobinson jemrobinson requested a review from a team July 17, 2024 11:00
Copy link

github-actions bot commented Jul 17, 2024

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  data_safe_haven/infrastructure/programs/sre
  application_gateway.py
Project Total  

This report was generated by python-coverage-comment-action

@jemrobinson jemrobinson force-pushed the 2022-fix-network-resource-locations branch from e69f46a to affbbea Compare July 17, 2024 12:41
@jemrobinson jemrobinson requested review from craddm and JimMadge July 18, 2024 09:37
Copy link
Member

@JimMadge JimMadge left a comment

Choose a reason for hiding this comment

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

LGTM

It seems to be good practice to always specify the location.

Do we not have a location specified in the stack configuration? dev.pulumi.yaml equivalent.
Or, does that not guarantee resources will use that location?

It might be there is future work here to make this more robust.

@JimMadge JimMadge merged commit e140cbd into alan-turing-institute:develop Jul 18, 2024
11 checks passed
@jemrobinson
Copy link
Member Author

The pulumi-azure-native has a default location set at initialisation time, which is stored in the state file.

"location": "uksouth",
"subscriptionId": <redacted>,
"tenantId": <redacted>,
"version": "2.50.1"

These are set during install_plugins using stack options. These should be in-sync with what's in the config file. The problem that this PR fixes only happens if you change the "location" parameter in the config. The data in the Pulumi state file doesn't get updated (it seems to be "baked in").

I encountered the problem because I tried to deploy into "ukwest" - found that some resources aren't available there, so ran a teardown and redeploy into "uksouth". This left "ukwest" defined in the state file, which was used whenever "location" wasn't explicitly set on a resource.

@jemrobinson jemrobinson deleted the 2022-fix-network-resource-locations branch January 30, 2025 11:46
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.

Networking creation failing
2 participants