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

feat: Introduce subscription_id to examples and update deployment steps #100

Merged
merged 3 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion examples/common_vmseries/.header.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,10 @@ A list of requirements might vary depending on the platform used to deploy the i
- checkout the code locally (if you haven't done so yet)
- copy the [`example.tfvars`](./example.tfvars) file, rename it to `terraform.tfvars` and adjust it to your needs
(take a closer look at the `TODO` markers)
- _(optional)_ authenticate to AzureRM, switch to the Subscription of your choice if necessary
- _(optional)_ authenticate to AzureRM, switch to the Subscription of your choice
- provide `subscription_id` either by creating an environment variable named `ARM_SUBSCRIPTION_ID` with Subscription ID as value
in your shell (recommended option) or by setting the value of `subscription_id` variable within your `tfvars` file (discouraged
option, we don't recommend putting the Subscription ID in clear text inside the code).
- initialize the Terraform module:

```bash
Expand Down
19 changes: 18 additions & 1 deletion examples/common_vmseries/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,10 @@ A list of requirements might vary depending on the platform used to deploy the i
- checkout the code locally (if you haven't done so yet)
- copy the [`example.tfvars`](./example.tfvars) file, rename it to `terraform.tfvars` and adjust it to your needs
(take a closer look at the `TODO` markers)
- _(optional)_ authenticate to AzureRM, switch to the Subscription of your choice if necessary
- _(optional)_ authenticate to AzureRM, switch to the Subscription of your choice
- provide `subscription_id` either by creating an environment variable named `ARM_SUBSCRIPTION_ID` with Subscription ID as value
in your shell (recommended option) or by setting the value of `subscription_id` variable within your `tfvars` file (discouraged
option, we don't recommend putting the Subscription ID in clear text inside the code).
- initialize the Terraform module:

```bash
Expand Down Expand Up @@ -212,6 +215,7 @@ Name | Version | Source | Description

Name | Type | Description
--- | --- | ---
[`subscription_id`](#subscription_id) | `string` | Azure Subscription ID is a required argument since AzureRM provider v4.
[`resource_group_name`](#resource_group_name) | `string` | Name of the Resource Group.
[`region`](#region) | `string` | The Azure region to use.
[`vnets`](#vnets) | `map` | A map defining VNETs.
Expand Down Expand Up @@ -253,6 +257,19 @@ Name | Description

### Required Inputs details

#### subscription_id

Azure Subscription ID is a required argument since AzureRM provider v4.

**Note!** \
Instead of putting the Subscription ID directly in the code, it's recommended to use an environment variable. Create an
environment variable named `ARM_SUBSCRIPTION_ID` with your Subscription ID as value and leave this variable set to `null`.


Type: string

<sup>[back to list](#modules-required-inputs)</sup>

#### resource_group_name

Name of the Resource Group.
Expand Down
2 changes: 2 additions & 0 deletions examples/common_vmseries/example.tfvars
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# GENERAL

subscription_id = null # TODO: Put the Azure Subscription ID here only in case you cannot use an environment variable!

region = "North Europe"
resource_group_name = "transit-vnet-common"
name_prefix = "example-"
Expand Down
11 changes: 11 additions & 0 deletions examples/common_vmseries/variables.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# GENERAL

variable "subscription_id" {
description = <<-EOF
Azure Subscription ID is a required argument since AzureRM provider v4.

**Note!** \
Instead of putting the Subscription ID directly in the code, it's recommended to use an environment variable. Create an
environment variable named `ARM_SUBSCRIPTION_ID` with your Subscription ID as value and leave this variable set to `null`.
EOF
type = string
}

variable "name_prefix" {
description = <<-EOF
A prefix that will be added to all created resources.
Expand Down
1 change: 1 addition & 0 deletions examples/common_vmseries/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ terraform {
}

provider "azurerm" {
subscription_id = var.subscription_id
features {
resource_group {
prevent_deletion_if_contains_resources = false
Expand Down
5 changes: 4 additions & 1 deletion examples/common_vmseries_and_autoscale/.header.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,10 @@ A non-platform requirement would be a running Panorama instance. For full automa
- copy the [`example.tfvars`](./example.tfvars) file, rename it to `terraform.tfvars` and adjust it to your needs (take a closer
look at the `TODO` markers). If you already have a configured Panorama (with at least minimum configuration described above) you
might want to also adjust the `bootstrap_options` for the scale set [`common`](./example.tfvars#L224).
- _(optional)_ authenticate to AzureRM, switch to the Subscription of your choice if necessary
- _(optional)_ authenticate to AzureRM, switch to the Subscription of your choice
- provide `subscription_id` either by creating an environment variable named `ARM_SUBSCRIPTION_ID` with Subscription ID as value
in your shell (recommended option) or by setting the value of `subscription_id` variable within your `tfvars` file (discouraged
option, we don't recommend putting the Subscription ID in clear text inside the code).
- initialize the Terraform module:

```bash
Expand Down
19 changes: 18 additions & 1 deletion examples/common_vmseries_and_autoscale/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,10 @@ A non-platform requirement would be a running Panorama instance. For full automa
- copy the [`example.tfvars`](./example.tfvars) file, rename it to `terraform.tfvars` and adjust it to your needs (take a closer
look at the `TODO` markers). If you already have a configured Panorama (with at least minimum configuration described above) you
might want to also adjust the `bootstrap_options` for the scale set [`common`](./example.tfvars#L224).
- _(optional)_ authenticate to AzureRM, switch to the Subscription of your choice if necessary
- _(optional)_ authenticate to AzureRM, switch to the Subscription of your choice
- provide `subscription_id` either by creating an environment variable named `ARM_SUBSCRIPTION_ID` with Subscription ID as value
in your shell (recommended option) or by setting the value of `subscription_id` variable within your `tfvars` file (discouraged
option, we don't recommend putting the Subscription ID in clear text inside the code).
- initialize the Terraform module:

```bash
Expand Down Expand Up @@ -239,6 +242,7 @@ Name | Version | Source | Description

Name | Type | Description
--- | --- | ---
[`subscription_id`](#subscription_id) | `string` | Azure Subscription ID is a required argument since AzureRM provider v4.
[`resource_group_name`](#resource_group_name) | `string` | Name of the Resource Group.
[`region`](#region) | `string` | The Azure region to use.
[`vnets`](#vnets) | `map` | A map defining VNETs.
Expand Down Expand Up @@ -276,6 +280,19 @@ Name | Description

### Required Inputs details

#### subscription_id

Azure Subscription ID is a required argument since AzureRM provider v4.

**Note!** \
Instead of putting the Subscription ID directly in the code, it's recommended to use an environment variable. Create an
environment variable named `ARM_SUBSCRIPTION_ID` with your Subscription ID as value and leave this variable set to `null`.


Type: string

<sup>[back to list](#modules-required-inputs)</sup>

#### resource_group_name

Name of the Resource Group.
Expand Down
2 changes: 2 additions & 0 deletions examples/common_vmseries_and_autoscale/example.tfvars
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# GENERAL

subscription_id = null # TODO: Put the Azure Subscription ID here only in case you cannot use an environment variable!

region = "North Europe"
resource_group_name = "autoscale-common"
name_prefix = "example-"
Expand Down
11 changes: 11 additions & 0 deletions examples/common_vmseries_and_autoscale/variables.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# GENERAL

variable "subscription_id" {
description = <<-EOF
Azure Subscription ID is a required argument since AzureRM provider v4.

**Note!** \
Instead of putting the Subscription ID directly in the code, it's recommended to use an environment variable. Create an
environment variable named `ARM_SUBSCRIPTION_ID` with your Subscription ID as value and leave this variable set to `null`.
EOF
type = string
}

variable "name_prefix" {
description = <<-EOF
A prefix that will be added to all created resources.
Expand Down
1 change: 1 addition & 0 deletions examples/common_vmseries_and_autoscale/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ terraform {
}

provider "azurerm" {
subscription_id = var.subscription_id
features {
virtual_machine_scale_set {
# Make upgrade_policy_mode = "Manual" actually work. On a default setting:
Expand Down
5 changes: 4 additions & 1 deletion examples/dedicated_vmseries/.header.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,10 @@ A list of requirements might vary depending on the platform used to deploy the i
look at the `TODO` markers)
- copy the [`init-cfg.sample.txt`](./files/init-cfg.sample.txt) to `init-cfg.txt` and fill it out with required bootstrap
parameters (see this [documentation](https://docs.paloaltonetworks.com/vm-series/9-1/vm-series-deployment/bootstrap-the-vm-series-firewall/create-the-init-cfgtxt-file/init-cfgtxt-file-components#id07933d91-15be-414d-bc8d-f2a5f3d8df6b) for details)
- _(optional)_ authenticate to AzureRM, switch to the Subscription of your choice if necessary
- _(optional)_ authenticate to AzureRM, switch to the Subscription of your choice
- provide `subscription_id` either by creating an environment variable named `ARM_SUBSCRIPTION_ID` with Subscription ID as value
in your shell (recommended option) or by setting the value of `subscription_id` variable within your `tfvars` file (discouraged
option, we don't recommend putting the Subscription ID in clear text inside the code).
- initialize the Terraform module:

```bash
Expand Down
19 changes: 18 additions & 1 deletion examples/dedicated_vmseries/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,10 @@ A list of requirements might vary depending on the platform used to deploy the i
look at the `TODO` markers)
- copy the [`init-cfg.sample.txt`](./files/init-cfg.sample.txt) to `init-cfg.txt` and fill it out with required bootstrap
parameters (see this [documentation](https://docs.paloaltonetworks.com/vm-series/9-1/vm-series-deployment/bootstrap-the-vm-series-firewall/create-the-init-cfgtxt-file/init-cfgtxt-file-components#id07933d91-15be-414d-bc8d-f2a5f3d8df6b) for details)
- _(optional)_ authenticate to AzureRM, switch to the Subscription of your choice if necessary
- _(optional)_ authenticate to AzureRM, switch to the Subscription of your choice
- provide `subscription_id` either by creating an environment variable named `ARM_SUBSCRIPTION_ID` with Subscription ID as value
in your shell (recommended option) or by setting the value of `subscription_id` variable within your `tfvars` file (discouraged
option, we don't recommend putting the Subscription ID in clear text inside the code).
- initialize the Terraform module:

```bash
Expand Down Expand Up @@ -216,6 +219,7 @@ Name | Version | Source | Description

Name | Type | Description
--- | --- | ---
[`subscription_id`](#subscription_id) | `string` | Azure Subscription ID is a required argument since AzureRM provider v4.
[`resource_group_name`](#resource_group_name) | `string` | Name of the Resource Group.
[`region`](#region) | `string` | The Azure region to use.
[`vnets`](#vnets) | `map` | A map defining VNETs.
Expand Down Expand Up @@ -257,6 +261,19 @@ Name | Description

### Required Inputs details

#### subscription_id

Azure Subscription ID is a required argument since AzureRM provider v4.

**Note!** \
Instead of putting the Subscription ID directly in the code, it's recommended to use an environment variable. Create an
environment variable named `ARM_SUBSCRIPTION_ID` with your Subscription ID as value and leave this variable set to `null`.


Type: string

<sup>[back to list](#modules-required-inputs)</sup>

#### resource_group_name

Name of the Resource Group.
Expand Down
2 changes: 2 additions & 0 deletions examples/dedicated_vmseries/example.tfvars
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# GENERAL

subscription_id = null # TODO: Put the Azure Subscription ID here only in case you cannot use an environment variable!

region = "North Europe"
resource_group_name = "transit-vnet-dedicated"
name_prefix = "example-"
Expand Down
11 changes: 11 additions & 0 deletions examples/dedicated_vmseries/variables.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# GENERAL

variable "subscription_id" {
description = <<-EOF
Azure Subscription ID is a required argument since AzureRM provider v4.

**Note!** \
Instead of putting the Subscription ID directly in the code, it's recommended to use an environment variable. Create an
environment variable named `ARM_SUBSCRIPTION_ID` with your Subscription ID as value and leave this variable set to `null`.
EOF
type = string
}

variable "name_prefix" {
description = <<-EOF
A prefix that will be added to all created resources.
Expand Down
1 change: 1 addition & 0 deletions examples/dedicated_vmseries/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ terraform {
}

provider "azurerm" {
subscription_id = var.subscription_id
features {
resource_group {
prevent_deletion_if_contains_resources = false
Expand Down
5 changes: 4 additions & 1 deletion examples/dedicated_vmseries_and_autoscale/.header.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,10 @@ requirements:
look at the `TODO` markers). If you already have a configured Panorama (with at least minimum configuration described above) you
might want to also adjust the `bootstrap_options` for each scale set ([inbound](./example.tfvars#L205) and
[obew](./example.tfvars#L249) separately).
- _(optional)_ authenticate to AzureRM, switch to the Subscription of your choice if necessary
- _(optional)_ authenticate to AzureRM, switch to the Subscription of your choice
- provide `subscription_id` either by creating an environment variable named `ARM_SUBSCRIPTION_ID` with Subscription ID as value
in your shell (recommended option) or by setting the value of `subscription_id` variable within your `tfvars` file (discouraged
option, we don't recommend putting the Subscription ID in clear text inside the code).
- initialize the Terraform module:

```bash
Expand Down
19 changes: 18 additions & 1 deletion examples/dedicated_vmseries_and_autoscale/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,10 @@ requirements:
look at the `TODO` markers). If you already have a configured Panorama (with at least minimum configuration described above) you
might want to also adjust the `bootstrap_options` for each scale set ([inbound](./example.tfvars#L205) and
[obew](./example.tfvars#L249) separately).
- _(optional)_ authenticate to AzureRM, switch to the Subscription of your choice if necessary
- _(optional)_ authenticate to AzureRM, switch to the Subscription of your choice
- provide `subscription_id` either by creating an environment variable named `ARM_SUBSCRIPTION_ID` with Subscription ID as value
in your shell (recommended option) or by setting the value of `subscription_id` variable within your `tfvars` file (discouraged
option, we don't recommend putting the Subscription ID in clear text inside the code).
- initialize the Terraform module:

```bash
Expand Down Expand Up @@ -233,6 +236,7 @@ Name | Version | Source | Description

Name | Type | Description
--- | --- | ---
[`subscription_id`](#subscription_id) | `string` | Azure Subscription ID is a required argument since AzureRM provider v4.
[`resource_group_name`](#resource_group_name) | `string` | Name of the Resource Group.
[`region`](#region) | `string` | The Azure region to use.
[`vnets`](#vnets) | `map` | A map defining VNETs.
Expand Down Expand Up @@ -270,6 +274,19 @@ Name | Description

### Required Inputs details

#### subscription_id

Azure Subscription ID is a required argument since AzureRM provider v4.

**Note!** \
Instead of putting the Subscription ID directly in the code, it's recommended to use an environment variable. Create an
environment variable named `ARM_SUBSCRIPTION_ID` with your Subscription ID as value and leave this variable set to `null`.


Type: string

<sup>[back to list](#modules-required-inputs)</sup>

#### resource_group_name

Name of the Resource Group.
Expand Down
2 changes: 2 additions & 0 deletions examples/dedicated_vmseries_and_autoscale/example.tfvars
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# GENERAL

subscription_id = null # TODO: Put the Azure Subscription ID here only in case you cannot use an environment variable!

region = "North Europe"
resource_group_name = "autoscale-dedicated"
name_prefix = "example-"
Expand Down
11 changes: 11 additions & 0 deletions examples/dedicated_vmseries_and_autoscale/variables.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# GENERAL

variable "subscription_id" {
description = <<-EOF
Azure Subscription ID is a required argument since AzureRM provider v4.

**Note!** \
Instead of putting the Subscription ID directly in the code, it's recommended to use an environment variable. Create an
environment variable named `ARM_SUBSCRIPTION_ID` with your Subscription ID as value and leave this variable set to `null`.
EOF
type = string
}

variable "name_prefix" {
description = <<-EOF
A prefix that will be added to all created resources.
Expand Down
1 change: 1 addition & 0 deletions examples/dedicated_vmseries_and_autoscale/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ terraform {
}

provider "azurerm" {
subscription_id = var.subscription_id
features {
virtual_machine_scale_set {
# Make upgrade_policy_mode = "Manual" actually work. On a default setting:
Expand Down
Loading
Loading