-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tidy up configuration for acceptance-test server.
Relates to #3.
- Loading branch information
Showing
5 changed files
with
91 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,39 @@ | ||
## Provider configuration | ||
|
||
# The Id of the target Azure subscription. | ||
variable "azure_subscription_id" { sensitive = true } | ||
variable "azure_subscription_id" { } | ||
|
||
# The client Id used to authenticate to Azure. | ||
variable "azure_client_id" { sensitive = true } | ||
variable "azure_client_id" { } | ||
|
||
# The client secret used to authenticate to Azure. | ||
variable "azure_client_secret" { sensitive = true } | ||
variable "azure_client_secret" { } | ||
|
||
# The Id of target Azure AD tenant. | ||
variable "azure_tenant_id" { sensitive = true } | ||
variable "azure_tenant_id" { } | ||
|
||
provider "azurerm" { | ||
subscription_id = "${azure_subscription_id}" | ||
client_id = "${azure_client_id}" | ||
client_secret = "${azure_client_secret}" | ||
tenant_id = "${azure_tenant_id}" | ||
subscription_id = "${var.azure_subscription_id}" | ||
client_id = "${var.azure_client_id}" | ||
client_secret = "${var.azure_client_secret}" | ||
tenant_id = "${var.azure_tenant_id}" | ||
} | ||
|
||
## Common configuration | ||
|
||
# The name of the target Azure region (i.e. datacenter). | ||
variable "region_name" { default = "West Central US" } | ||
variable "region_name" { default = "West US" } | ||
|
||
# The name of the resource group that holds the Octopus server used by acceptance tests. | ||
variable "resource_group_name" { default = "terraform-provider-octopus-acctest" } | ||
|
||
# The name of the storage account where VM disks (etc) are located. | ||
variable "storage_account_name" { default = "tfprovideroctopusacctest" } | ||
|
||
# Used to prevent naming clashes between multiple concurrent deployments. | ||
variable "uniqueness_key" { default = "acctest" } | ||
variable "uniqueness_key" { default = "acctest" } | ||
|
||
# The instance type for the Octopus Server VM. | ||
variable "octo_vm_instance_type" { default = "Standard_A3" } | ||
|
||
# TODO: Define other variables | ||
variable "initial_admin_password" { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,73 @@ | ||
# Public IP address for access to the target VM. | ||
resource "azurerm_public_ip" "primary" { | ||
name = "tf-octo-acc-test-${var.uniqueness_key}-pip" | ||
location = "${var.region_name}" | ||
resource_group_name = "${var.resource_group_name}" | ||
name = "tf-octo-acc-test-${var.uniqueness_key}-pip" | ||
location = "${var.region_name}" | ||
resource_group_name = "${var.resource_group_name}" | ||
|
||
public_ip_address_allocation = "static" | ||
} | ||
|
||
# The primary network for the target VM. | ||
resource "azurerm_virtual_network" "primary" { | ||
name = "tf-octo-acc-test-${var.uniqueness_key}-network" | ||
address_space = ["10.7.0.0/16"] | ||
location = "${var.region_name}" | ||
resource_group_name = "${var.resource_group_name}" | ||
name = "tf-octo-acc-test-${var.uniqueness_key}-network" | ||
address_space = ["10.7.0.0/16"] | ||
location = "${var.region_name}" | ||
resource_group_name = "${var.resource_group_name}" | ||
} | ||
|
||
# The primary subnet for the target VM. | ||
resource "azurerm_subnet" "primary" { | ||
name = "tf-octo-acc-test-${var.uniqueness_key}-subnet" | ||
resource_group_name = "${var.resource_group_name}" | ||
virtual_network_name = "${azurerm_virtual_network.primary.name}" | ||
address_prefix = "10.7.1.0/24" | ||
name = "tf-octo-acc-test-${var.uniqueness_key}-subnet" | ||
resource_group_name = "${var.resource_group_name}" | ||
virtual_network_name = "${azurerm_virtual_network.primary.name}" | ||
address_prefix = "10.7.1.0/24" | ||
} | ||
|
||
# The primary network adapter for the target VM. | ||
resource "azurerm_network_interface" "primary" { | ||
name = "octo-${var.uniqueness_key}-ni" | ||
location = "${var.region_name}" | ||
resource_group_name = "${var.resource_group_name}" | ||
name = "octo-${var.uniqueness_key}-ni" | ||
location = "${var.region_name}" | ||
resource_group_name = "${var.resource_group_name}" | ||
|
||
ip_configuration { | ||
name = "octo-${var.uniqueness_key}-ni-config" | ||
subnet_id = "${azurerm_subnet.primary.id}" | ||
name = "octo-${var.uniqueness_key}-ni-config" | ||
subnet_id = "${azurerm_subnet.primary.id}" | ||
|
||
# Hook up public IP to private IP. | ||
public_ip_address_id = "${azurerm_public_ip.primary.id}" | ||
|
||
private_ip_address_allocation = "dynamic" | ||
public_ip_address_id = "${azurerm_public_ip.primary.id}" | ||
private_ip_address_allocation = "dynamic" | ||
} | ||
} | ||
|
||
# The default network security group. | ||
resource "azurerm_network_security_group" "default" { | ||
name = "octo-${var.uniqueness_key}-default-nsg" | ||
location = "${var.region_name}" | ||
resource_group_name = "${var.resource_group_name}" | ||
|
||
# Remote Desktop | ||
security_rule { | ||
name = "rdp" | ||
priority = 100 | ||
direction = "Inbound" | ||
access = "Allow" | ||
protocol = "Tcp" | ||
source_port_range = "*" | ||
destination_port_range = "3389" | ||
source_address_prefix = "*" | ||
destination_address_prefix = "*" | ||
} | ||
|
||
# WinRM | ||
security_rule { | ||
name = "winrm" | ||
priority = 101 | ||
direction = "Inbound" | ||
access = "Allow" | ||
protocol = "Tcp" | ||
source_port_range = "*" | ||
destination_port_range = "5985" | ||
source_address_prefix = "*" | ||
destination_address_prefix = "*" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters