Skip to content

Commit 464a4d3

Browse files
committed
Assigment3: inital terraform setup
1 parent 4dc54e1 commit 464a4d3

File tree

5 files changed

+128
-0
lines changed

5 files changed

+128
-0
lines changed

.gitignore

+36
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,39 @@ yarn-error.log*
3030

3131
# vercel
3232
.vercel
33+
34+
### Terraform ###
35+
# Local .terraform directories
36+
**/.terraform/*
37+
38+
# .tfstate files
39+
*.tfstate
40+
*.tfstate.*
41+
42+
# Crash log files
43+
crash.log
44+
crash.*.log
45+
46+
# Exclude all .tfvars files, which are likely to contain sensitive data, such as
47+
# password, private keys, and other secrets. These should not be part of version
48+
# control as they are data points which are potentially sensitive and subject
49+
# to change depending on the environment.
50+
*.tfvars
51+
*.tfvars.json
52+
53+
# Ignore override files as they are usually used to override resources locally and so
54+
# are not checked in
55+
override.tf
56+
override.tf.json
57+
*_override.tf
58+
*_override.tf.json
59+
60+
# Include override files you do wish to add to version control using negated pattern
61+
# !example_override.tf
62+
63+
# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan
64+
# example: *tfplan*
65+
66+
# Ignore CLI configuration files
67+
.terraformrc
68+
terraform.rc

.terraform.lock.hcl

+42
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

main.tf

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
resource "azurerm_resource_group" "example" {
2+
name = "Devops-terraform"
3+
location = "West Europe"
4+
}
5+
6+
resource "azurerm_log_analytics_workspace" "example" {
7+
name = "acctest-01"
8+
location = azurerm_resource_group.example.location
9+
resource_group_name = azurerm_resource_group.example.name
10+
sku = "PerGB2018"
11+
retention_in_days = 30
12+
}
13+
14+
resource "azurerm_container_app_environment" "example" {
15+
name = "Example-Environment"
16+
location = azurerm_resource_group.example.location
17+
resource_group_name = azurerm_resource_group.example.name
18+
log_analytics_workspace_id = azurerm_log_analytics_workspace.example.id
19+
}
20+
resource "azurerm_container_app" "example" {
21+
name = "example-app"
22+
container_app_environment_id = azurerm_container_app_environment.example.id
23+
resource_group_name = azurerm_resource_group.example.name
24+
revision_mode = "Single"
25+
26+
template {
27+
container {
28+
name = "examplecontainerapp"
29+
image = "csauercampus/devops-nextjs:main"
30+
cpu = 0.25
31+
memory = "0.5Gi"
32+
}
33+
}
34+
}

main.tfplan

4.22 KB
Binary file not shown.

providers.tf

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
terraform {
2+
required_providers {
3+
azurerm = {
4+
source = "hashicorp/azurerm"
5+
version = "~>3.0"
6+
}
7+
random = {
8+
source = "hashicorp/random"
9+
version = "~>3.0"
10+
}
11+
}
12+
}
13+
14+
provider "azurerm" {
15+
features {}
16+
}

0 commit comments

Comments
 (0)