Compare commits

..

No commits in common. "master" and "users/GitHubPolicyService/46ac6b72-fb6d-4399-a02a-714c519189f1" have entirely different histories.

651 changed files with 5459 additions and 130639 deletions

View File

@ -1,26 +0,0 @@
{
"image": "mcr.microsoft.com/azterraform:latest",
"runArgs": [
"--cap-add=SYS_PTRACE",
"--security-opt",
"seccomp=unconfined",
"--init",
"--network=host"
],
"mounts": [ "source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind" ],
"customizations": {
"vscode": {
"settings": {
"go.toolsManagement.checkForUpdates": "local",
"go.useLanguageServer": true,
"go.goroot": "/usr/local/go"
},
"extensions": [
"hashicorp.terraform",
"golang.Go"
]
}
}
}

2
.github/CODEOWNERS vendored
View File

@ -1,2 +0,0 @@
.github/workflows/ @lonegunmanb @TomArcherMsft
.github/CODEOWNERS @lonegunmanb @TomArcherMsft

View File

@ -1,56 +0,0 @@
name: E2E Test Check
on:
pull_request:
types: ['opened', 'synchronize']
paths:
- '.github/**'
- '.github/workflows/**'
- 'quickstart/**'
- 'test/**'
- 'test/e2e/**'
permissions:
actions: write
contents: read
id-token: write
jobs:
e2e-check:
runs-on: ubuntu-latest
environment:
name: test
steps:
- name: Checking for Fork
shell: pwsh
run: |
$isFork = "${{ github.event.pull_request.head.repo.fork }}"
if($isFork -eq "true") {
echo "### WARNING: This workflow is disabled for forked repositories. Please follow the [release branch process](https://azure.github.io/Azure-Verified-Modules/contributing/terraform/terraform-contribution-flow/#5-create-a-pull-request-to-the-upstream-repository) if end to end tests are required." >> $env:GITHUB_STEP_SUMMARY
}
- name: checkout
if: github.event.pull_request.head.repo.fork == false
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 #v3.6.0
- name: Get changed files
if: github.event.pull_request.head.repo.fork == false
id: changed-files
uses: tj-actions/changed-files@v45
with:
dir_names: true
separator: ","
dir_names_include_files: "quickstart/*"
files: "quickstart/**"
files_ignore: "**/TestRecord.md"
dir_names_max_depth: 2
- name: test pr
if: github.event.pull_request.head.repo.fork == false
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
echo "change files" $ALL_CHANGED_FILES
export ARM_OIDC_REQUEST_TOKEN=$ACTIONS_ID_TOKEN_REQUEST_TOKEN
export ARM_OIDC_REQUEST_URL=$ACTIONS_ID_TOKEN_REQUEST_URL
export ARM_SUBSCRIPTION_ID=${{ secrets.ARM_SUBSCRIPTION_ID }}
export ARM_TENANT_ID=${{ secrets.ARM_TENANT_ID }}
export ARM_CLIENT_ID=${{ secrets.ARM_CLIENT_ID }}
export PACKER_VERSION=${{ vars.PACKER_VERSION }}
export CHANGED_FOLDERS="${{ steps.changed-files.outputs.all_changed_files }}"
docker run --rm -v $(pwd):/src -w /src/test --network=host -e ARM_SUBSCRIPTION_ID -e ARM_TENANT_ID -e ARM_CLIENT_ID -e ARM_OIDC_REQUEST_TOKEN -e ARM_OIDC_REQUEST_URL -e ARM_USE_OIDC=true -e CHANGED_FOLDERS mcr.microsoft.com/azterraform:latest sh -c "pkenv install $PACKER_VERSION && go mod tidy && go test -timeout=360m -v ./e2e"

View File

@ -1,31 +0,0 @@
name: Pre Pull Request Check
on:
pull_request:
types: [ 'opened', 'synchronize' ]
paths:
- '.github/**'
- '.github/workflows/**'
- 'quickstart/**'
jobs:
prepr-check:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 #v3.6.0
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v45
with:
dir_names: true
separator: ","
dir_names_include_files: "quickstart/*"
files: "quickstart/**"
dir_names_max_depth: 2
- name: pr-check
run: |
export CHANGED_FOLDERS="${{ steps.changed-files.outputs.all_changed_files }}"
if [ -z "${{ github.event.number }}" ]; then
CHANGED_FOLDERS=$(find ./quickstart -maxdepth 1 -mindepth 1 -type d | tr '\n' ',')
fi
docker run --rm -v $(pwd):/src -w /src -e CHANGED_FOLDERS mcr.microsoft.com/azterraform:latest make pr-check

View File

@ -1,43 +0,0 @@
name: Weekly E2E Test Check
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * 0'
permissions:
actions: write
contents: write
id-token: write
jobs:
full-e2e-check:
runs-on: ubuntu-latest
timeout-minutes: 1440
environment:
name: crontests
steps:
- name: checkout
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 #v3.6.0
- name: test all examples
continue-on-error: true
timeout-minutes: 1440
run: |
git config --global --add safe.directory '*'
export ARM_OIDC_REQUEST_TOKEN=$ACTIONS_ID_TOKEN_REQUEST_TOKEN
export ARM_OIDC_REQUEST_URL=$ACTIONS_ID_TOKEN_REQUEST_URL
export ARM_SUBSCRIPTION_ID=${{ secrets.ARM_SUBSCRIPTION_ID }}
export ARM_TENANT_ID=${{ secrets.ARM_TENANT_ID }}
export ARM_CLIENT_ID=${{ secrets.ARM_CLIENT_ID_CRONTEST }}
export PACKER_VERSION=${{ vars.PACKER_VERSION }}
docker run --rm -v $(pwd):/src -w /src/test --network=host -e ARM_SUBSCRIPTION_ID -e ARM_CLIENT_ID -e ARM_TENANT_ID -e ARM_OIDC_REQUEST_TOKEN -e ARM_OIDC_REQUEST_URL -e ARM_USE_OIDC=true -e CHANGED_FOLDERS mcr.microsoft.com/azterraform sh -c "pkenv install $PACKER_VERSION && go mod tidy && go test -timeout=1440m -parallel 10 -v ./e2e"
- name: Update
run: |
docker run --rm -v $(pwd):/src -w /src mcr.microsoft.com/azterraform sh scripts/update-test-record.sh
cd .git
sudo chmod -R a+rwX .
sudo find . -type d -exec chmod g+s '{}' +
- name: Commit & Push changes
uses: actions-js/push@156f2b10c3aa000c44dbe75ea7018f32ae999772 #v1.4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
message: 'Update TestRecord'
branch: ${{ env.default_branch }}

10
.gitignore vendored
View File

@ -10,13 +10,3 @@ _repo.*/
.ionide/ .ionide/
.openpublishing.buildcore.ps1.vscode/ .openpublishing.buildcore.ps1.vscode/
*.DS_Store *.DS_Store
.terraform
.terraform.lock.hcl
*.tmp
go.sum
TestRecord
**/TestRecord.md.tmp
terraform.tfstate
terraform.tfstate.backup

View File

@ -1,10 +0,0 @@
# Microsoft Open Source Code of Conduct
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
Resources:
- [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/)
- [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
- Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns
- Employees can reach out at [aka.ms/opensource/moderation-support](https://aka.ms/opensource/moderation-support)

View File

@ -1,90 +0,0 @@
fmt:
@echo "==> Fixing source code with gofmt..."
# This logic should match the search logic in scripts/gofmtcheck.sh
find . -name '*.go' | grep -v vendor | xargs gofmt -s -w
fumpt:
@echo "==> Fixing source code with Gofumpt..."
# This logic should match the search logic in scripts/gofmtcheck.sh
find . -name '*.go' | grep -v vendor | xargs gofumpt -w
gosec:
@echo "==> Checking go code with gosec..."
cd test && gosec -tests ./...
tffmt:
@echo "==> Formatting terraform code..."
terraform fmt -recursive
tffmtcheck:
@sh "$(CURDIR)/scripts/terraform-fmt.sh"
tfvalidatecheck:
@sh "$(CURDIR)/scripts/terraform-validate.sh"
terrafmtcheck:
@sh "$(CURDIR)/scripts/terrafmt-check.sh"
gofmtcheck:
@sh "$(CURDIR)/scripts/gofmtcheck.sh"
@sh "$(CURDIR)/scripts/fumptcheck.sh"
golint:
@sh "$(CURDIR)/scripts/run-golangci-lint.sh"
tflint:
@sh "$(CURDIR)/scripts/run-tflint.sh"
lint: golint tflint gosec
checkovcheck:
@sh "$(CURDIR)/scripts/checkovcheck.sh"
checkovplancheck:
@sh "$(CURDIR)/scripts/checkovplancheck.sh"
fmtcheck: tfvalidatecheck # tffmtcheck terrafmtcheck
pr-check: fmtcheck
unit-test:
@sh "$(CURDIR)/scripts/run-unit-test.sh"
e2e-test:
@sh "$(CURDIR)/scripts/run-e2e-test.sh"
version-upgrade-test:
@sh "$(CURDIR)/scripts/version-upgrade-test.sh"
terrafmt:
@echo "==> Fixing test and document terraform blocks code with terrafmt..."
@find . -name '*.md' -o -name "*.go" | grep -v -e '.github' -e '.terraform' -e 'vendor' | while read f; do terrafmt fmt -f $$f; done
pre-commit: tffmt terrafmt depsensure fmt fumpt generate
depsensure:
@sh "$(CURDIR)/scripts/deps-ensure.sh"
depscheck:
@sh "$(CURDIR)/scripts/deps-check.sh"
generate:
@echo "--> Generating doc"
@rm -f .terraform.lock.hcl
@terraform-docs markdown table --output-file README.md --output-mode inject ./
@markdown-table-formatter README.md
gencheck:
@echo "==> Generating..."
@cp README.md README-generated.md
@terraform-docs markdown table --output-file README-generated.md --output-mode inject ./
@markdown-table-formatter README-generated.md
@echo "==> Comparing generated code to committed code..."
@diff -q README.md README-generated.md || \
(echo; echo "Unexpected difference in generated document. Run 'make pre-commit' to update the generated document and commit."; exit 1)
test: fmtcheck
@TEST=$(TEST) ./scripts/run-gradually-deprecated.sh
@TEST=$(TEST) ./scripts/run-test.sh
.PHONY: fmt fmtcheck pr-check

View File

@ -44,7 +44,7 @@ If you are running Windows, then you need to install Git Bash and Make for Windo
First, go to the [AzureRM Terraform provider](https://github.com/terraform-providers/terraform-provider-azurerm) project page and fork the repository into your GitHub account. First, go to the [AzureRM Terraform provider](https://github.com/terraform-providers/terraform-provider-azurerm) project page and fork the repository into your GitHub account.
As the provider uses go modules, you can clone the repository in any path. Once done, you need to clone your fork into the `$GOPATH/src/github.com/terraform-providers/terraform-provider-azurerm` folder.
## Build the sources ## Build the sources
@ -73,9 +73,6 @@ If the third-party plugin folder is empty, the init operation will download the
More information [here](https://www.terraform.io/docs/extend/how-terraform-works.html#plugin-locations). More information [here](https://www.terraform.io/docs/extend/how-terraform-works.html#plugin-locations).
`terraform init` will look for the providers in the folder where the `.tf` files are located, so it is possible to just copy the provider from `$GOPATH/bin` to your current folder and it will be used instead of getting downloaded.
## Debug the AzureRM provider using Visual Studio Code and Delve ## Debug the AzureRM provider using Visual Studio Code and Delve
It is possible to use Visual Studio Code and Delve (the Golang debugger) to debug the AzureRM provider. It is possible to use Visual Studio Code and Delve (the Golang debugger) to debug the AzureRM provider.
@ -134,20 +131,6 @@ ARM_TEST_LOCATION_ALT=<AZURE_LOCATION_2>
TF_ACC=1 TF_ACC=1
``` ```
If you would preffer to use the UI to launch the tests, it is aso possible to specify the environment variables used by vscode integrated testing by modifying the settings.json. Two options are available
* Use the built in variables definition:
```json
"go.testEnvVars": {
"ARM_CLIENT_ID" : "<YOUR_SERVICE_PRINCIPAL_CLIENT_ID>"
...
...
},
```
* Use the contents of a file as `private.env`
```json
"go.testEnvFile": "${workspaceRoot}/.vscode/private.env"
```
*Note: it is possible to customize the logging level of Terraform. It might be super useful in some situations. It can be done by setting the `TF_LOG` environment variable. Refer to [the official debugging documentation](https://www.terraform.io/docs/internals/debugging.html) for more details.* *Note: it is possible to customize the logging level of Terraform. It might be super useful in some situations. It can be done by setting the `TF_LOG` environment variable. Refer to [the official debugging documentation](https://www.terraform.io/docs/internals/debugging.html) for more details.*
Once done, you can just press F5 and the debug will start! You can place breakpoints in your code to do step by step debugging: Once done, you can just press F5 and the debug will start! You can place breakpoints in your code to do step by step debugging:

File diff suppressed because it is too large Load Diff

View File

@ -1,36 +0,0 @@
resource "random_pet" "rg_name" {
prefix = var.resource_group_name_prefix
}
resource "azurerm_resource_group" "rg" {
name = random_pet.rg_name.id
location = var.resource_group_location
}
resource "random_string" "container_name" {
length = 25
lower = true
upper = false
special = false
}
resource "azurerm_container_group" "container" {
name = "${var.container_group_name_prefix}-${random_string.container_name.result}"
location = azurerm_resource_group.rg.location
resource_group_name = azurerm_resource_group.rg.name
ip_address_type = "Public"
os_type = "Linux"
restart_policy = var.restart_policy
container {
name = "${var.container_name_prefix}-${random_string.container_name.result}"
image = var.image
cpu = var.cpu_cores
memory = var.memory_in_gb
ports {
port = var.port
protocol = "TCP"
}
}
}

View File

@ -1,3 +0,0 @@
output "container_ipv4_address" {
value = azurerm_container_group.container.ip_address
}

View File

@ -1,16 +0,0 @@
terraform {
required_version = ">=1.0"
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~>3.0"
}
random = {
source = "hashicorp/random"
version = "~>3.0"
}
}
}
provider "azurerm" {
features {}
}

View File

@ -1,26 +0,0 @@
# Azure Container Instance with public IP
This template deploys an Azure Container Instance with a public IP address.
## Terraform resource types
- [random_pet](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/pet)
- [azurerm_resource_group](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/resource_group)
- [random_string](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/string)
- [azurerm_container_group](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/container_group)
## Variables
| Name | Description | Default |
|-|-|-|
| `resource_group_name_prefix` | Prefix of the resource group name that's combined with a random ID so name is unique in your Azure subscription. | rg |
| `resource_group_location` | Location of the resource group. | eastus |
| `image` | Container image to deploy. | mcr.microsoft.com/azuredocs/aci-helloworld" |
| `port` | Port to open on the container and the public IP address. | 80 |
| `cpu_cores` | Quantity of CPU cores to allocate to the container. | 1 |
| `memory_in_gb` | Amount of memory to allocate to the container in gigabytes. | 2 |
| `restart_policy` | Behavior of Azure runtime if container has stopped. | Always |
## Example
To see how to run this example, see [Create an Azure Container Instance with a public IP address using Terraform](https://learn.microsoft.com/azure/container-instances/container-instances-quickstart-terraform).

View File

@ -1,57 +0,0 @@
variable "resource_group_location" {
type = string
default = "eastus"
description = "Location for all resources."
}
variable "resource_group_name_prefix" {
type = string
default = "rg"
description = "Prefix of the resource group name that's combined with a random value so name is unique in your Azure subscription."
}
variable "container_group_name_prefix" {
type = string
description = "Prefix of the container group name that's combined with a random value so name is unique in your Azure subscription."
default = "acigroup"
}
variable "container_name_prefix" {
type = string
description = "Prefix of the container name that's combined with a random value so name is unique in your Azure subscription."
default = "aci"
}
variable "image" {
type = string
description = "Container image to deploy. Should be of the form repoName/imagename:tag for images stored in public Docker Hub, or a fully qualified URI for other registries. Images from private registries require additional registry credentials."
default = "mcr.microsoft.com/azuredocs/aci-helloworld"
}
variable "port" {
type = number
description = "Port to open on the container and the public IP address."
default = 80
}
variable "cpu_cores" {
type = number
description = "The number of CPU cores to allocate to the container."
default = 1
}
variable "memory_in_gb" {
type = number
description = "The amount of memory to allocate to the container in gigabytes."
default = 2
}
variable "restart_policy" {
type = string
description = "The behavior of Azure runtime if container has stopped."
default = "Always"
validation {
condition = contains(["Always", "Never", "OnFailure"], var.restart_policy)
error_message = "The restart_policy must be one of the following: Always, Never, OnFailure."
}
}

View File

@ -1,45 +0,0 @@
# Azure AI Studio
This deployment configuration specifies an [Azure AI hub](https://learn.microsoft.com/en-us/azure/ai-studio/concepts/ai-resources),
and its associated resources including Azure Key Vault, Azure Storage. You can optionally provision and attach Azure Application Insights and Azure Container Registry.
This configuration describes the minimal set of resources you require to get started with Azure AI Studio.
## Resources
| Terraform Resource Type | Description |
| - | - |
| `azurerm_resource_group` | The resource group all resources get deployed into. |
| `azurerm_key_vault` | An Azure Key Vault instance associated to the Azure Machine Learning workspace. |
| `azurerm_storage_account` | An Azure Storage instance associated to the Azure Machine Learning workspace. |
| `azurerm_application_insights` | An Azure Application Insights instance associated to the Azure Machine Learning workspace. |
| `azurerm_container_registry` | An Azure Container Registry instance associated to the Azure Machine Learning workspace. |
## Variables
| Name | Description | Default |
| ---- | ----------- | ------- |
| `resource_group_name_prefix` | Prefix of the resource group name that's combined with a random ID so name is unique in your Azure subscription. | rg |
| `resource_group_location` | Location of the resource group. | eastus |
| `prefix` | This variable is used to name the hub, project, and dependent resources. | ai |
| `sku` | The SKU for AI Services resources | S0
## Usage
After git cloning the repo, run the following commands after having docker running on your machine.
```bash
terraform init
az login
terraform plan -out demo.tfplan
terraform apply "demo.tfplan"
```
## Common mistakes
1. Make sure docker is running
1. Make sure to have logged into your Azure Subscription by running ```az login```.
1. Ensure that you have the correct RBAC permissions for in your subscription, hub, and project.

View File

@ -1,324 +0,0 @@
## 03 Nov 24 02:22 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/azure/azapi v2.0.1
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 27 Oct 24 00:30 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/azure/azapi v2.0.1
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 20 Oct 24 02:31 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/azure/azapi v1.15.0
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 13 Oct 24 02:02 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/azure/azapi v1.15.0
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 06 Oct 24 00:55 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/azure/azapi v1.15.0
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 05:10 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/azure/azapi v1.15.0
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 02:51 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/azure/azapi v1.15.0
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 00:11 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/azure/azapi v1.15.0
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 27 Sep 24 07:07 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/azure/azapi v1.15.0
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 22 Sep 24 00:15 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/azure/azapi v1.15.0
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 18 Sep 24 03:30 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/azure/azapi v1.15.0
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 08 Sep 24 02:33 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/azure/azapi v1.15.0
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.2
### Error
---
## 01 Sep 24 02:35 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/azure/azapi v1.15.0
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.2
### Error
---
## 25 Aug 24 02:22 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/azure/azapi v1.15.0
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.2
### Error
---
## 18 Aug 24 02:25 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/azure/azapi v1.15.0
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.2
### Error
---
## 11 Aug 24 02:09 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/azure/azapi v1.14.0
+ provider registry.terraform.io/hashicorp/azurerm v3.115.0
+ provider registry.terraform.io/hashicorp/random v3.6.2
### Error
---
## 04 Aug 24 02:13 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/azure/azapi v1.14.0
+ provider registry.terraform.io/hashicorp/azurerm v3.114.0
+ provider registry.terraform.io/hashicorp/random v3.6.2
### Error
---
## 01 Aug 24 03:14 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/azure/azapi v1.14.0
+ provider registry.terraform.io/hashicorp/azurerm v3.113.0
+ provider registry.terraform.io/hashicorp/random v3.6.2
### Error
---

View File

@ -1,160 +0,0 @@
resource "random_pet" "rg_name" {
prefix = var.resource_group_name_prefix
}
// RESOURCE GROUP
resource "azurerm_resource_group" "rg" {
location = var.resource_group_location
name = random_pet.rg_name.id
}
data "azurerm_client_config" "current" {
}
// STORAGE ACCOUNT
resource "azurerm_storage_account" "default" {
name = "${var.prefix}storage${random_string.suffix.result}"
location = azurerm_resource_group.rg.location
resource_group_name = azurerm_resource_group.rg.name
account_tier = "Standard"
account_replication_type = "GRS"
allow_nested_items_to_be_public = false
}
// KEY VAULT
resource "azurerm_key_vault" "default" {
name = "${var.prefix}keyvault${random_string.suffix.result}"
location = azurerm_resource_group.rg.location
resource_group_name = azurerm_resource_group.rg.name
tenant_id = data.azurerm_client_config.current.tenant_id
sku_name = "standard"
purge_protection_enabled = false
}
// AzAPI AIServices
resource "azapi_resource" "AIServicesResource"{
type = "Microsoft.CognitiveServices/accounts@2023-10-01-preview"
name = "AIServicesResource${random_string.suffix.result}"
location = azurerm_resource_group.rg.location
parent_id = azurerm_resource_group.rg.id
identity {
type = "SystemAssigned"
}
body = jsonencode({
name = "AIServicesResource${random_string.suffix.result}"
properties = {
//restore = true
customSubDomainName = "${random_string.suffix.result}domain"
apiProperties = {
statisticsEnabled = false
}
}
kind = "AIServices"
sku = {
name = var.sku
}
})
response_export_values = ["*"]
}
// Azure AI Hub
resource "azapi_resource" "hub" {
type = "Microsoft.MachineLearningServices/workspaces@2024-04-01-preview"
name = "${random_pet.rg_name.id}-aih"
location = azurerm_resource_group.rg.location
parent_id = azurerm_resource_group.rg.id
identity {
type = "SystemAssigned"
}
body = jsonencode({
properties = {
description = "This is my Azure AI hub"
friendlyName = "My Hub"
storageAccount = azurerm_storage_account.default.id
keyVault = azurerm_key_vault.default.id
/* Optional: To enable these field, the corresponding dependent resources need to be uncommented.
applicationInsight = azurerm_application_insights.default.id
containerRegistry = azurerm_container_registry.default.id
*/
/*Optional: To enable Customer Managed Keys, the corresponding
encryption = {
status = var.encryption_status
keyVaultProperties = {
keyVaultArmId = azurerm_key_vault.default.id
keyIdentifier = var.cmk_keyvault_key_uri
}
}
*/
}
kind = "hub"
})
}
// Azure AI Project
resource "azapi_resource" "project" {
type = "Microsoft.MachineLearningServices/workspaces@2024-04-01-preview"
name = "my-ai-project${random_string.suffix.result}"
location = azurerm_resource_group.rg.location
parent_id = azurerm_resource_group.rg.id
identity {
type = "SystemAssigned"
}
body = jsonencode({
properties = {
description = "This is my Azure AI PROJECT"
friendlyName = "My Project"
hubResourceId = azapi_resource.hub.id
}
kind = "project"
})
}
// AzAPI AI Services Connection
resource "azapi_resource" "AIServicesConnection" {
type = "Microsoft.MachineLearningServices/workspaces/connections@2024-04-01-preview"
name = "Default_AIServices${random_string.suffix.result}"
parent_id = azapi_resource.hub.id
body = jsonencode({
properties = {
category = "AIServices",
target = jsondecode(azapi_resource.AIServicesResource.output).properties.endpoint,
authType = "AAD",
isSharedToAll = true,
metadata = {
ApiType = "Azure",
ResourceId = azapi_resource.AIServicesResource.id
}
}
})
response_export_values = ["*"]
}
/* The following resources are OPTIONAL.
// APPLICATION INSIGHTS
resource "azurerm_application_insights" "default" {
name = "${var.prefix}appinsights${random_string.suffix.result}"
location = azurerm_resource_group.rg.location
resource_group_name = azurerm_resource_group.rg.name
application_type = "web"
}
// CONTAINER REGISTRY
resource "azurerm_container_registry" "default" {
name = "${var.prefix}contreg${random_string.suffix.result}"
resource_group_name = azurerm_resource_group.rg.name
location = azurerm_resource_group.rg.location
sku = "premium"
admin_enabled = true
}
*/

View File

@ -1,11 +0,0 @@
output "resource_group_name" {
value = azurerm_resource_group.rg.id
}
output "workspace_name" {
value = azapi_resource.project.id
}
output "endpoint" {
value = jsondecode(azapi_resource.AIServicesResource.output).properties.endpoint
}

View File

@ -1,33 +0,0 @@
terraform {
required_version = ">= 1.0"
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~>3.0"
}
azapi = {
source = "azure/azapi"
}
random = {
source = "hashicorp/random"
version = "~>3.0"
}
}
}
provider "azurerm" {
features {
key_vault {
recover_soft_deleted_key_vaults = false
purge_soft_delete_on_destroy = false
purge_soft_deleted_keys_on_destroy = false
}
resource_group {
prevent_deletion_if_contains_resources = false
}
}
}
provider "azapi" {
}

View File

@ -1,40 +0,0 @@
variable "resource_group_location" {
type = string
default = "eastus"
description = "Location of the resource group."
}
variable "resource_group_name_prefix" {
type = string
default = "rg"
description = "Prefix of the resource group name that's combined with a random ID so name is unique in your Azure subscription."
}
variable "prefix" {
type = string
description="This variable is used to name the hub, project, and dependent resources."
default = "ai"
}
variable "sku" {
type = string
description = "The sku name of the Azure Analysis Services server to create. Choose from: B1, B2, D1, S0, S1, S2, S3, S4, S8, S9. Some skus are region specific. See https://docs.microsoft.com/en-us/azure/analysis-services/analysis-services-overview#availability-by-region"
default = "S0"
}
resource "random_string" "suffix" {
length = 4
special = false
upper = false
}
/*Optional: For Customer Managed Keys, uncomment this part AND the corresponding section in main.tf
variable "cmk_keyvault_key_uri" {
description = "Key vault uri to access the encryption key."
}
variable "encryption_status" {
description = "Indicates whether or not the encryption is enabled for the workspace."
default = "Enabled"
}
*/

View File

@ -1,25 +0,0 @@
# Windows-based Azure Kubernetes Service (AKS) cluster
This template deploys an AKS cluster with Windows nodes.
## Terraform resource types
- [random_pet](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/pet)
- [azurerm_resource_group](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/resource_group)
- [random_string](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/string)
- [azurerm_virtual_network](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/virtual_network)
- [azurerm_kubernetes_cluster](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/kubernetes_cluster)
- [azurerm_kubernetes_cluster_node_pool](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/kubernetes_cluster_node_pool)
## Variables
| Name | Description | Default |
|-|-|-|
| `resource_group_name_prefix` | Prefix of the resource group name that's combined with a random ID so name is unique in your Azure subscription. | rg |
| `resource_group_location` | Location of the resource group. | eastus |
| `node_count_linux` | Initial quantity of Linux nodes for the node pool. | 1 |
| `node_count_windows` | Initial quantity of Windows nodes for the node pool. | 1 |
| `admin_username` | Admin username for the Windows node pool. | azureuser |
| `admin_password` | Admin password for the Windows node pool. | Passw0rd1234Us! |
## Example

View File

@ -1,306 +0,0 @@
## 03 Nov 24 03:44 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 27 Oct 24 00:39 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 20 Oct 24 02:22 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 13 Oct 24 02:09 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 06 Oct 24 00:58 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 05:14 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 02:51 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 00:11 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 27 Sep 24 07:12 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 22 Sep 24 00:14 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 18 Sep 24 03:30 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 08 Sep 24 02:31 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.2
### Error
---
## 01 Sep 24 02:36 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.2
### Error
---
## 25 Aug 24 02:23 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.2
### Error
---
## 18 Aug 24 02:30 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.2
### Error
---
## 11 Aug 24 02:14 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.115.0
+ provider registry.terraform.io/hashicorp/random v3.6.2
### Error
---
## 04 Aug 24 02:27 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.114.0
+ provider registry.terraform.io/hashicorp/random v3.6.2
### Error
---
## 01 Aug 24 03:15 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.113.0
+ provider registry.terraform.io/hashicorp/random v3.6.2
### Error
---

View File

@ -1,73 +0,0 @@
# Generate random resource group name
resource "random_pet" "rg_name" {
prefix = var.resource_group_name_prefix
}
resource "azurerm_resource_group" "rg" {
location = var.resource_group_location
name = random_pet.rg_name.id
}
resource "random_pet" "azurerm_kubernetes_cluster_name" {
prefix = "cluster"
}
resource "random_pet" "azurerm_kubernetes_cluster_dns_prefix" {
prefix = "dns"
}
resource "random_string" "azurerm_kubernetes_cluster_node_pool" {
length = 6
special = false
numeric = false
lower = true
upper = false
}
resource "azurerm_virtual_network" "vnet" {
name = "myvnet"
location = azurerm_resource_group.rg.location
resource_group_name = azurerm_resource_group.rg.name
address_space = ["10.1.0.0/16"]
subnet {
name = "subnet1"
address_prefix = "10.1.1.0/24"
}
}
resource "azurerm_kubernetes_cluster" "aks" {
name = random_pet.azurerm_kubernetes_cluster_name.id
location = azurerm_resource_group.rg.location
resource_group_name = azurerm_resource_group.rg.name
dns_prefix = random_pet.azurerm_kubernetes_cluster_dns_prefix.id
identity {
type = "SystemAssigned"
}
default_node_pool {
name = "agentpool"
vm_size = "Standard_D2_v2"
node_count = var.node_count_linux
vnet_subnet_id = element(tolist(azurerm_virtual_network.vnet.subnet), 0).id
}
windows_profile {
admin_username = var.admin_username
admin_password = var.admin_password
}
network_profile {
network_plugin = "azure"
load_balancer_sku = "standard"
}
}
resource "azurerm_kubernetes_cluster_node_pool" "win" {
name = random_string.azurerm_kubernetes_cluster_node_pool.result
kubernetes_cluster_id = azurerm_kubernetes_cluster.aks.id
vm_size = "Standard_D4s_v3"
node_count = var.node_count_windows
os_type = "Windows"
}

View File

@ -1,20 +0,0 @@
output "resource_group_name" {
value = azurerm_resource_group.rg.name
}
output "kubernetes_cluster_name" {
value = azurerm_kubernetes_cluster.aks.name
}
output "kubernetes_cluster_dns_prefix" {
value = azurerm_kubernetes_cluster.aks.dns_prefix
}
output "kubernetes_cluster_node_pool_name" {
value = azurerm_kubernetes_cluster_node_pool.win.name
}
output "kubernetes_cluster_kube_config_raw" {
value = azurerm_kubernetes_cluster.aks.kube_config_raw
sensitive = true
}

View File

@ -1,19 +0,0 @@
terraform {
required_version = ">= 1.0"
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~>3.0"
}
random = {
source = "hashicorp/random"
version = "~>3.0"
}
}
}
provider "azurerm" {
features {
}
}

View File

@ -1,35 +0,0 @@
variable "resource_group_location" {
type = string
default = "eastus"
description = "Location of the resource group."
}
variable "resource_group_name_prefix" {
type = string
default = "rg"
description = "Prefix of the resource group name that's combined with a random ID so name is unique in your Azure subscription."
}
variable "node_count_linux" {
type = number
description = "The initial quantity of Linux nodes for the node pool."
default = 1
}
variable "node_count_windows" {
type = number
description = "The initial quantity of Windows nodes for the node pool."
default = 1
}
variable "admin_username" {
type = string
description = "The admin username for the Windows node pool."
default = "azureuser"
}
variable "admin_password" {
type = string
description = "The admin password for the Windows node pool."
default = "Passw0rd1234Us!"
}

View File

@ -1,19 +0,0 @@
# Aure Kubernetes Service (AKS) with standard load balancer and Virtual Machine Scale Sets (VMSS)
This template deploys an AKS cluster a standard load balancer and Virtual Machine Scale Sets (VMSS)
## Terraform resource types
- [random_pet](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/pet)
- [azurerm_resource_group](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/resource_group)
- [random_string](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/string)
- [azurerm_kubernetes_cluster](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/kubernetes_cluster)
## Variables
| Name | Description | Default |
|-|-|-|
| `resource_group_name_prefix` | Prefix of the resource group name that's combined with a random ID so name is unique in your Azure subscription. | rg |
| `resource_group_location` | Location of the resource group. | eastus |
## Example

View File

@ -1,306 +0,0 @@
## 03 Nov 24 02:19 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 27 Oct 24 00:34 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 20 Oct 24 02:18 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 13 Oct 24 01:57 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 06 Oct 24 00:52 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 05:03 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 02:50 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 00:11 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 27 Sep 24 07:08 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 22 Sep 24 00:13 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 18 Sep 24 03:30 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 08 Sep 24 02:21 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.2
### Error
---
## 01 Sep 24 02:15 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.2
### Error
---
## 25 Aug 24 02:16 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.2
### Error
---
## 18 Aug 24 02:18 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.2
### Error
---
## 11 Aug 24 02:04 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.115.0
+ provider registry.terraform.io/hashicorp/random v3.6.2
### Error
---
## 04 Aug 24 02:09 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.114.0
+ provider registry.terraform.io/hashicorp/random v3.6.2
### Error
---
## 01 Aug 24 03:08 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.113.0
+ provider registry.terraform.io/hashicorp/random v3.6.2
### Error
---

View File

@ -1,48 +0,0 @@
resource "random_pet" "rg_name" {
prefix = var.resource_group_name_prefix
}
resource "azurerm_resource_group" "rg" {
location = var.resource_group_location
name = random_pet.rg_name.id
}
resource "random_string" "aks_cluster_name" {
length = 12
special = false
}
resource "azurerm_kubernetes_cluster" "aks_cluster" {
name = random_string.aks_cluster_name.result
location = azurerm_resource_group.rg.location
resource_group_name = azurerm_resource_group.rg.name
dns_prefix = "myakscluster"
default_node_pool {
type = "VirtualMachineScaleSets"
name = "default"
node_count = 1
max_count = 3
min_count = 1
vm_size = "Standard_DS2_v2"
enable_auto_scaling = true
upgrade_settings {
drain_timeout_in_minutes = 90
max_surge = "10%"
node_soak_duration_in_minutes = 0
}
}
network_profile {
network_plugin = "azure"
load_balancer_sku = "standard"
}
identity {
type = "SystemAssigned"
}
tags = {
Environment = "Production"
}
}

View File

@ -1,7 +0,0 @@
output "resource_group_name" {
value = azurerm_resource_group.rg.name
}
output "aks_cluster_name" {
value = azurerm_kubernetes_cluster.aks_cluster.name
}

View File

@ -1,16 +0,0 @@
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~>3.0"
}
random = {
source = "hashicorp/random"
version = "~>3.0"
}
}
}
provider "azurerm" {
features {}
}

View File

@ -1,11 +0,0 @@
variable "resource_group_location" {
type = string
default = "eastus"
description = "Location of the resource group."
}
variable "resource_group_name_prefix" {
type = string
default = "rg"
description = "Prefix of the resource group name that's combined with a random ID so name is unique in your Azure subscription."
}

File diff suppressed because it is too large Load Diff

View File

@ -1,29 +0,0 @@
resource "random_pet" "rg_name" {
prefix = var.resource_group_name_prefix
}
resource "azurerm_resource_group" "rg" {
name = random_pet.rg_name.id
location = var.resource_group_location
}
resource "random_string" "azurerm_analysis_services_server_name" {
length = 25
upper = false
numeric = false
special = false
}
resource "azurerm_analysis_services_server" "server" {
name = random_string.azurerm_analysis_services_server_name.result
resource_group_name = azurerm_resource_group.rg.name
location = azurerm_resource_group.rg.location
sku = var.sku
backup_blob_container_uri = var.backup_blob_container_uri
ipv4_firewall_rule {
name = "AllowFromAll"
range_start = "0.0.0.0"
range_end = "255.255.255.255"
}
}

View File

@ -1,7 +0,0 @@
output "resource_group_name" {
value = azurerm_resource_group.rg.name
}
output "analysis_services_server_name" {
value = azurerm_analysis_services_server.server.name
}

View File

@ -1,16 +0,0 @@
terraform {
required_version = ">=0.12"
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~>3.0"
}
random = {
source = "hashicorp/random"
version = "~>3.0"
}
}
}
provider "azurerm" {
features {}
}

View File

@ -1,19 +0,0 @@
# Azure Analysis Services server
This template deploys an Azure Analysis Services server.
## Terraform resource types
- [random_pet](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/pet)
- [azurerm_resource_group](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/resource_group)
- [azurerm_analysis_services_server](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/analysis_services_server)
## Variables
| Name | Description | Default |
|-|-|-|
| `resource_group_name_prefix` | Prefix of the resource group name that's combined with a random ID so name is unique in your Azure subscription. | rg |
| `resource_group_location` | Location of the resource group. | eastus |
| `server_name` | Name of the Azure Analysis Services server. | |
| `sku` | SKU name of the Azure Analysis Services server to create. | S0 |
| `backup_blob_container_uri` | SAS URI to a private Azure Blob Storage container with read, write and list permissions. | null |

View File

@ -1,23 +0,0 @@
variable "resource_group_location" {
type = string
default = "eastus"
description = "Location for all resources."
}
variable "resource_group_name_prefix" {
type = string
default = "rg"
description = "Prefix of the resource group name that's combined with a random ID so name is unique in your Azure subscription."
}
variable "sku" {
type = string
description = "The sku name of the Azure Analysis Services server to create. Choose from: B1, B2, D1, S0, S1, S2, S3, S4, S8, S9. Some skus are region specific. See https://docs.microsoft.com/en-us/azure/analysis-services/analysis-services-overview#availability-by-region"
default = "S0"
}
variable "backup_blob_container_uri" {
type = string
description = "The SAS URI to a private Azure Blob Storage container with read, write and list permissions. Required only if you intend to use the backup/restore functionality. See https://docs.microsoft.com/en-us/azure/analysis-services/analysis-services-backup"
default = null
}

View File

@ -1,22 +0,0 @@
# Azure Windows Web App with Backup
This template deploys an Azure Windows Web App with a backup configured.
## Terraform resource types
- [random_pet](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/pet)
- [azurerm_resource_group](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/resource_group)
- [random_string](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/string)
- [azurerm_storage_account](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/storage_account)
- [azurerm_storage_container](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/storage_container)
- [azurerm_service_plan](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/service_plan)
- [azurerm_windows_web_app](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/windows_web_app)
## Variables
| Name | Description | Default value |
|-|-|-|
| `resource_group_name_prefix` | Prefix of the resource group name that's combined with a random ID so name is unique in your Azure subscription. | rg |
| `resource_group_location` | Location of the resource group. | eastus |
## Example

View File

@ -1,306 +0,0 @@
## 03 Nov 24 02:00 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 27 Oct 24 00:25 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 20 Oct 24 01:23 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 13 Oct 24 01:53 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 06 Oct 24 00:43 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 05:00 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 02:51 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 00:11 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 27 Sep 24 06:58 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 22 Sep 24 00:13 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 18 Sep 24 03:29 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 08 Sep 24 02:17 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.2
### Error
---
## 01 Sep 24 02:17 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.2
### Error
---
## 25 Aug 24 02:11 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.2
### Error
---
## 18 Aug 24 02:13 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.2
### Error
---
## 11 Aug 24 01:55 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.115.0
+ provider registry.terraform.io/hashicorp/random v3.6.2
### Error
---
## 04 Aug 24 01:59 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.114.0
+ provider registry.terraform.io/hashicorp/random v3.6.2
### Error
---
## 01 Aug 24 03:04 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.113.0
+ provider registry.terraform.io/hashicorp/random v3.6.2
### Error
---

View File

@ -1,121 +0,0 @@
resource "random_pet" "rg_name" {
prefix = var.resource_group_name_prefix
}
resource "azurerm_resource_group" "rg" {
location = var.resource_group_location
name = random_pet.rg_name.id
}
resource "random_string" "storage_account_name" {
length = 8
lower = true
numeric = false
special = false
upper = false
}
resource "azurerm_storage_account" "example" {
name = random_string.storage_account_name.result
resource_group_name = azurerm_resource_group.rg.name
location = azurerm_resource_group.rg.location
account_tier = "Standard"
account_replication_type = "LRS"
}
resource "random_string" "storage_container_name" {
length = 8
lower = true
numeric = false
special = false
upper = false
}
resource "azurerm_storage_container" "example" {
name = random_string.storage_container_name.result
storage_account_name = azurerm_storage_account.example.name
container_access_type = "private"
}
resource "random_string" "service_plan_name" {
length = 8
lower = true
numeric = false
special = false
upper = false
}
resource "azurerm_service_plan" "example" {
name = random_string.service_plan_name.result
location = azurerm_resource_group.rg.location
resource_group_name = azurerm_resource_group.rg.name
os_type = "Windows"
sku_name = "S1"
}
data "azurerm_storage_account_sas" "example" {
connection_string = azurerm_storage_account.example.primary_connection_string
https_only = true
resource_types {
service = false
container = false
object = true
}
services {
blob = true
queue = false
table = false
file = false
}
# Please change the start_date variable (in variables.tf) to the appropriate
# value for your environment.
start = formatdate(var.start_date, timestamp())
expiry = formatdate(var.start_date, timeadd(timestamp(), "8765h"))
permissions {
read = false
write = true
delete = false
list = false
add = false
create = false
update = false
process = false
tag = false
filter = false
}
}
resource "random_string" "windows_web_app_name" {
length = 8
lower = true
numeric = false
special = false
upper = false
}
resource "azurerm_windows_web_app" "example" {
name = random_string.windows_web_app_name.result
location = azurerm_resource_group.rg.location
resource_group_name = azurerm_resource_group.rg.name
service_plan_id = azurerm_service_plan.example.id
backup {
name = "Example"
storage_account_url = "https://${azurerm_storage_account.example.name}.blob.core.windows.net/${azurerm_storage_container.example.name}${data.azurerm_storage_account_sas.example.sas}&sr=b"
schedule {
frequency_interval = 30
frequency_unit = "Day"
}
}
site_config {
application_stack {
dotnet_version = "v6.0"
current_stack = "dotnet"
}
}
}

View File

@ -1,23 +0,0 @@
output "resource_group_name" {
value = azurerm_resource_group.rg.name
}
output "storage_account_name" {
value = azurerm_storage_account.example.name
}
output "storage_container_name" {
value = azurerm_storage_container.example.name
}
output "service_plan_name" {
value = azurerm_service_plan.example.name
}
output "windows_web_app_name" {
value = azurerm_windows_web_app.example.name
}
output "windows_web_app_default_hostname" {
value = azurerm_windows_web_app.example.default_hostname
}

View File

@ -1,18 +0,0 @@
terraform {
required_version = ">=1.0"
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~>3.0"
}
random = {
source = "hashicorp/random"
version = "~>3.0"
}
}
}
provider "azurerm" {
features {}
}

View File

@ -1,18 +0,0 @@
variable "resource_group_name_prefix" {
type = string
default = "rg"
description = "Prefix of the resource group name that's combined with a random ID so name is unique in your Azure subscription."
}
variable "resource_group_location" {
type = string
default = "eastus"
description = "Location of the resource group."
}
variable "start_date" {
type = string
default = "2024-06-01"
description = "Start date."
}

File diff suppressed because it is too large Load Diff

View File

@ -1,48 +1,43 @@
resource "random_string" "rg" { resource "azurerm_resource_group" "rg1" {
length = 8 name = "myResourceGroupAG"
upper = false
special = false
}
resource "azurerm_resource_group" "rg" {
name = "101-application-gateway-${random_string.rg.result}"
location = "eastus" location = "eastus"
} }
resource "azurerm_virtual_network" "vnet" { resource "azurerm_virtual_network" "vnet1" {
name = "myVNet" name = "myVNet"
resource_group_name = azurerm_resource_group.rg.name resource_group_name = azurerm_resource_group.rg1.name
location = azurerm_resource_group.rg.location location = azurerm_resource_group.rg1.location
address_space = ["10.21.0.0/16"] address_space = ["10.21.0.0/16"]
} }
resource "azurerm_subnet" "frontend" { resource "azurerm_subnet" "frontend" {
name = "myAGSubnet" name = "myAGSubnet"
resource_group_name = azurerm_resource_group.rg.name resource_group_name = azurerm_resource_group.rg1.name
virtual_network_name = azurerm_virtual_network.vnet.name virtual_network_name = azurerm_virtual_network.vnet1.name
address_prefixes = ["10.21.0.0/24"] address_prefixes = ["10.21.0.0/24"]
} }
resource "azurerm_subnet" "backend" { resource "azurerm_subnet" "backend" {
name = "myBackendSubnet" name = "myBackendSubnet"
resource_group_name = azurerm_resource_group.rg.name resource_group_name = azurerm_resource_group.rg1.name
virtual_network_name = azurerm_virtual_network.vnet.name virtual_network_name = azurerm_virtual_network.vnet1.name
address_prefixes = ["10.21.1.0/24"] address_prefixes = ["10.21.1.0/24"]
} }
resource "azurerm_public_ip" "pip" { resource "azurerm_public_ip" "pip1" {
name = "myAGPublicIPAddress" name = "myAGPublicIPAddress"
resource_group_name = azurerm_resource_group.rg.name resource_group_name = azurerm_resource_group.rg1.name
location = azurerm_resource_group.rg.location location = azurerm_resource_group.rg1.location
allocation_method = "Static" allocation_method = "Static"
sku = "Standard" sku = "Standard"
} }
resource "azurerm_application_gateway" "main" {
resource "azurerm_application_gateway" "network" {
name = "myAppGateway" name = "myAppGateway"
resource_group_name = azurerm_resource_group.rg.name resource_group_name = azurerm_resource_group.rg1.name
location = azurerm_resource_group.rg.location location = azurerm_resource_group.rg1.location
sku { sku {
name = "Standard_v2" name = "Standard_v2"
@ -62,7 +57,7 @@ resource "azurerm_application_gateway" "main" {
frontend_ip_configuration { frontend_ip_configuration {
name = var.frontend_ip_configuration_name name = var.frontend_ip_configuration_name
public_ip_address_id = azurerm_public_ip.pip.id public_ip_address_id = azurerm_public_ip.pip1.id
} }
backend_address_pool { backend_address_pool {
@ -90,15 +85,14 @@ resource "azurerm_application_gateway" "main" {
http_listener_name = var.listener_name http_listener_name = var.listener_name
backend_address_pool_name = var.backend_address_pool_name backend_address_pool_name = var.backend_address_pool_name
backend_http_settings_name = var.http_setting_name backend_http_settings_name = var.http_setting_name
priority = 1
} }
} }
resource "azurerm_network_interface" "nic" { resource "azurerm_network_interface" "nic" {
count = 2 count = 2
name = "nic-${count.index+1}" name = "nic-${count.index+1}"
location = azurerm_resource_group.rg.location location = azurerm_resource_group.rg1.location
resource_group_name = azurerm_resource_group.rg.name resource_group_name = azurerm_resource_group.rg1.name
ip_configuration { ip_configuration {
name = "nic-ipconfig-${count.index+1}" name = "nic-ipconfig-${count.index+1}"
@ -107,26 +101,26 @@ resource "azurerm_network_interface" "nic" {
} }
} }
resource "azurerm_network_interface_application_gateway_backend_address_pool_association" "nic-assoc" { resource "azurerm_network_interface_application_gateway_backend_address_pool_association" "nic-assoc01" {
count = 2 count = 2
network_interface_id = azurerm_network_interface.nic[count.index].id network_interface_id = azurerm_network_interface.nic[count.index].id
ip_configuration_name = "nic-ipconfig-${count.index+1}" ip_configuration_name = "nic-ipconfig-${count.index+1}"
backend_address_pool_id = one(azurerm_application_gateway.main.backend_address_pool).id backend_address_pool_id = azurerm_application_gateway.network.backend_address_pool[0].id
} }
resource "random_password" "password" { resource "random_password" "password" {
length = 16 length = 16
special = true special = true
lower = true lower = true
upper = true upper = true
numeric = true number = true
} }
resource "azurerm_windows_virtual_machine" "vm" { resource "azurerm_windows_virtual_machine" "vm" {
count = 2 count = 2
name = "myVM${count.index+1}" name = "myVM${count.index+1}"
resource_group_name = azurerm_resource_group.rg.name resource_group_name = azurerm_resource_group.rg1.name
location = azurerm_resource_group.rg.location location = azurerm_resource_group.rg1.location
size = "Standard_DS1_v2" size = "Standard_DS1_v2"
admin_username = "azureadmin" admin_username = "azureadmin"
admin_password = random_password.password.result admin_password = random_password.password.result
@ -150,7 +144,7 @@ resource "azurerm_windows_virtual_machine" "vm" {
} }
resource "azurerm_virtual_machine_extension" "vm-extensions" { resource "azurerm_virtual_machine_extension" "vm-extensions" {
count = 2 count = 2
name = "vm${count.index+1}-ext" name = "vm${count.index+1}-ext"
virtual_machine_id = azurerm_windows_virtual_machine.vm[count.index].id virtual_machine_id = azurerm_windows_virtual_machine.vm[count.index].id
publisher = "Microsoft.Compute" publisher = "Microsoft.Compute"

View File

@ -1,3 +0,0 @@
output "gateway_frontend_ip" {
value = "http://${azurerm_public_ip.pip.ip_address}"
}

View File

@ -1,14 +1,11 @@
terraform { terraform {
required_version = ">=1.2"
required_version = ">=0.12"
required_providers { required_providers {
azurerm = { azurerm = {
source = "hashicorp/azurerm" source = "hashicorp/azurerm"
version = "~> 3.0" version = ">=2.97.0"
}
random = {
source = "hashicorp/random"
version = "~> 3.0"
} }
} }
} }

View File

@ -21,3 +21,7 @@ variable "listener_name" {
variable "request_routing_rule_name" { variable "request_routing_rule_name" {
default = "myRoutingRule" default = "myRoutingRule"
} }
variable "redirect_configuration_name" {
default = "myRedirectConfig"
}

File diff suppressed because it is too large Load Diff

View File

@ -1,52 +1,28 @@
resource "random_pet" "rg_name" { terraform {
prefix = var.resource_group_name_prefix
required_version = ">=0.12"
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~>2.0"
}
}
}
provider "azurerm" {
features {}
} }
resource "azurerm_resource_group" "rg" { resource "azurerm_resource_group" "rg" {
name = var.resource_group_name
location = var.resource_group_location location = var.resource_group_location
name = random_pet.rg_name.id
} }
locals { resource "azurerm_attestation_provider" "corpAttestation" {
create_signing_cert = try(!fileexists(var.cert_path), true) name = var.attestation_provider_name
} resource_group_name = azurerm_resource_group.rg.name
location = azurerm_resource_group.rg.location
resource "tls_private_key" "signing_cert" {
count = local.create_signing_cert ? 1 : 0 policy_signing_certificate_data = file(var.policy_file)
algorithm = "RSA"
rsa_bits = 4096
}
resource "tls_self_signed_cert" "attestation" {
count = local.create_signing_cert ? 1 : 0
private_key_pem = tls_private_key.signing_cert[0].private_key_pem
validity_period_hours = 12
allowed_uses = [
"cert_signing",
]
}
resource "random_string" "attestation_suffix" {
length = 8
numeric = false
special = false
upper = false
}
resource "azurerm_attestation_provider" "corp_attestation" {
location = azurerm_resource_group.rg.location
name = "${var.attestation_provider_name}${random_string.attestation_suffix.result}"
resource_group_name = azurerm_resource_group.rg.name
policy_signing_certificate_data = try(tls_self_signed_cert.attestation[0].cert_pem, file(var.cert_path))
#https://github.com/hashicorp/terraform-provider-azurerm/issues/21998#issuecomment-1573312297
lifecycle {
ignore_changes = [
"open_enclave_policy_base64",
"sev_snp_policy_base64",
"sgx_enclave_policy_base64",
"tpm_policy_base64",
]
}
} }

View File

@ -1,3 +0,0 @@
output "resource_group_name" {
value = azurerm_resource_group.rg.name
}

View File

@ -1,22 +0,0 @@
terraform {
required_version = ">=0.12"
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~>3.0"
}
random = {
source = "hashicorp/random"
version = "~>3.0"
}
tls = {
source = "hashicorp/tls"
version = "4.0.4"
}
}
}
provider "azurerm" {
features {}
}

View File

@ -1,21 +0,0 @@
# Azure attestation provider
This template deploys an [Attestation provider](/azure/attestation/overview) on Azure.
## Terraform resource types
- [random_pet](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/pet)
- [azurerm_resource_group](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/resource_group)
- [azurerm_attestation_provider](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/attestation)
## Variables
| Name | Description | Default |
|-|-|-|
| `resource_group_name_prefix` | Prefix of the resource group name that's combined with a random ID so name is unique in your Azure subscription. | rg |
| `resource_group_location` | Location of the resource group. | eastus |
| `attestation_provider_name` | Name of the Attestation provider | attestationprovider007 |
## Example
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).

View File

@ -1,17 +1,15 @@
variable "attestation_provider_name" { variable "resource_group_name" {
default = "attestation" default = "myResourceGroup"
}
variable "cert_path" {
default = "~/.certs/cert.pem"
} }
variable "resource_group_location" { variable "resource_group_location" {
default = "eastus" default = "eastus"
description = "Location of the resource group."
} }
variable "resource_group_name_prefix" { variable "policy_file" {
default = "rg" default = "~/.certs/cert.pem"
description = "Prefix of the resource group name that's combined with a random ID so name is unique in your Azure subscription." }
variable "attestation_provider_name" {
default = "attestationprovider007"
} }

View File

@ -1,324 +0,0 @@
## 03 Nov 24 01:58 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/azure/azapi v1.15.0
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 27 Oct 24 00:27 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/azure/azapi v1.15.0
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 20 Oct 24 01:18 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/azure/azapi v1.15.0
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 13 Oct 24 01:33 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/azure/azapi v1.15.0
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 06 Oct 24 00:37 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/azure/azapi v1.15.0
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 04:48 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/azure/azapi v1.15.0
+ provider registry.terraform.io/hashicorp/azurerm v2.99.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 02:50 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/azure/azapi v1.15.0
+ provider registry.terraform.io/hashicorp/azurerm v2.99.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 00:11 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/azure/azapi v1.15.0
+ provider registry.terraform.io/hashicorp/azurerm v2.99.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 27 Sep 24 06:53 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/azure/azapi v1.15.0
+ provider registry.terraform.io/hashicorp/azurerm v2.99.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 22 Sep 24 00:12 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/azure/azapi v1.15.0
+ provider registry.terraform.io/hashicorp/azurerm v2.99.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 18 Sep 24 03:29 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/azure/azapi v1.15.0
+ provider registry.terraform.io/hashicorp/azurerm v2.99.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 08 Sep 24 02:16 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/azure/azapi v1.15.0
+ provider registry.terraform.io/hashicorp/azurerm v2.99.0
+ provider registry.terraform.io/hashicorp/random v3.6.2
### Error
---
## 01 Sep 24 02:04 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/azure/azapi v1.15.0
+ provider registry.terraform.io/hashicorp/azurerm v2.99.0
+ provider registry.terraform.io/hashicorp/random v3.6.2
### Error
---
## 25 Aug 24 02:09 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/azure/azapi v1.15.0
+ provider registry.terraform.io/hashicorp/azurerm v2.99.0
+ provider registry.terraform.io/hashicorp/random v3.6.2
### Error
---
## 18 Aug 24 02:11 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/azure/azapi v1.15.0
+ provider registry.terraform.io/hashicorp/azurerm v2.99.0
+ provider registry.terraform.io/hashicorp/random v3.6.2
### Error
---
## 11 Aug 24 01:52 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/azure/azapi v1.14.0
+ provider registry.terraform.io/hashicorp/azurerm v2.99.0
+ provider registry.terraform.io/hashicorp/random v3.6.2
### Error
---
## 04 Aug 24 01:55 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/azure/azapi v1.14.0
+ provider registry.terraform.io/hashicorp/azurerm v2.99.0
+ provider registry.terraform.io/hashicorp/random v3.6.2
### Error
---
## 01 Aug 24 02:58 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/azure/azapi v1.14.0
+ provider registry.terraform.io/hashicorp/azurerm v2.99.0
+ provider registry.terraform.io/hashicorp/random v3.6.2
### Error
---

View File

@ -1,80 +0,0 @@
resource "random_pet" "rg_name" {
prefix = var.resource_group_name_prefix
}
resource "azurerm_resource_group" "rg" {
location = var.resource_group_location
name = random_pet.rg_name.id
}
data "azurerm_subscription" "current" {}
resource "azurerm_virtual_network" "example" {
name = "myVnet"
address_space = ["10.0.0.0/16"]
location = azurerm_resource_group.rg.location
resource_group_name = azurerm_resource_group.rg.name
}
resource "azurerm_subnet" "example" {
name = "mySubnet"
resource_group_name = azurerm_resource_group.rg.name
virtual_network_name = azurerm_virtual_network.example.name
address_prefixes = ["10.0.2.0/24"]
}
resource "azurerm_network_interface" "example" {
name = "myNic"
location = azurerm_resource_group.rg.location
resource_group_name = azurerm_resource_group.rg.name
ip_configuration {
name = "internal"
subnet_id = azurerm_subnet.example.id
private_ip_address_allocation = "Dynamic"
}
}
resource "azurerm_linux_virtual_machine" "example" {
name = "myVm"
resource_group_name = azurerm_resource_group.rg.name
location = azurerm_resource_group.rg.location
size = "Standard_F2"
network_interface_ids = [
azurerm_network_interface.example.id,
]
computer_name = "hostname"
admin_username = var.username
admin_ssh_key {
username = var.username
public_key = azapi_resource_action.ssh_public_key_gen.output.publicKey
}
identity {
type = "SystemAssigned"
}
os_disk {
caching = "ReadWrite"
storage_account_type = "Standard_LRS"
}
source_image_reference {
publisher = "Canonical"
offer = "0001-com-ubuntu-server-jammy"
sku = "22_04-lts"
version = "latest"
}
}
data "azurerm_role_definition" "contributor" {
name = "Contributor"
}
resource "azurerm_role_assignment" "example" {
scope = data.azurerm_subscription.current.id
role_definition_name = "Contributor"
principal_id = azurerm_linux_virtual_machine.example.identity[0].principal_id
}

View File

@ -1,7 +0,0 @@
output "resource_group_name" {
value = azurerm_resource_group.rg.name
}
output "azurerm_linux_virtual_machine_name" {
value = azurerm_linux_virtual_machine.example.name
}

View File

@ -1,22 +0,0 @@
terraform {
required_version = ">=0.12"
required_providers {
azapi = {
source = "azure/azapi"
version = "~>1.5"
}
azurerm = {
source = "hashicorp/azurerm"
version = "~>3.0"
}
random = {
source = "hashicorp/random"
version = "~>3.0"
}
}
}
provider "azurerm" {
features {}
}

View File

@ -1,25 +0,0 @@
# Authentication using managed identities for Azure services
This template deploys a Linux virtual machine (VM) to show an example of how to use managed identities for Azure services.
## Terraform resource types
- [random_pet](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/pet)
- [azurerm_resource_group](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/resource_group)
- [azurerm_virtual_network](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/virtual_network)
- [azurerm_subnet](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/subnet)
- [azurerm_network_interface](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/network_interface)
- [azurerm_linux_virtual_machine](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/linux_virtual_machine)
- [azurerm_role_assignment](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/role_assignment)
## Variables
| **Name** | **Description** | **Default** |
|---|---|---|
| `resource_group_name_prefix` | Prefix of the resource group name that's combined with a random ID so name is unique in your Azure subscription. | rg |
| `resource_group_location` | Location of the resource group. | eastus |
| `username` | The username for the local account that will be created on the new VM. | azureadmin |
## Example
To see how to run this example, see [Authenticate Terraform using Managed Identity for Azure services](https://docs.microsoft.com/azure/developer/terraform/authenticate-to-azure-using-msi).

View File

@ -1,24 +0,0 @@
resource "random_pet" "ssh_key_name" {
prefix = "ssh"
separator = ""
}
resource "azapi_resource_action" "ssh_public_key_gen" {
type = "Microsoft.Compute/sshPublicKeys@2022-11-01"
resource_id = azapi_resource.ssh_public_key.id
action = "generateKeyPair"
method = "POST"
response_export_values = ["publicKey", "privateKey"]
}
resource "azapi_resource" "ssh_public_key" {
type = "Microsoft.Compute/sshPublicKeys@2022-11-01"
name = random_pet.ssh_key_name.id
location = azurerm_resource_group.rg.location
parent_id = azurerm_resource_group.rg.id
}
output "key_data" {
value = azapi_resource_action.ssh_public_key_gen.output.publicKey
}

View File

@ -1,17 +0,0 @@
variable "resource_group_location" {
type = string
description = "Location of the resource group."
default = "eastus"
}
variable "resource_group_name_prefix" {
type = string
description = "Prefix of the resource group name that's combined with a random ID so name is unique in your Azure subscription."
default = "rg"
}
variable "username" {
type = string
description = "The username for the local account that will be created on the new VM."
default = "azureadmin"
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,697 +0,0 @@
## 03 Nov 24 02:26 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 27 Oct 24 01:02 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 20 Oct 24 01:50 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 13 Oct 24 02:08 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 06 Oct 24 01:14 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 05:30 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 02:50 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 00:10 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 27 Sep 24 07:39 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 22 Sep 24 00:12 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 18 Sep 24 03:29 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 08 Sep 24 02:46 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.2
### Error
---
## 01 Sep 24 02:31 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.2
### Error
---
## 25 Aug 24 02:02 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.2
### Error
---
## 18 Aug 24 02:41 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.2
### Error
---
## 11 Aug 24 02:27 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.115.0
+ provider registry.terraform.io/hashicorp/random v3.6.2
### Error
---
## 04 Aug 24 02:25 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.114.0
+ provider registry.terraform.io/hashicorp/random v3.6.2
### Error
---
## 01 Aug 24 03:25 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.113.0
+ provider registry.terraform.io/hashicorp/random v3.6.2
### Error
---
## 28 Jan 24 01:47 UTC
Success: true
### Versions
Terraform v1.6.5
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.89.0
+ provider registry.terraform.io/hashicorp/random v3.6.0
### Error
---
## 21 Jan 24 01:06 UTC
Success: true
### Versions
Terraform v1.6.5
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.88.0
+ provider registry.terraform.io/hashicorp/random v3.6.0
### Error
---
## 14 Jan 24 01:38 UTC
Success: true
### Versions
Terraform v1.6.4
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.87.0
+ provider registry.terraform.io/hashicorp/random v3.6.0
### Error
---
## 07 Jan 24 01:37 UTC
Success: true
### Versions
Terraform v1.6.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.86.0
+ provider registry.terraform.io/hashicorp/random v3.6.0
### Error
---
## 31 Dec 23 01:29 UTC
Success: true
### Versions
Terraform v1.6.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.85.0
+ provider registry.terraform.io/hashicorp/random v3.6.0
### Error
---
## 24 Dec 23 01:05 UTC
Success: true
### Versions
Terraform v1.6.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.85.0
+ provider registry.terraform.io/hashicorp/random v3.6.0
### Error
---
## 17 Dec 23 01:38 UTC
Success: true
### Versions
Terraform v1.6.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.85.0
+ provider registry.terraform.io/hashicorp/random v3.6.0
### Error
---
## 10 Dec 23 01:25 UTC
Success: true
### Versions
Terraform v1.6.2
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.84.0
+ provider registry.terraform.io/hashicorp/random v3.6.0
### Error
---
## 04 Dec 23 03:38 UTC
Success: true
### Versions
Terraform v1.6.2
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.83.0
+ provider registry.terraform.io/hashicorp/random v3.5.1
### Error
---
## 26 Nov 23 06:05 UTC
Success: true
### Versions
Terraform v1.6.2
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.82.0
+ provider registry.terraform.io/hashicorp/random v3.5.1
### Error
---
## 19 Nov 23 03:23 UTC
Success: true
### Versions
Terraform v1.6.2
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.81.0
+ provider registry.terraform.io/hashicorp/random v3.5.1
### Error
---
## 12 Nov 23 06:45 UTC
Success: true
### Versions
Terraform v1.6.0
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.80.0
+ provider registry.terraform.io/hashicorp/random v3.5.1
### Error
---
## 05 Nov 23 07:07 UTC
Success: true
### Versions
Terraform v1.6.0
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.79.0
+ provider registry.terraform.io/hashicorp/random v3.5.1
### Error
---
## 29 Oct 23 06:45 UTC
Success: true
### Versions
Terraform v1.6.0
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.78.0
+ provider registry.terraform.io/hashicorp/random v3.5.1
### Error
---
## 22 Oct 23 04:39 UTC
Success: true
### Versions
Terraform v1.5.7
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.77.0
+ provider registry.terraform.io/hashicorp/random v3.5.1
### Error
---
## 15 Oct 23 04:56 UTC
Success: true
### Versions
Terraform v1.5.7
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.76.0
+ provider registry.terraform.io/hashicorp/random v3.5.1
### Error
---
## 08 Oct 23 04:49 UTC
Success: true
### Versions
Terraform v1.5.6
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.75.0
+ provider registry.terraform.io/hashicorp/random v3.5.1
### Error
---
## 01 Oct 23 05:31 UTC
Success: true
### Versions
Terraform v1.5.6
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.75.0
+ provider registry.terraform.io/hashicorp/random v3.5.1
### Error
---
## 24 Sep 23 04:34 UTC
Success: true
### Versions
Terraform v1.5.6
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.74.0
+ provider registry.terraform.io/hashicorp/random v3.5.1
### Error
---
## 20 Sep 23 10:45 UTC
Success: true
### Versions
Terraform v1.5.6
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.73.0
+ provider registry.terraform.io/hashicorp/random v3.5.1
### Error
---
## 17 Sep 23 04:21 UTC
Success: true
### Versions
Terraform v1.5.5
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.73.0
+ provider registry.terraform.io/hashicorp/random v3.5.1
### Error
---
## 10 Sep 23 04:48 UTC
Success: true
### Versions
Terraform v1.5.4
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.72.0
+ provider registry.terraform.io/hashicorp/random v3.5.1
### Error
---
## 31 Aug 23 19:44 UTC
Success: true
### Versions
Terraform v1.5.4
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.71.0
+ provider registry.terraform.io/hashicorp/random v3.5.1
### Error
---

View File

@ -1,120 +0,0 @@
resource "random_pet" "rg-name" {
prefix = var.resource_group_name_prefix
}
resource "azurerm_resource_group" "rg" {
name = random_pet.rg-name.id
location = var.resource_group_location
}
resource "azurerm_virtual_network" "azfw_vnet" {
name = "azfw-vnet"
location = azurerm_resource_group.rg.location
resource_group_name = azurerm_resource_group.rg.name
address_space = ["10.10.0.0/24"]
}
resource "azurerm_ip_group" "workload_ip_group" {
name = "workload-ip-group"
resource_group_name = azurerm_resource_group.rg.name
location = azurerm_resource_group.rg.location
cidrs = ["10.20.0.0/24", "10.30.0.0/24"]
}
resource "azurerm_ip_group" "infra_ip_group" {
name = "infra-ip-group"
resource_group_name = azurerm_resource_group.rg.name
location = azurerm_resource_group.rg.location
cidrs = ["10.40.0.0/24", "10.50.0.0/24"]
}
resource "azurerm_subnet" "azfw_subnet" {
name = "AzureFirewallSubnet"
resource_group_name = azurerm_resource_group.rg.name
virtual_network_name = azurerm_virtual_network.azfw_vnet.name
address_prefixes = ["10.10.0.0/26"]
}
resource "azurerm_public_ip" "pip_azfw" {
name = "pip-azfw"
location = azurerm_resource_group.rg.location
resource_group_name = azurerm_resource_group.rg.name
allocation_method = "Static"
sku = "Standard"
}
resource "azurerm_firewall_policy" "azfw_policy" {
name = "azfw-policy"
resource_group_name = azurerm_resource_group.rg.name
location = azurerm_resource_group.rg.location
sku = var.firewall_sku_tier
threat_intelligence_mode = "Alert"
}
resource "azurerm_firewall_policy_rule_collection_group" "net_policy_rule_collection_group" {
name = "DefaultNetworkRuleCollectionGroup"
firewall_policy_id = azurerm_firewall_policy.azfw_policy.id
priority = 200
network_rule_collection {
name = "DefaultNetworkRuleCollection"
action = "Allow"
priority = 200
rule {
name = "time-windows"
protocols = ["UDP"]
source_ip_groups = [azurerm_ip_group.workload_ip_group.id, azurerm_ip_group.infra_ip_group.id]
destination_ports = ["123"]
destination_addresses = ["132.86.101.172"]
}
}
}
resource "azurerm_firewall_policy_rule_collection_group" "app_policy_rule_collection_group" {
name = "DefaulApplicationtRuleCollectionGroup"
firewall_policy_id = azurerm_firewall_policy.azfw_policy.id
priority = 300
application_rule_collection {
name = "DefaultApplicationRuleCollection"
action = "Allow"
priority = 500
rule {
name = "AllowWindowsUpdate"
description = "Allow Windows Update"
protocols {
type = "Http"
port = 80
}
protocols {
type = "Https"
port = 443
}
source_ip_groups = [azurerm_ip_group.workload_ip_group.id, azurerm_ip_group.infra_ip_group.id]
destination_fqdn_tags = ["WindowsUpdate"]
}
rule {
name = "Global Rule"
description = "Allow access to Microsoft.com"
protocols {
type = "Https"
port = 443
}
destination_fqdns = ["*.microsoft.com"]
terminate_tls = false
source_ip_groups = [azurerm_ip_group.workload_ip_group.id, azurerm_ip_group.infra_ip_group.id]
}
}
}
resource "azurerm_firewall" "fw" {
name = "azfw"
location = azurerm_resource_group.rg.location
resource_group_name = azurerm_resource_group.rg.name
sku_name = "AZFW_VNet"
sku_tier = var.firewall_sku_tier
ip_configuration {
name = "azfw-ipconfig"
subnet_id = azurerm_subnet.azfw_subnet.id
public_ip_address_id = azurerm_public_ip.pip_azfw.id
}
firewall_policy_id = azurerm_firewall_policy.azfw_policy.id
}

View File

@ -1,7 +0,0 @@
output "resource_group_name" {
value = azurerm_resource_group.rg.name
}
output "firewall_name" {
value = azurerm_firewall.fw.name
}

View File

@ -1,16 +0,0 @@
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~>3.0"
}
random = {
source = "hashicorp/random"
version = "~>3.0"
}
}
}
provider "azurerm" {
features {}
}

View File

@ -1,23 +0,0 @@
# Azure Firewall and Azure Firewall Policy
This template deploys an [Azure Firewall](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/firewall) with an [Azure Firewall Policy](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/firewall_policy)
## Terraform resource types
- [azurerm_resource_group](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/resource_group)
- [azurerm_virtual_network](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/virtual_network)
- [azurerm_subnet](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/subnet)
- [azurerm_ip_group](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/ip_group)
- [azurerm_public_ip](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/public_ip)
- [azurerm_firewall_policy](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/firewall_policy)
- [azurerm_firewall_policy_rule_collection_group](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/firewall_policy_rule_collection_group)
- [azurerm_firewall](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/firewall)
## Variables
| Name | Description | Default value |
|-|-|-|
| `resource_group_location` | location for your resources | eastus |
| `firewall_sku_tier` | Sku size for your Firewall and Firewall Policy | Premium |
## Example

View File

@ -1,22 +0,0 @@
variable "resource_group_location" {
type = string
description = "Location for all resources."
default = "eastus"
}
variable "resource_group_name_prefix" {
type = string
description = "Prefix for the Resource Group Name that's combined with a random id so name is unique in your Azure subcription."
default = "rg"
}
variable "firewall_sku_tier" {
type = string
description = "Firewall SKU."
default = "Premium" # Valid values are Standard and Premium
validation {
condition = contains(["Standard", "Premium"], var.firewall_sku_tier)
error_message = "The sku must be one of the following: Standard, Premium"
}
}

View File

@ -1,26 +0,0 @@
# Azure API Management
This template deploys an Azure API Management service, containing an API (based on a provided Open API spec). An API Management group and product are then created that are associated with the service and API.
## Terraform resource types
- [random_pet](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/pet)
- [azurerm_resource_group](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/resource_group)
- [random_string](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/string)
- [azurerm_api_management](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/api_management)
- [azurerm_api_management_api](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/api_management_api)
- [azurerm_api_management_product](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/api_management_product)
- [azurerm_api_management_group](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/api_management_group)
- [azurerm_api_management_product_api](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/api_management_product_api)
- [azurerm_api_management_product_group](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/api_management_product_group)
## Variables
| Name | Description | Default |
|-|-|-|
| `resource_group_name_prefix` | Prefix of the resource group name that's combined with a random ID so name is unique in your Azure subscription. | rg |
| `resource_group_location` | Location of the resource group. | eastus |
| `open_api_spec_content_format` | The format of the content from which the API Definition should be imported. Possible values are: openapi, openapi+json, openapi+json-link, openapi-link, swagger-json, swagger-link-json, wadl-link-json, wadl-xml, wsdl and wsdl-link. | swagger-link-json |
| `open_api_spec_content_value` | The Content from which the API Definition should be imported. When a content_format of *-link-* is specified this must be a URL, otherwise this must be defined inline. | http://conferenceapi.azurewebsites.net/?format=json |
## Example

View File

@ -1,306 +0,0 @@
## 03 Nov 24 02:51 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 27 Oct 24 01:29 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 20 Oct 24 01:38 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 13 Oct 24 02:30 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 06 Oct 24 01:36 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 05:50 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 02:50 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 00:10 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 27 Sep 24 08:02 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 22 Sep 24 00:11 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 18 Sep 24 03:29 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 08 Sep 24 03:04 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.2
### Error
---
## 01 Sep 24 02:34 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.2
### Error
---
## 25 Aug 24 02:51 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.2
### Error
---
## 18 Aug 24 03:12 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.2
### Error
---
## 11 Aug 24 02:45 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.115.0
+ provider registry.terraform.io/hashicorp/random v3.6.2
### Error
---
## 04 Aug 24 02:51 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.114.0
+ provider registry.terraform.io/hashicorp/random v3.6.2
### Error
---
## 01 Aug 24 03:44 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.113.0
+ provider registry.terraform.io/hashicorp/random v3.6.2
### Error
---

View File

@ -1,118 +0,0 @@
resource "random_pet" "rg_name" {
prefix = var.resource_group_name_prefix
}
resource "azurerm_resource_group" "rg" {
location = var.resource_group_location
name = random_pet.rg_name.id
}
resource "random_string" "apim_service_name" {
length = 8
lower = true
numeric = false
special = false
upper = false
}
resource "azurerm_api_management" "apim_service" {
name = "${random_string.apim_service_name.result}-apim-service"
location = azurerm_resource_group.rg.location
resource_group_name = azurerm_resource_group.rg.name
publisher_name = "Example Publisher"
publisher_email = "publisher@example.com"
sku_name = "Developer_1"
tags = {
Environment = "Example"
}
policy {
xml_content = <<XML
<policies>
<inbound />
<backend />
<outbound />
<on-error />
</policies>
XML
}
}
resource "random_string" "api_name" {
length = 8
lower = true
numeric = false
special = false
upper = false
}
resource "random_string" "content_value" {
length = 8
lower = true
numeric = false
special = false
upper = false
}
resource "azurerm_api_management_api" "api" {
name = "${random_string.api_name.result}-api"
resource_group_name = azurerm_resource_group.rg.name
api_management_name = azurerm_api_management.apim_service.name
revision = "1"
display_name = "${random_string.api_name.result}-api"
path = "example"
protocols = ["https", "http"]
description = "An example API"
import {
content_format = var.open_api_spec_content_format
content_value = var.open_api_spec_content_value
}
}
resource "random_string" "product_name" {
length = 8
lower = true
numeric = false
special = false
upper = false
}
resource "azurerm_api_management_product" "product" {
product_id = "${random_string.product_name.result}-product"
resource_group_name = azurerm_resource_group.rg.name
api_management_name = azurerm_api_management.apim_service.name
display_name = "${random_string.product_name.result}-product"
subscription_required = true
approval_required = false
published = true
description = "An example Product"
}
resource "random_string" "group_name" {
length = 8
lower = true
numeric = false
special = false
upper = false
}
resource "azurerm_api_management_group" "group" {
name = "${random_string.group_name.result}-group"
resource_group_name = azurerm_resource_group.rg.name
api_management_name = azurerm_api_management.apim_service.name
display_name = "${random_string.group_name.result}-group"
description = "An example group"
}
resource "azurerm_api_management_product_api" "product_api" {
resource_group_name = azurerm_resource_group.rg.name
api_management_name = azurerm_api_management.apim_service.name
product_id = azurerm_api_management_product.product.product_id
api_name = azurerm_api_management_api.api.name
}
resource "azurerm_api_management_product_group" "product_group" {
resource_group_name = azurerm_resource_group.rg.name
api_management_name = azurerm_api_management.apim_service.name
product_id = azurerm_api_management_product.product.product_id
group_name = azurerm_api_management_group.group.name
}

View File

@ -1,60 +0,0 @@
output "resource_group_name" {
value = azurerm_resource_group.rg.name
}
output "apim_service_name" {
value = azurerm_api_management.apim_service.name
}
output "api_name" {
value = azurerm_api_management_api.api.name
}
output "product_name" {
value = azurerm_api_management_product.product.product_id
}
output "group_name" {
value = azurerm_api_management_group.group.name
}
output "service_id" {
description = "The ID of the API Management Service created"
value = azurerm_api_management.apim_service.id
}
output "gateway_url" {
description = "The URL of the Gateway for the API Management Service"
value = azurerm_api_management.apim_service.gateway_url
}
output "service_public_ip_addresses" {
description = "The Public IP addresses of the API Management Service"
value = azurerm_api_management.apim_service.public_ip_addresses
}
output "api_outputs" {
description = "The IDs, state, and version outputs of the APIs created"
value = {
id = azurerm_api_management_api.api.id
is_current = azurerm_api_management_api.api.is_current
is_online = azurerm_api_management_api.api.is_online
version = azurerm_api_management_api.api.version
version_set_id = azurerm_api_management_api.api.version_set_id
}
}
output "product_id" {
description = "The ID of the Product created"
value = azurerm_api_management_product.product.id
}
output "product_api_id" {
description = "The ID of the Product/API association created"
value = azurerm_api_management_product_api.product_api.id
}
output "product_group_id" {
description = "The ID of the Product/Group association created"
value = azurerm_api_management_product_group.product_group.id
}

View File

@ -1,18 +0,0 @@
terraform {
required_version = ">=1.0"
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~>3.0"
}
random = {
source = "hashicorp/random"
version = "~>3.0"
}
}
}
provider "azurerm" {
features {}
}

View File

@ -1,27 +0,0 @@
variable "resource_group_name_prefix" {
type = string
default = "rg"
description = "Prefix of the resource group name that's combined with a random ID so name is unique in your Azure subscription."
}
variable "resource_group_location" {
type = string
default = "eastus"
description = "Location of the resource group."
}
variable "open_api_spec_content_format" {
type = string
default = "swagger-link-json"
description = "The format of the content from which the API Definition should be imported. Possible values are: openapi, openapi+json, openapi+json-link, openapi-link, swagger-json, swagger-link-json, wadl-link-json, wadl-xml, wsdl and wsdl-link."
validation {
condition = contains(["openapi", "openapi+json", "openapi+json-link", "openapi-link", "swagger-json", "swagger-link-json", "wadl-link-json", "wadl-xml", "wsdl", "wsdl-link"], var.open_api_spec_content_format)
error_message = "open_api_spec_content_format must be one of the following: openapi, openapi+json, openapi+json-link, openapi-link, swagger-json, swagger-link-json, wadl-link-json, wadl-xml, wsdl and wsdl-link."
}
}
variable "open_api_spec_content_value" {
type = string
default = "http://conferenceapi.azurewebsites.net/?format=json"
description = "The Content from which the API Definition should be imported. When a content_format of *-link-* is specified this must be a URL, otherwise this must be defined inline."
}

File diff suppressed because it is too large Load Diff

View File

@ -1,25 +0,0 @@
resource "random_pet" "rg_name" {
prefix = var.resource_group_name_prefix
}
resource "azurerm_resource_group" "rg" {
name = random_pet.rg_name.id
location = var.resource_group_location
}
resource "random_string" "azurerm_api_management_name" {
length = 13
lower = true
numeric = false
special = false
upper = false
}
resource "azurerm_api_management" "api" {
name = "apiservice${random_string.azurerm_api_management_name.result}"
location = azurerm_resource_group.rg.location
resource_group_name = azurerm_resource_group.rg.name
publisher_email = var.publisher_email
publisher_name = var.publisher_name
sku_name = "${var.sku}_${var.sku_count}"
}

View File

@ -1,7 +0,0 @@
output "resource_group_name" {
value = azurerm_resource_group.rg.name
}
output "api_management_service_name" {
value = azurerm_api_management.api.name
}

View File

@ -1,16 +0,0 @@
terraform {
required_version = ">=1.0"
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~>3.0"
}
random = {
source = "hashicorp/random"
version = "~>3.0"
}
}
}
provider "azurerm" {
features {}
}

View File

@ -1,21 +0,0 @@
# Azure API Management service
This template deploys an Azure API Management service.
## Terraform resource types
- [random_pet](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/pet)
- [azurerm_resource_group](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/resource_group)
- [random_string](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/string)
- [azurerm_api_management](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/api_management)
## Variables
| Name | Description | Default |
|-|-|-|
| `resource_group_name_prefix` | Prefix of the resource group name that's combined with a random ID so name is unique in your Azure subscription. | rg |
| `resource_group_location` | Location of the resource group. | eastus |
| `publisher_email` | Email address of the owner of the service. | test@contoso.com |
| `publisher_name` | Name of the owner of the service. | publisher |
| `sku` | Pricing tier of this API Management service | Developer |
| `sku_count` | Instance size of this API Management service. | 1 |

View File

@ -1,51 +0,0 @@
variable "resource_group_location" {
type = string
default = "eastus"
description = "Location for all resources."
}
variable "resource_group_name_prefix" {
type = string
default = "rg"
description = "Prefix of the resource group name that's combined with a random ID so name is unique in your Azure subscription."
}
variable "publisher_email" {
default = "test@contoso.com"
description = "The email address of the owner of the service"
type = string
validation {
condition = length(var.publisher_email) > 0
error_message = "The publisher_email must contain at least one character."
}
}
variable "publisher_name" {
default = "publisher"
description = "The name of the owner of the service"
type = string
validation {
condition = length(var.publisher_name) > 0
error_message = "The publisher_name must contain at least one character."
}
}
variable "sku" {
description = "The pricing tier of this API Management service"
default = "Developer"
type = string
validation {
condition = contains(["Developer", "Standard", "Premium"], var.sku)
error_message = "The sku must be one of the following: Developer, Standard, Premium."
}
}
variable "sku_count" {
description = "The instance size of this API Management service."
default = 1
type = number
validation {
condition = contains([1, 2], var.sku_count)
error_message = "The sku_count must be one of the following: 1, 2."
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,24 +0,0 @@
resource "random_pet" "rg_name" {
prefix = var.resource_group_name_prefix
}
resource "azurerm_resource_group" "rg" {
name = random_pet.rg_name.id
location = var.resource_group_location
}
resource "random_string" "azurerm_search_service_name" {
length = 25
upper = false
numeric = false
special = false
}
resource "azurerm_search_service" "search" {
name = random_string.azurerm_search_service_name.result
resource_group_name = azurerm_resource_group.rg.name
location = azurerm_resource_group.rg.location
sku = var.sku
replica_count = var.replica_count
partition_count = var.partition_count
}

View File

@ -1,7 +0,0 @@
output "resource_group_name" {
value = azurerm_resource_group.rg.name
}
output "azurerm_search_service_name" {
value = azurerm_search_service.search.name
}

View File

@ -1,16 +0,0 @@
terraform {
required_version = ">=1.0"
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~>3.0"
}
random = {
source = "hashicorp/random"
version = "~>3.0"
}
}
}
provider "azurerm" {
features {}
}

View File

@ -1,24 +0,0 @@
# Azure Cognitive Search
This template deploys an Azure Cognitive Search service.
## Terraform resource types
- [random_pet](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/pet)
- [azurerm_resource_group](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/resource_group)
- [random_string](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/string)
- [azurerm_search_service](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/search_service)
## Variables
| Name | Description | Default |
|-|-|-|
| `resource_group_name_prefix` | Prefix of the resource group name that's combined with a random ID so name is unique in your Azure subscription. | rg |
| `resource_group_location` | Location of the resource group. | eastus |
| `sku` | The pricing tier of the search service you want to create (for example, basic or standard). | standard |
| `replica_count` | The number of replicas that should be created. | 1 |
| `partition_count` | The number of partitions that should be created. | 1 |
## Example
To see how to run this example, see [Deploy an Azure Cognitive Search service using Terraform](https://learn.microsoft.com/azure/search/search-get-started-bicep).

View File

@ -1,41 +0,0 @@
variable "resource_group_location" {
type = string
description = "Location for all resources."
default = "eastus"
}
variable "resource_group_name_prefix" {
type = string
description = "Prefix of the resource group name that's combined with a random ID so name is unique in your Azure subscription."
default = "rg"
}
variable "sku" {
description = "The pricing tier of the search service you want to create (for example, basic or standard)."
default = "standard"
type = string
validation {
condition = contains(["free", "basic", "standard", "standard2", "standard3", "storage_optimized_l1", "storage_optimized_l2"], var.sku)
error_message = "The sku must be one of the following values: free, basic, standard, standard2, standard3, storage_optimized_l1, storage_optimized_l2."
}
}
variable "replica_count" {
type = number
description = "Replicas distribute search workloads across the service. You need at least two replicas to support high availability of query workloads (not applicable to the free tier)."
default = 1
validation {
condition = var.replica_count >= 1 && var.replica_count <= 12
error_message = "The replica_count must be between 1 and 12."
}
}
variable "partition_count" {
type = number
description = "Partitions allow for scaling of document count as well as faster indexing by sharding your index over multiple search units."
default = 1
validation {
condition = contains([1, 2, 3, 4, 6, 12], var.partition_count)
error_message = "The partition_count must be one of the following values: 1, 2, 3, 4, 6, 12."
}
}

View File

@ -1,306 +0,0 @@
## 03 Nov 24 01:54 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 27 Oct 24 00:28 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 20 Oct 24 00:29 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 13 Oct 24 01:21 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 06 Oct 24 00:30 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 04:36 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 02:50 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 00:10 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 27 Sep 24 07:00 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 22 Sep 24 00:11 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 18 Sep 24 03:29 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 08 Sep 24 02:03 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.2
### Error
---
## 01 Sep 24 01:57 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.2
### Error
---
## 25 Aug 24 01:53 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.2
### Error
---
## 18 Aug 24 01:59 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.2
### Error
---
## 11 Aug 24 01:48 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.115.0
+ provider registry.terraform.io/hashicorp/random v3.6.2
### Error
---
## 04 Aug 24 01:51 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.114.0
+ provider registry.terraform.io/hashicorp/random v3.6.2
### Error
---
## 01 Aug 24 02:43 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.113.0
+ provider registry.terraform.io/hashicorp/random v3.6.2
### Error
---

View File

@ -1,86 +0,0 @@
data "azurerm_client_config" "current" {}
# Generate random resource group name
resource "random_pet" "rg_name" {
prefix = var.resource_group_name_prefix
}
resource "azurerm_resource_group" "rg" {
location = var.resource_group_location
name = random_pet.rg_name.id
}
# Generate random value for the log analytics workspace name
resource "random_string" "log_analytics_workspace_name" {
length = 8
lower = true
numeric = false
special = false
upper = false
}
resource "azurerm_log_analytics_workspace" "log_analytics_workspace" {
resource_group_name = azurerm_resource_group.rg.name
location = azurerm_resource_group.rg.location
name = random_string.log_analytics_workspace_name.result
sku = var.log_analytics_workspace_sku
retention_in_days = var.log_analytics_workspace_retention_in_days
}
# Generate random value for the container app environment name
resource "random_string" "container_app_environment_name" {
length = 8
lower = true
numeric = false
special = false
upper = false
}
resource "azurerm_container_app_environment" "container_app_environment" {
resource_group_name = azurerm_resource_group.rg.name
location = azurerm_resource_group.rg.location
name = random_string.container_app_environment_name.result
log_analytics_workspace_id = azurerm_log_analytics_workspace.log_analytics_workspace.id
}
# Generate random value for the container app name
resource "random_string" "container_app_name" {
length = 8
lower = true
numeric = false
special = false
upper = false
}
resource "azurerm_container_app" "container_app" {
resource_group_name = azurerm_resource_group.rg.name
name = random_string.container_app_name.result
container_app_environment_id = azurerm_container_app_environment.container_app_environment.id
revision_mode = var.container_app_revision_mode
ingress {
allow_insecure_connections = false
external_enabled = true
target_port = 80
traffic_weight {
latest_revision = true
percentage = 100
}
}
template {
container {
name = var.container_name
image = var.container_image
cpu = var.container_cpu
memory = var.container_memory
}
}
}

View File

@ -1,15 +0,0 @@
output "resource_group_name" {
value = azurerm_resource_group.rg.name
}
output "log_analytics_workspace_name" {
value = azurerm_log_analytics_workspace.log_analytics_workspace.name
}
output "container_app_environment_name" {
value = azurerm_container_app_environment.container_app_environment.name
}
output "container_app_name" {
value = azurerm_container_app.container_app.name
}

View File

@ -1,19 +0,0 @@
terraform {
required_version = ">=1.0"
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~>3.0"
}
random = {
source = "hashicorp/random"
version = "~>3.0"
}
}
}
provider "azurerm" {
features {}
}

View File

@ -1,24 +0,0 @@
# Azure Container App Environment with Container App
This template deploys an [Azure Container App Environment](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/container_app_environment) with [Azure Container App](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/container_app).
## Terraform resource types
- [random_pet](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/pet)
- [azurerm_resource_group](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/resource_group)
- [random_string](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/string)
- [azurerm_container_app_environment](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/container_app_environment)
- [azurerm_container_app](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/container_app)
## Variables
| Name | Description | Default |
|-|-|-|
| `resource_group_name_prefix` | Prefix of the resource group name that's combined with a random ID so name is unique in your Azure subscription. | rg |
| `resource_group_location` | Location of the resource group. | eastus |
| `log_analytics_workspace_sku` | Log analytics workspace sku| PerGB2018 |
| `log_analytics_workspace_retention_in_days` | Log analytics workspace retention in days | 30 |
| `container_app_revision_mode` | Container app revision mode | Single |
| `container_name` | Container name | examplecontainerapp |
| `container_image` | Container image | mcr.microsoft.com/azuredocs/containerapps-helloworld:latest |
| `container_cpu` | Container cpu | 0.25 |
| `container_memory` | Container memory | 0.5Gi |

View File

@ -1,53 +0,0 @@
variable "resource_group_location" {
type = string
description = "Location of the resource group."
default = "eastus"
}
variable "resource_group_name_prefix" {
type = string
description = "Prefix of the resource group name that's combined with a random ID so name is unique in your Azure subscription."
default = "rg"
}
variable "log_analytics_workspace_sku" {
type = string
description = "Log analytics workspace sku"
default = "PerGB2018"
}
variable "log_analytics_workspace_retention_in_days" {
type = number
description = "Log analytics workspace retention in days"
default = 30
}
variable "container_app_revision_mode" {
type = string
description = "Container app revision mode"
default = "Single"
}
variable "container_name" {
type = string
description = "Container name"
default = "examplecontainerapp"
}
variable "container_image" {
type = string
description = "Container image"
default = "mcr.microsoft.com/azuredocs/containerapps-helloworld:latest"
}
variable "container_cpu" {
type = number
description = "Container cpu"
default = 0.25
}
variable "container_memory" {
type = string
description = "Container memory"
default = "0.5Gi"
}

View File

@ -1,19 +0,0 @@
# Azure Container Registry
Deploy an Azure Container Registry.
## Terraform resource types
- [random_pet](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/pet)
- [azurerm_resource_group](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/resource_group)
- [random_string](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/string)
- [azurerm_container_registry](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/container_registry)
## Variables
| Name | Description | Default |
|-|-|-|
| `resource_group_name_prefix` | Prefix of the resource group name that's combined with a random ID so name is unique in your Azure subscription. | rg |
| `resource_group_location` | Location of the resource group. | eastus |
## Example

View File

@ -1,34 +0,0 @@
## 03 Nov 24 01:44 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 27 Oct 24 00:19 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---

View File

@ -1,23 +0,0 @@
resource "random_pet" "rg_name" {
prefix = var.resource_group_name_prefix
}
resource "azurerm_resource_group" "rg" {
location = var.resource_group_location
name = random_pet.rg_name.id
}
resource "random_string" "acr_name" {
length = 5
lower = true
numeric = false
special = false
upper = false
}
resource "azurerm_container_registry" "example" {
name = "${random_string.acr_name.result}registry"
resource_group_name = azurerm_resource_group.rg.name
location = azurerm_resource_group.rg.location
sku = "Standard"
}

View File

@ -1,11 +0,0 @@
output "resource_group_name" {
value = azurerm_resource_group.rg.name
}
output "container_registry_name" {
value = azurerm_container_registry.example.name
}
output "container_registry_login_server" {
value = azurerm_container_registry.example.login_server
}

View File

@ -1,18 +0,0 @@
terraform {
required_version = ">=1.0"
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~>3.0"
}
random = {
source = "hashicorp/random"
version = "~>3.0"
}
}
}
provider "azurerm" {
features {}
}

Some files were not shown because too many files have changed in this diff Show More