From 292b1215666bfd6d5ce010072adfc5df09de8dd2 Mon Sep 17 00:00:00 2001 From: Jye Cusch Date: Tue, 11 Mar 2025 15:38:37 +1100 Subject: [PATCH 1/6] docs: add azuretf provider docs --- .../foundations/deployment/index.mdx | 1 + docs/providers/terraform/azure.mdx | 126 ++++++++++++++++++ docs/providers/terraform/index.mdx | 4 +- src/config/index.ts | 4 + 4 files changed, 133 insertions(+), 2 deletions(-) create mode 100644 docs/providers/terraform/azure.mdx diff --git a/docs/get-started/foundations/deployment/index.mdx b/docs/get-started/foundations/deployment/index.mdx index d721d925b..95cfee58c 100644 --- a/docs/get-started/foundations/deployment/index.mdx +++ b/docs/get-started/foundations/deployment/index.mdx @@ -94,6 +94,7 @@ All of the IaC providers generate Terraform code for deployment. This allows you - [AWSTF](/providers/terraform/aws) - [GCPTF](/providers/terraform/gcp) +- [AzureTF](/providers/terraform/azure) An Azure Terraform provider is in development. diff --git a/docs/providers/terraform/azure.mdx b/docs/providers/terraform/azure.mdx new file mode 100644 index 000000000..9b7cf9ad3 --- /dev/null +++ b/docs/providers/terraform/azure.mdx @@ -0,0 +1,126 @@ +--- +description: 'Terraform - Microsoft Azure provider for Nitric' +--- + +# Terraform Azure Provider Overview + +_The officially supported Nitric Terraform Azure Provider._ + +```yaml +provider: nitric/azuretf@latest +``` + + + The Nitric Terraform Azure Provider is currently in preview, it's not + recommended for production deployments. We recommend using the [Pulumi Azure + Providers](/providers/pulumi/azure) for production deployments until the + Terraform provider is stable. + + +## Prerequisites + +The **Terraform CLI** is required to deploy the resulting Terraform Stack that Nitric generates. You can find the installation instructions for Terraform in the [Terraform documentation](https://learn.hashicorp.com/tutorials/terraform/install-cli). + +The provider is built with the [Cloud Development Kit for Terraform (CDKTF)](https://developer.hashicorp.com/terraform/cdktf). Since CDKTF relies on Node.js, you'll need to have Node.js installed, you can read about the full CDKTF prerequisites in the [CDKTF documentation](https://developer.hashicorp.com/terraform/tutorials/cdktf/cdktf-install#prerequisites). + +## Enabling Nitric Terraform Providers + +The Nitric Terraform providers are currently in preview, to enable them you'll need to enable `beta-providers` in your Nitric project. You can do this by adding the following to your project's `nitric.yaml` file: + +```yaml title:nitric.yaml +preview: + - beta-providers +``` + +## Azure Credentials + +The Terraform CLI typically uses standard Azure credential settings to authenticate with Azure. If you've set credentials for the Azure CLI or an Azure SDK previously, these settings should work without modification. + +If you're setting up your credentials for the first time, simply run azure login command and finish the login via your browser. + +```bash +az login +``` + +Verify the Azure CLI install - + +```bash +az -v +``` + + + See [Azure + documentation](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli) + for full details on credentials and configuration. + + +### Azure CLI Installation + +Installing the Azure CLI assists with credentials setup. You can install it using these summarized instructions, for more options see the [Microsoft docs](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli). + + + + + +Download & install the [latest CLI release](https://aka.ms/installazurecliwindows). + + + + + +```bash +curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash +``` + + + + + +```bash +brew update && brew install azure-cli +``` + + + + + +## Locating deployed resources + +This Nitric Azure provider deploys resources for a stack into a resource group dedicated to that stack. You can either use one your already have by configuring it in the stack configuration or let Nitric create one for you. + +Once a stack has been deployed to Azure it's resource group should be present in the [Resource groups](https://portal.azure.com/#blade/HubsExtension/BrowseResourceGroupBlade/resourceType/Microsoft.Resources%2Fsubscriptions%2FresourceGroups) page of the portal. Assuming it was deployed to a subscription you have access to. + + + Resource groups are conventionally named `--` + +In this example the project name is `api-testing` and the stack name is `az`. + + + +![resource group page screen](/docs/images/docs/az-rg.png) + +## Stack Configuration + +```yaml title:nitric.[stack ID].yaml +# The provider to use and it's published version +# See releases: +# https://github.com/nitrictech/nitric/tags +provider: nitric/azuretf@latest + +# The target Azure region to deploy to +# See available regions: +# https://azure.microsoft.com/en-us/explore/global-infrastructure/products-by-region/?products=container-apps +region: my-azure-stack-region + +# Org to associate deployed API Management services with +org: example-org + +# Admin email to associate deployed API Management services with +adminemail: test@example.com +``` + + + Missing something? Let us know by raising an issue in + [GitHub](https://github.com/nitrictech/nitric) or by dropping us a line on + [Discord](https://nitric.io/chat) + diff --git a/docs/providers/terraform/index.mdx b/docs/providers/terraform/index.mdx index 42e6e5790..ffc22a0e2 100644 --- a/docs/providers/terraform/index.mdx +++ b/docs/providers/terraform/index.mdx @@ -4,7 +4,7 @@ description: 'How Nitric integrates with Terraform' # Nitric Terraform Providers -Nitric enables application portability and deployments through pluggable modules known as [providers](/get-started/foundations/deployment#providers). This allows applications to be deployed with many different Infrastructure Automation technologies, including [Terraform](https://www.terraform.io/). Nitric has pre-built providers that use Terraform to deploy to [AWS](/providers/terraform/aws) and [Google Cloud](/providers/terraform/gcp), with Azure support planned. +Nitric enables application portability and deployments through pluggable modules known as [providers](/get-started/foundations/deployment#providers). This allows applications to be deployed with many different Infrastructure Automation technologies, including [Terraform](https://www.terraform.io/). Nitric has pre-built providers that use Terraform to deploy to [AWS](/providers/terraform/aws), [Google Cloud](/providers/terraform/gcp) and [Microsoft Azure](/providers/terraform/azure). All pre-built Terraform providers are [IaC generating @@ -37,7 +37,7 @@ preview: - [AWS](/providers/terraform/aws) - [Google Cloud](/providers/terraform/gcp) -- Azure (Coming Soon) +- [Microsoft Azure](/providers/terraform/azure) ## How Nitric integrates with Terraform diff --git a/src/config/index.ts b/src/config/index.ts index 578e721dd..b28c59d3a 100644 --- a/src/config/index.ts +++ b/src/config/index.ts @@ -267,6 +267,10 @@ export const navigation: NavEntry[] = [ title: 'Google Cloud', href: '/providers/terraform/gcp', }, + { + title: 'Azure', + href: '/providers/terraform/azure', + }, ], }, { From ff118a0f67835f19a624aed4614bb9b51da6ae27 Mon Sep 17 00:00:00 2001 From: Jye Cusch Date: Tue, 11 Mar 2025 15:49:40 +1100 Subject: [PATCH 2/6] add azuretf to dictionary --- dictionary.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/dictionary.txt b/dictionary.txt index 2c220cea1..48fd4022c 100644 --- a/dictionary.txt +++ b/dictionary.txt @@ -254,6 +254,7 @@ deployable VMs CDN subdirectories +AzureTF [0-9]+px ^.+[-:_]\w+$ [a-z]+([A-Z0-9]|[A-Z0-9]\w+) From 4badbddb8145f1eb2494dffb338a4c98d76cc18d Mon Sep 17 00:00:00 2001 From: Jye Cusch Date: Tue, 11 Mar 2025 16:00:38 +1100 Subject: [PATCH 3/6] update azure cli download links Link to the installation docs, instead of the download link --- docs/providers/pulumi/azure.mdx | 2 +- docs/providers/terraform/azure.mdx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/providers/pulumi/azure.mdx b/docs/providers/pulumi/azure.mdx index ad162c59c..a24367950 100644 --- a/docs/providers/pulumi/azure.mdx +++ b/docs/providers/pulumi/azure.mdx @@ -53,7 +53,7 @@ Installing the Azure CLI assists with credentials setup. You can install it usin -Download & install the [latest CLI release](https://aka.ms/installazurecliwindows). +Download & install the [Azure CLI](https://learn.microsoft.com/en-us/cli/azure/install-azure-cli). diff --git a/docs/providers/terraform/azure.mdx b/docs/providers/terraform/azure.mdx index 9b7cf9ad3..0080baa75 100644 --- a/docs/providers/terraform/azure.mdx +++ b/docs/providers/terraform/azure.mdx @@ -62,7 +62,7 @@ Installing the Azure CLI assists with credentials setup. You can install it usin -Download & install the [latest CLI release](https://aka.ms/installazurecliwindows). +Download & install the [Azure CLI](https://learn.microsoft.com/en-us/cli/azure/install-azure-cli). From 37dc3c189f764e50b68228611bfc59f1cf1abf56 Mon Sep 17 00:00:00 2001 From: Jye Cusch Date: Wed, 12 Mar 2025 12:32:27 +1100 Subject: [PATCH 4/6] Update docs/providers/terraform/azure.mdx Co-authored-by: Ryan Cartwright <39504851+HomelessDinosaur@users.noreply.github.com> --- docs/providers/terraform/azure.mdx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/providers/terraform/azure.mdx b/docs/providers/terraform/azure.mdx index 0080baa75..95128e256 100644 --- a/docs/providers/terraform/azure.mdx +++ b/docs/providers/terraform/azure.mdx @@ -117,6 +117,9 @@ org: example-org # Admin email to associate deployed API Management services with adminemail: test@example.com + +# Subscription ID to associate deployed services with +subscription-id: example-subscription-id ``` From 41bced7b61f790d1fff0c9587d53c4504d0767b7 Mon Sep 17 00:00:00 2001 From: Jye Cusch Date: Thu, 13 Mar 2025 13:40:14 +1100 Subject: [PATCH 5/6] Update docs/providers/terraform/azure.mdx Co-authored-by: Rak --- docs/providers/terraform/azure.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/providers/terraform/azure.mdx b/docs/providers/terraform/azure.mdx index 95128e256..1a222e6de 100644 --- a/docs/providers/terraform/azure.mdx +++ b/docs/providers/terraform/azure.mdx @@ -86,7 +86,7 @@ brew update && brew install azure-cli ## Locating deployed resources -This Nitric Azure provider deploys resources for a stack into a resource group dedicated to that stack. You can either use one your already have by configuring it in the stack configuration or let Nitric create one for you. +This Nitric Azure provider deploys resources for a stack into a resource group dedicated to that stack. You can either use one that you already have by configuring it in the stack configuration or let Nitric create one for you. Once a stack has been deployed to Azure it's resource group should be present in the [Resource groups](https://portal.azure.com/#blade/HubsExtension/BrowseResourceGroupBlade/resourceType/Microsoft.Resources%2Fsubscriptions%2FresourceGroups) page of the portal. Assuming it was deployed to a subscription you have access to. From 91f2261e3bba7547f359ffc77499027539957698 Mon Sep 17 00:00:00 2001 From: Jye Cusch Date: Thu, 13 Mar 2025 13:40:42 +1100 Subject: [PATCH 6/6] Update docs/providers/terraform/azure.mdx Co-authored-by: Rak --- docs/providers/terraform/azure.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/providers/terraform/azure.mdx b/docs/providers/terraform/azure.mdx index 1a222e6de..59bd1e7b8 100644 --- a/docs/providers/terraform/azure.mdx +++ b/docs/providers/terraform/azure.mdx @@ -102,7 +102,7 @@ In this example the project name is `api-testing` and the stack name is `az`. ## Stack Configuration ```yaml title:nitric.[stack ID].yaml -# The provider to use and it's published version +# The provider to use and its published version # See releases: # https://github.com/nitrictech/nitric/tags provider: nitric/azuretf@latest