镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

feat(azure): make storage account replication type configurable - #941

Open
officialasishkumar wants to merge 1 commit into
nitrictech:mainfrom
officialasishkumar:feat/azure-storage-replication
Open

officialasishkumar wants to merge 1 commit into
nitrictech:mainfrom
officialasishkumar:feat/azure-storage-replication

Conversation

@officialasishkumar

Copy link
Copy Markdown

Description

The stack's storage account, which holds its buckets, key/value stores and queues, was always deployed as LRS. This adds a stack file option to choose the replication type, for both the Pulumi and Terraform Azure providers:

storage:
  replication-type: GRS
  • It accepts LRS, ZRS, GRS, RAGRS, GZRS or RAGZRS, and defaults to LRS so existing stacks are unaffected.
  • Unknown values are rejected when the stack config is loaded, rather than part way through a deployment.
  • Website storage accounts are unchanged, as their content can be redeployed. Happy to extend the option to them if you'd prefer.
  • ./common is added to the Azure test and test-coverage targets, because they only covered ./runtime/... and the new tests wouldn't have run in CI.
  • generated/stack was regenerated with cdktf-cli@0.20.8, as pinned in the Makefile.

Changing the type on a deployed stack: azurerm recreates the storage account for some changes, which deletes its data (details). The docs warn about this next to the option.

Fixes #777

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Testing

  • Added TestConfigFromAttributes_StorageReplicationType, covering the default, every accepted value and rejected values. The rejection cases fail without the validation.
  • Pulumi: ran createStorageAccount with Pulumi mocks, which gave Standard_LRS and Standard_RAGZRS. I also checked that all six names exist in the pinned pulumi-azure-native-sdk/storage.
  • Terraform: synthesized the regenerated stack module with CDKTF, which gave "storage_replication_type": "GZRS", and terraform validate passes against azurerm 4.20.0.
  • make test-coverage and make lint pass in cloud/azure, cmd/deploy and cmd/deploytf build, and the docs spellcheck passes.

Not tested: a real deployment, as I don't have an Azure subscription to test against.

The stack's storage account, which holds its buckets, key/value stores and
queues, was always deployed with locally redundant storage. Stacks that need
to survive a zone or region outage had no way of asking for more.

Add a storage.replication-type stack file option, accepting LRS, ZRS, GRS,
RAGRS, GZRS or RAGZRS, for both the Pulumi and Terraform providers. It defaults
to LRS so existing stacks are unaffected, and unknown values are rejected when
the stack config is loaded, rather than part way through a deployment.

Website storage accounts are unchanged, as their content is redeployable.

Run the tests in ./common as part of the Azure test targets, otherwise the new
config tests wouldn't run in CI.

Fixes nitrictech#777
@vercel

vercel Bot commented Nov 7, 2026

Copy link
Copy Markdown

@officialasishkumar is attempting to deploy a commit to the Nitric Team on Vercel.

A member of the Team first needs to authorize it.

This branch has not been deployed

No deployments
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.

Make Azure Storage Account Account Replication Type Configurable

1 participant