Skip to content

Commit

Permalink
DST-17030 Deploy UMT task definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
marcus-bcl committed May 29, 2024
1 parent 069211c commit 411c924
Show file tree
Hide file tree
Showing 3 changed files with 110 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::326912278139:role/modernisation-platform-oidc-cicd
role-session-name: delius-user-management-${{ github.run_number }}
role-session-name: delius-user-management-build-${{ github.run_number }}
aws-region: eu-west-2

- name: Login to Amazon ECR
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Deploy

on: push

permissions:
id-token: write # Required for OIDC
contents: read

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::326912278139:role/modernisation-platform-oidc-cicd
role-session-name: delius-user-management-deploy-${{ github.run_number }}
aws-region: eu-west-2

- name: Fill in the new image ID in the Amazon ECS task definition
id: task-def
uses: aws-actions/amazon-ecs-render-task-definition@c804dfbdd57f713b6c079302a4c01db7017a36fc
with:
task-definition: task-definition.json
container-name: umt
image: 374269020027.dkr.ecr.eu-west-2.amazonaws.com/delius-core-user-management:dev

- name: Deploy Amazon ECS task definition
uses: aws-actions/amazon-ecs-deploy-task-definition@df9643053eda01f169e64a0e60233aacca83799a
with:
task-definition: ${{ steps.task-def.outputs.task-definition }}
service: umt
cluster: delius-core-dev-cluster
wait-for-service-stability: true
72 changes: 72 additions & 0 deletions task-definition.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
"family": "umt",
"containerDefinitions": [
{
"name": "umt",
"image": "374269020027.dkr.ecr.eu-west-2.amazonaws.com/delius-core-user-management:0.0.0",
"cpu": 1024,
"memory": 4096,
"portMappings": [
{
"containerPort": 8080,
"hostPort": 8080,
"protocol": "tcp"
}
],
"essential": true,
"environment": [
],
"mountPoints": [],
"volumesFrom": [],
"secrets": [],
"readonlyRootFilesystem": false,
"logConfiguration": {
"logDriver": "awslogs",
"options": {
"awslogs-group": "dev-umt",
"awslogs-region": "eu-west-2",
"awslogs-stream-prefix": "dev-umt"
}
},
"systemControls": []
}
],
"taskRoleArn": "arn:aws:iam::326912278139:role/dev-umt-ecs-task",
"executionRoleArn": "arn:aws:iam::326912278139:role/dev-umt-ecs-task-exec",
"networkMode": "awsvpc",
"cpu": "1024",
"memory": "4096",
"ephemeralStorage": {
"sizeInGiB": 30
},
"tags": [
{
"key": "owner",
"value": "[email protected]"
},
{
"key": "environment-name",
"value": "delius-core-development"
},
{
"key": "source-code",
"value": "https://github.com/ministryofjustice/modernisation-platform-environments"
},
{
"key": "application",
"value": "delius"
},
{
"key": "is-production",
"value": "false"
},
{
"key": "business-unit",
"value": "HMPPS"
},
{
"key": "infrastructure-support",
"value": "[email protected]"
}
]
}

0 comments on commit 411c924

Please sign in to comment.