Skip to content

Commit fb97476

Browse files
authored
Merge pull request #2 from code-workbench/km/debug_workflow
Debugging workflow for terraform
2 parents d87535b + ba97299 commit fb97476

File tree

6 files changed

+82
-22
lines changed

6 files changed

+82
-22
lines changed

.github/workflows/deploy.yml

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
workflow_dispatch:
99

1010
env:
11-
TF_VERSION: '1.5.0'
11+
TF_VERSION: '1.12.1'
1212

1313
jobs:
1414
deploy-to-dev:
@@ -59,25 +59,6 @@ jobs:
5959
- name: Make deploy script executable
6060
run: chmod +x ./scripts/deploy-docker-app.sh
6161

62-
# Create terraform.tfvars for dev environment
63-
- name: Create terraform.tfvars for dev environment
64-
run: |
65-
cd infra
66-
cat > terraform.tfvars << EOF
67-
location = "${{ secrets.AZURE_LOCATION }}"
68-
environment = "dev"
69-
EOF
70-
71-
# Configure Terraform backend for remote state
72-
- name: Configure Terraform Backend
73-
run: |
74-
cd infra
75-
terraform init \
76-
-backend-config="resource_group_name=${{ secrets.TF_STATE_RESOURCE_GROUP }}" \
77-
-backend-config="storage_account_name=${{ secrets.TF_STATE_STORAGE_ACCOUNT }}" \
78-
-backend-config="container_name=${{ secrets.TF_STATE_CONTAINER_NAME }}" \
79-
-backend-config="key=dev/terraform.tfstate"
80-
8162
# Deploy infrastructure using the deploy script
8263
- name: Deploy Infrastructure to Dev
8364
run: ./scripts/deploy-docker-app.sh deploy dev

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ crash.log
1010
crash.*.log
1111

1212
# Exclude all .tfvars files, which are likely to contain sensitive data
13-
*.tfvars
1413
*.tfvars.json
1514
# But keep example files
1615
!*.tfvars.example

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,8 @@ You will get an output similar to this:
139139
"clientId": "your-service-principal-client-id",
140140
"clientSecret": "your-service-principal-client-secret",
141141
"subscriptionId": "your-azure-subscription-id",
142-
"tenantId": "your-azure-tenant-id"
142+
"tenantId": "your-azure-tenant-id",
143+
"auth-type":"SERVICE_PRINCIPAL"
143144
}
144145
```
145146

infra/terraform-dev.tfvars

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Development environment variables
2+
environment = "dev"
3+
project_name = "terraform-ci-cd-sample"
4+
resource_group_name = "rg-terraform-sample-dev"
5+
location = "USGov Virginia"
6+
container_registry_name = "acrtfsampledev"
7+
container_registry_sku = "Standard"
8+
app_service_plan_name = "asp-terraform-sample-dev"
9+
app_service_plan_sku = "S1"
10+
app_service_name = "app-terraform-sample-dev"
11+
app_service_always_on = true
12+
health_check_path = "/health"
13+
docker_image_name = "my-app"
14+
docker_image_tag = "latest"
15+
websites_port = "80"
16+
additional_app_settings = {
17+
"ENVIRONMENT" = "dev"
18+
"LOG_LEVEL" = "DEBUG"
19+
}

infra/terraform-local.tfvars

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Local development variables
2+
environment = "local"
3+
project_name = "terraform-ci-cd-sample"
4+
resource_group_name = "rg-terraform-sample-local"
5+
location = "USGov Virginia"
6+
container_registry_name = "acrtfsamplelocal"
7+
container_registry_sku = "Basic"
8+
app_service_plan_name = "asp-terraform-sample-local"
9+
app_service_plan_sku = "B1"
10+
app_service_name = "app-terraform-sample-local"
11+
app_service_always_on = false
12+
health_check_path = "/health"
13+
docker_image_name = "my-app"
14+
docker_image_tag = "latest"
15+
websites_port = "80"
16+
additional_app_settings = {
17+
"ENVIRONMENT" = "local"
18+
}

infra/terraform.tfvars

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# General Configuration - Azure Government
2+
location = "USGov Virginia"
3+
environment = "dev"
4+
project_name = "demo-app"
5+
azure_environment = "usgovernment"
6+
7+
# Resource Group Configuration
8+
resource_group_name = "rg-demo-app-gov-dev"
9+
10+
# Container Registry Configuration (must be globally unique)
11+
# Note: Azure Government ACR uses .azurecr.us domain
12+
container_registry_name = "acrdemoappgov001"
13+
container_registry_sku = "Basic"
14+
15+
# App Service Plan Configuration
16+
app_service_plan_name = "asp-demo-app-gov-dev"
17+
app_service_plan_sku = "B1"
18+
19+
# App Service Configuration (must be globally unique)
20+
# Note: Azure Government App Services use .azurewebsites.us domain
21+
app_service_name = "app-demo-gov-demo-001"
22+
app_service_always_on = true
23+
health_check_path = "/"
24+
25+
# Docker Configuration
26+
docker_image_name = "my-app"
27+
docker_image_tag = "latest"
28+
websites_port = "80"
29+
30+
# Additional App Settings (optional)
31+
additional_app_settings = {
32+
"NODE_ENV" = "production"
33+
"PORT" = "80"
34+
# Add any other environment variables your app needs
35+
}
36+
37+
# Managed Identity Configuration
38+
# Set to true to use managed identity in addition to admin credentials
39+
enable_managed_identity_acr_access = true
40+
41+
# Custom Domain Configuration (optional)
42+
# custom_domain = "your-domain.com"

0 commit comments

Comments
 (0)