Skip to content

Commit

Permalink
Suggestions are applied
Browse files Browse the repository at this point in the history
Signed-off-by: philthoennissen <[email protected]>
  • Loading branch information
Phil-Thoennissen committed Nov 12, 2024
1 parent a0b5cae commit 521e7f8
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 42 deletions.
35 changes: 14 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,21 @@ The IaC Launchpad is a collection of essential Azure resources required for mana
<!-- BEGIN_TF_DOCS -->
## Usage

This example demonstrates the usage of the launch-pad module with default settings. It sets up all necessary dependencies, including a resource group, virtual network, subnet to ensure seamless deployment.
This example demonstrates how to deploy the Launchpad in a default scenario.

The two variables, `runner_github_pat` and `runner_github_repo`, should be set at runtime during deployment using the environment variables `TF_VAR_runner_github_pat` and `TF_VAR_runner_github_repo`.

```hcl
resource "azurerm_resource_group" "example" {
location = "germanywestcentral"
name = "rg-example-dev-gwc-01"
variable "my_runner_github_pat" {
type = string
}
resource "azurerm_virtual_network" "example" {
name = "vnet-example-dev-gwc-01"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
address_space = ["10.0.0.0/16"]
variable "my_runner_github_repo" {
type = string
}
resource "azurerm_subnet" "example" {
name = "snet-example-dev-gwc-01"
resource_group_name = azurerm_resource_group.example.name
address_prefixes = ["10.0.2.0/24"]
virtual_network_name = azurerm_virtual_network.example.name
resource "azurerm_resource_group" "example" {
location = "germanywestcentral"
name = "rg-example-dev-gwc-01"
}
module "example" {
Expand All @@ -49,11 +42,11 @@ module "example" {
resource_group_name = azurerm_resource_group.example.name
location = azurerm_resource_group.example.location
runner_github_pat = "github_pat_0000000000000000000000_00000000000000000000000000000000000000000000000000000000000"
runner_github_repo = "owner/repository"
runner_github_pat = var.my_runner_github_pat
runner_github_repo = var.my_runner_github_repo
virtual_network_address_space = azurerm_virtual_network.example.address_space
subnet_address_prefixes = azurerm_subnet.example.address_prefixes
virtual_network_address_space = ["10.0.0.0/16"]
subnet_address_prefixes = ["10.0.2.0/24"]
management_group_names = ["mg-example"]
}
```
Expand Down
4 changes: 3 additions & 1 deletion examples/usage/main.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
This example demonstrates the usage of the launch-pad module with default settings. It sets up all necessary dependencies, including a resource group, virtual network, subnet to ensure seamless deployment.
This example demonstrates how to deploy the Launchpad in a default scenario.

The two variables, `runner_github_pat` and `runner_github_repo`, should be set at runtime during deployment using the environment variables `TF_VAR_runner_github_pat` and `TF_VAR_runner_github_repo`.
31 changes: 11 additions & 20 deletions examples/usage/main.tf
Original file line number Diff line number Diff line change
@@ -1,22 +1,13 @@
resource "azurerm_resource_group" "example" {
location = "germanywestcentral"
name = "rg-example-dev-gwc-01"
variable "my_runner_github_pat" {
type = string
}

resource "azurerm_virtual_network" "example" {
name = "vnet-example-dev-gwc-01"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name

address_space = ["10.0.0.0/16"]
variable "my_runner_github_repo" {
type = string
}

resource "azurerm_subnet" "example" {
name = "snet-example-dev-gwc-01"
resource_group_name = azurerm_resource_group.example.name

address_prefixes = ["10.0.2.0/24"]
virtual_network_name = azurerm_virtual_network.example.name
resource "azurerm_resource_group" "example" {
location = "germanywestcentral"
name = "rg-example-dev-gwc-01"
}

module "example" {
Expand All @@ -25,10 +16,10 @@ module "example" {
resource_group_name = azurerm_resource_group.example.name
location = azurerm_resource_group.example.location

runner_github_pat = "github_pat_0000000000000000000000_00000000000000000000000000000000000000000000000000000000000"
runner_github_repo = "owner/repository"
runner_github_pat = var.my_runner_github_pat
runner_github_repo = var.my_runner_github_repo

virtual_network_address_space = azurerm_virtual_network.example.address_space
subnet_address_prefixes = azurerm_subnet.example.address_prefixes
virtual_network_address_space = ["10.0.0.0/16"]
subnet_address_prefixes = ["10.0.2.0/24"]
management_group_names = ["mg-example"]
}

0 comments on commit 521e7f8

Please sign in to comment.