Skip to content

Commit

Permalink
Merge pull request #666 from CDCgov/task/updating-staging-azure
Browse files Browse the repository at this point in the history
Task/updating staging azure
  • Loading branch information
halprin authored Nov 22, 2023
2 parents 40f0c2c + e16358d commit 005dac1
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,21 @@ jobs:
with:
TERRAFORM_DIRECTORY: operations/environments/staging
secrets:
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
AZURE_CLIENT_ID: ${{ secrets.AZURE_CDC_CLIENT_ID }}
AZURE_TENANT_ID: ${{ secrets.AZURE_CDC_TENANT_ID }}
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_CDC_DMZ_C1_SUBSCRIPTION_ID }}

staging-deploy:
name: Staging Application Deploy
needs: terraform-deploy
uses: ./.github/workflows/deploy_reusable.yml
with:
ENVIRONMENT: staging
ENVIRONMENT: stg
REPO: trusted-intermediary-router
REPO_DOCS: trusted-intermediary-docs
APP: ${{ needs.terraform-deploy.outputs.APP }}
REGISTRY: ${{ needs.terraform-deploy.outputs.REGISTRY }}
secrets:
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
AZURE_CLIENT_ID: ${{ secrets.AZURE_CDC_CLIENT_ID }}
AZURE_TENANT_ID: ${{ secrets.AZURE_CDC_TENANT_ID }}
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_CDC_DMZ_C1_SUBSCRIPTION_ID }}
2 changes: 1 addition & 1 deletion .github/workflows/deploy_reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,4 @@ jobs:
MODIFIED_ENVIRONMENT=${{ inputs.ENVIRONMENT }}
fi
az storage blob sync --account-name cdcti${MODIFIED_ENVIRONMENT}docs2 -c '$web' -s ${{ steps.extract.outputs.destination }}
az storage blob sync --account-name cdcti${MODIFIED_ENVIRONMENT}docs -c '$web' -s ${{ steps.extract.outputs.destination }}
2 changes: 1 addition & 1 deletion .secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -223,5 +223,5 @@
}
]
},
"generated_at": "2023-10-27T15:37:42Z"
"generated_at": "2023-11-22T21:57:59Z"
}
10 changes: 5 additions & 5 deletions operations/environments/staging/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ terraform {

# Use a remote Terraform state in Azure Storage
backend "azurerm" {
resource_group_name = "cdcti-terraform"
storage_account_name = "cdctiterraform"
container_name = "tfstate"
resource_group_name = "csels-rsti-stg-moderate-rg"
storage_account_name = "cdcintermediarytrfrmstg"
container_name = "terraform-state"
key = "staging.terraform.tfstate"
}
}
Expand All @@ -27,6 +27,6 @@ provider "azurerm" {
module "template" {
source = "../../template/"

environment = "staging"
deployer_id = "d59c2c86-de5e-41b7-a752-0869a73f5a60" //github app registration in Flexion Azure Entra
environment = "stg"
deployer_id = "f5feabe7-5d37-40ba-94f2-e5c0760b4561" //github app registration in CDC Azure Entra
}
10 changes: 5 additions & 5 deletions operations/template/main.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
locals {
environment_to_rs_environment_prefix_mapping = {
dev = "staging"
staging = "staging"
prod = ""
dev = "staging"
stg = "staging"
prod = ""
}
selected_rs_environment_prefix = lookup(local.environment_to_rs_environment_prefix_mapping, var.environment, "staging")
rs_domain_prefix = "${local.selected_rs_environment_prefix}${length(local.selected_rs_environment_prefix) == 0 ? "" : "."}"
Expand Down Expand Up @@ -32,7 +32,7 @@ resource "azurerm_service_plan" "plan" {

# Create the staging App Service
resource "azurerm_linux_web_app" "api" {
name = "cdcti-${var.environment}-api2"
name = "cdcti-${var.environment}-api"
resource_group_name = data.azurerm_resource_group.group.name
location = azurerm_service_plan.plan.location
service_plan_id = azurerm_service_plan.plan.id
Expand All @@ -57,7 +57,7 @@ resource "azurerm_linux_web_app" "api" {
}

resource "azurerm_storage_account" "docs" {
name = "cdcti${var.environment}docs2"
name = "cdcti${var.environment}docs"
resource_group_name = data.azurerm_resource_group.group.name
location = data.azurerm_resource_group.group.location
account_tier = "Standard"
Expand Down

0 comments on commit 005dac1

Please sign in to comment.