-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add initial deploy for bootstrap api
- Loading branch information
1 parent
b290174
commit cd8107d
Showing
15 changed files
with
142 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS build | ||
WORKDIR /app | ||
WORKDIR /src | ||
COPY src/ . | ||
WORKDIR /src/apps/Altinn.Authorization.DeployApi/src/Altinn.Authorization.DeployApi | ||
RUN dotnet publish -c Release -o /app | ||
|
||
FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine AS final | ||
WORKDIR /app | ||
COPY --from=build /app . | ||
|
||
ENTRYPOINT ["dotnet", "Altinn.Authorization.DeployApi.dll"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
environment = "at21" | ||
instance = "001" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
environment = "at22" | ||
instance = "001" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
environment = "at23" | ||
instance = "001" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
environment = "at24" | ||
instance = "001" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
terraform { | ||
required_providers { | ||
azurerm = { | ||
source = "hashicorp/azurerm" | ||
version = "4.1.0" | ||
} | ||
} | ||
|
||
backend "azurerm" { | ||
use_azuread_auth = true | ||
} | ||
} | ||
provider "azurerm" { | ||
use_oidc = true | ||
features {} | ||
} | ||
|
||
locals { | ||
infrastructure_suffix = "${var.infrastructure_name}${var.instance}${var.environment}" | ||
infrastructure_resource_group_name = "rg${local.infrastructure_suffix}" | ||
} | ||
|
||
data "azurerm_user_assigned_identity" "application_admin" { | ||
name = "miappadmin${local.infrastructure_suffix}" | ||
resource_group_name = local.infrastructure_resource_group_name | ||
} | ||
|
||
module "app" { | ||
source = "../../../../infra/modules/container_app_api" | ||
|
||
user_assigned_identities = [data.azurerm_user_assigned_identity.application_admin.principal_id] | ||
|
||
instance = var.instance | ||
environment = var.environment | ||
name = "bootstrapper" | ||
image = var.image | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
environment = "prod" | ||
instance = "001" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
environment = "tt02" | ||
instance = "001" |
28 changes: 28 additions & 0 deletions
28
src/apps/Altinn.Authorization.DeployApi/deploy/variables.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
variable "environment" { | ||
type = string | ||
description = <<EOT | ||
Specifies the target environment where the infrastructure will be deployed. | ||
It supports specific environment values, including 'at21', 'at22', 'at23', 'at24', 'at25', 'yt01', 'tt02', and 'prod'. | ||
This variable is used to differentiate between various deployment environments, such as testing (at/yt), staging (tt02), or (prod). | ||
EOT | ||
validation { | ||
condition = contains(["at21", "at22", "at23", "at24", "at25", "yt01", "tt02", "prod"], var.environment) | ||
error_message = "The environment must be one of the following: at21, at22, at23, at24, at25, yt01, tt02, prod." | ||
} | ||
} | ||
|
||
variable "instance" { | ||
type = string | ||
description = "A string to represent the specific instance of the deployment, used for resource naming. Used distinguishing between different deployments of the same infrastructure." | ||
default = "001" | ||
} | ||
|
||
variable "image" { | ||
type = string | ||
description = "Image of the resource that should be deployed" | ||
} | ||
|
||
variable "infrastructure_name" { | ||
type = string | ||
default = "auth" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"image_name": "altinn-authorization-bootstrapper" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters