Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 1 addition & 20 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
workflow_dispatch:

env:
TF_VERSION: '1.5.0'
TF_VERSION: '1.12.1'

jobs:
deploy-to-dev:
Expand Down Expand Up @@ -59,25 +59,6 @@ jobs:
- name: Make deploy script executable
run: chmod +x ./scripts/deploy-docker-app.sh

# Create terraform.tfvars for dev environment
- name: Create terraform.tfvars for dev environment
run: |
cd infra
cat > terraform.tfvars << EOF
location = "${{ secrets.AZURE_LOCATION }}"
environment = "dev"
EOF

# Configure Terraform backend for remote state
- name: Configure Terraform Backend
run: |
cd infra
terraform init \
-backend-config="resource_group_name=${{ secrets.TF_STATE_RESOURCE_GROUP }}" \
-backend-config="storage_account_name=${{ secrets.TF_STATE_STORAGE_ACCOUNT }}" \
-backend-config="container_name=${{ secrets.TF_STATE_CONTAINER_NAME }}" \
-backend-config="key=dev/terraform.tfstate"

# Deploy infrastructure using the deploy script
- name: Deploy Infrastructure to Dev
run: ./scripts/deploy-docker-app.sh deploy dev
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ crash.log
crash.*.log

# Exclude all .tfvars files, which are likely to contain sensitive data
*.tfvars
*.tfvars.json
# But keep example files
!*.tfvars.example
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ You will get an output similar to this:
"clientId": "your-service-principal-client-id",
"clientSecret": "your-service-principal-client-secret",
"subscriptionId": "your-azure-subscription-id",
"tenantId": "your-azure-tenant-id"
"tenantId": "your-azure-tenant-id",
"auth-type":"SERVICE_PRINCIPAL"
}
```

Expand Down
19 changes: 19 additions & 0 deletions infra/terraform-dev.tfvars
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Development environment variables
environment = "dev"
project_name = "terraform-ci-cd-sample"
resource_group_name = "rg-terraform-sample-dev"
location = "USGov Virginia"
container_registry_name = "acrtfsampledev"
container_registry_sku = "Standard"
app_service_plan_name = "asp-terraform-sample-dev"
app_service_plan_sku = "S1"
app_service_name = "app-terraform-sample-dev"
app_service_always_on = true
health_check_path = "/health"
docker_image_name = "my-app"
docker_image_tag = "latest"
websites_port = "80"
additional_app_settings = {
"ENVIRONMENT" = "dev"
"LOG_LEVEL" = "DEBUG"
}
18 changes: 18 additions & 0 deletions infra/terraform-local.tfvars
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Local development variables
environment = "local"
project_name = "terraform-ci-cd-sample"
resource_group_name = "rg-terraform-sample-local"
location = "USGov Virginia"
container_registry_name = "acrtfsamplelocal"
container_registry_sku = "Basic"
app_service_plan_name = "asp-terraform-sample-local"
app_service_plan_sku = "B1"
app_service_name = "app-terraform-sample-local"
app_service_always_on = false
health_check_path = "/health"
docker_image_name = "my-app"
docker_image_tag = "latest"
websites_port = "80"
additional_app_settings = {
"ENVIRONMENT" = "local"
}
42 changes: 42 additions & 0 deletions infra/terraform.tfvars
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# General Configuration - Azure Government
location = "USGov Virginia"
environment = "dev"
project_name = "demo-app"
azure_environment = "usgovernment"

# Resource Group Configuration
resource_group_name = "rg-demo-app-gov-dev"

# Container Registry Configuration (must be globally unique)
# Note: Azure Government ACR uses .azurecr.us domain
container_registry_name = "acrdemoappgov001"
container_registry_sku = "Basic"

# App Service Plan Configuration
app_service_plan_name = "asp-demo-app-gov-dev"
app_service_plan_sku = "B1"

# App Service Configuration (must be globally unique)
# Note: Azure Government App Services use .azurewebsites.us domain
app_service_name = "app-demo-gov-demo-001"
app_service_always_on = true
health_check_path = "/"

# Docker Configuration
docker_image_name = "my-app"
docker_image_tag = "latest"
websites_port = "80"

# Additional App Settings (optional)
additional_app_settings = {
"NODE_ENV" = "production"
"PORT" = "80"
# Add any other environment variables your app needs
}

# Managed Identity Configuration
# Set to true to use managed identity in addition to admin credentials
enable_managed_identity_acr_access = true

# Custom Domain Configuration (optional)
# custom_domain = "your-domain.com"