Skip to content

Commit 4832632

Browse files
authored
Merge pull request microsoft#107 from TomArcherMsft/UserStory1977015
User Story 1977015
2 parents 40c33d5 + 1eb5810 commit 4832632

File tree

14 files changed

+78
-51
lines changed

14 files changed

+78
-51
lines changed
Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,16 @@
1-
terraform {
2-
3-
required_version = ">=0.12"
4-
5-
required_providers {
6-
azurerm = {
7-
source = "hashicorp/azurerm"
8-
version = "~>2.0"
9-
}
10-
}
11-
}
12-
13-
provider "azurerm" {
14-
features {}
1+
resource "random_pet" "rg_name" {
2+
prefix = var.resource_group_name_prefix
153
}
164

175
resource "azurerm_resource_group" "rg" {
18-
name = var.resource_group_name
6+
name = random_pet.rg_name.id
197
location = var.resource_group_location
208
}
219

22-
resource "azurerm_attestation_provider" "corpAttestation" {
23-
name = var.attestation_provider_name
24-
resource_group_name = azurerm_resource_group.rg.name
25-
location = azurerm_resource_group.rg.location
10+
resource "azurerm_attestation_provider" "corp_attestation" {
11+
name = var.attestation_provider_name
12+
resource_group_name = azurerm_resource_group.rg.name
13+
location = azurerm_resource_group.rg.location
2614

27-
policy_signing_certificate_data = file(var.policy_file)
15+
policy_signing_certificate_data = file(var.policy_file)
2816
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
output "resource_group_name" {
2+
value = azurerm_resource_group.rg.name
3+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
terraform {
2+
required_version = ">=0.12"
3+
4+
required_providers {
5+
azurerm = {
6+
source = "hashicorp/azurerm"
7+
version = "~>2.0"
8+
}
9+
}
10+
}
11+
12+
provider "azurerm" {
13+
features {}
14+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Azure attestation provider
2+
3+
This template deploys an [Attestation provider](/azure/attestation/overview) on Azure.
4+
5+
## Terraform resource types
6+
7+
- [random_pet](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/pet)
8+
- [azurerm_resource_group](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/resource_group)
9+
- [azurerm_attestation_provider](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/attestation)
10+
11+
## Variables
12+
13+
| Name | Description | Default |
14+
|-|-|-|
15+
| `resource_group_name_prefix` | (Optional) Prefix of the resource group name that's combined with a random ID so name is unique in your Azure subscription.| rg |
16+
| `resource_group_location` | (Optional) Azure Region in which to deploy these resources.| eastus |
17+
| `attestation_provider_name` | Name of the Attestation provider | attestationprovider007 |
18+
19+
## Example
20+
21+
To see how to run this example, see [Configure an Azure Attestation provider using Terraform](https://docs.microsoft.com/en-us/azure/developer/terraform/create-attestation-provider).

quickstart/101-attestation-provider/variables.tf

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
variable "resource_group_name" {
2-
default = "myResourceGroup"
1+
variable "resource_group_name_prefix" {
2+
default = "rg"
3+
description = "Prefix of the resource group name that's combined with a random ID so name is unique in your Azure subscription."
34
}
45

56
variable "resource_group_location" {
6-
default = "eastus"
7+
default = "eastus"
8+
description = "Location of the resource group."
79
}
810

911
variable "policy_file" {
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
resource "random_pet" "rg-name" {
2-
prefix = var.resource_group_name_prefix
1+
resource "random_pet" "rg_name" {
2+
prefix = var.resource_group_name_prefix
33
}
44

55
resource "azurerm_resource_group" "rg" {
6-
name = random_pet.rg-name.id
7-
location = var.resource_group_location
6+
name = random_pet.rg_name.id
7+
location = var.resource_group_location
88
}

quickstart/101-resource-group/output.tf

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
output "resource_group_name" {
2+
value = azurerm_resource_group.rg.name
3+
}

quickstart/101-resource-group/providers.tf

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
terraform {
2-
32
required_version = ">=0.12"
4-
3+
54
required_providers {
65
azurerm = {
7-
source = "hashicorp/azurerm"
6+
source = "hashicorp/azurerm"
87
version = "~>2.0"
98
}
109
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
variable "resource_group_name_prefix" {
2-
default = "rg"
3-
description = "Prefix of the resource group name that's combined with a random ID so name is unique in your Azure subscription."
2+
default = "rg"
3+
description = "Prefix of the resource group name that's combined with a random ID so name is unique in your Azure subscription."
44
}
55

66
variable "resource_group_location" {
7-
default = "eastus"
8-
description = "Location of the resource group."
7+
default = "eastus"
8+
description = "Location of the resource group."
99
}

0 commit comments

Comments
 (0)