From 653376059ae7053e04e3ddb4264bde05f473daad Mon Sep 17 00:00:00 2001 From: Jacob Woffenden Date: Mon, 12 Feb 2024 18:30:10 +0000 Subject: [PATCH] Switch to published image and faetures Signed-off-by: Jacob Woffenden --- .devcontainer/devcontainer-lock.json | 14 + .devcontainer/devcontainer.json | 17 +- .github/dependabot.yml | 418 ++++++++++++++++++++++++++- scripts/aws.sh | 20 ++ scripts/generate-dependabot-file.sh | 6 + 5 files changed, 454 insertions(+), 21 deletions(-) create mode 100644 .devcontainer/devcontainer-lock.json create mode 100644 scripts/aws.sh diff --git a/.devcontainer/devcontainer-lock.json b/.devcontainer/devcontainer-lock.json new file mode 100644 index 00000000000..9819fe9ef43 --- /dev/null +++ b/.devcontainer/devcontainer-lock.json @@ -0,0 +1,14 @@ +{ + "features": { + "ghcr.io/ministryofjustice/devcontainer-feature/aws:0": { + "version": "0.0.2", + "resolved": "ghcr.io/ministryofjustice/devcontainer-feature/aws@sha256:db720f840ce5015117b1b1e7649dc59b8ac6b34a8786f07ab727dd081140737f", + "integrity": "sha256:db720f840ce5015117b1b1e7649dc59b8ac6b34a8786f07ab727dd081140737f" + }, + "ghcr.io/ministryofjustice/devcontainer-feature/terraform:0": { + "version": "0.0.3", + "resolved": "ghcr.io/ministryofjustice/devcontainer-feature/terraform@sha256:ee331ef839de0479888df2049da48aaf980be9887e5ce90937ba5273105b2032", + "integrity": "sha256:ee331ef839de0479888df2049da48aaf980be9887e5ce90937ba5273105b2032" + } + } +} \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 52d81e37140..5baf4cbf2b5 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,17 +1,8 @@ { "name": "modernisation-platform-environments", - "image": "mcr.microsoft.com/vscode/devcontainers/base:ubuntu", + "image": "ghcr.io/ministryofjustice/devcontainer-base:latest", "features": { - "ghcr.io/devcontainers/features/common-utils:2": { - "configureZshAsDefaultShell": true, - }, - "./features/src/base": {}, - "./features/src/aws": {}, - "./features/src/static-analysis": {}, - "./features/src/terraform": {}, - }, - "overrideFeatureInstallOrder": [ - "ghcr.io/devcontainers/features/common-utils", - "./features/src/base", - ], + "ghcr.io/ministryofjustice/devcontainer-feature/aws:0": {}, + "ghcr.io/ministryofjustice/devcontainer-feature/terraform:0": {} + } } diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 815806d0d53..f2e41fd417c 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -8,6 +8,12 @@ updates: directory: "/" schedule: interval: "daily" + - package-ecosystem: "devcontainers" + directory: "/" + schedule: + interval: "daily" + reviewers: + - "ministryofjustice/devcontainer-community" # Dependabot doesn't currently support wildcard or multiple directory declarations within # a dependabot configuration, so we need to add all directories individually # See: github.com/dependabot/dependabot-core/issues/2178 @@ -15,26 +21,226 @@ updates: directory: "/terraform/environments/apex" schedule: interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/apex/modules/alb" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/apex/modules/codebuild" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/apex/modules/ecs" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/apex/modules/lambdapolicy" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/apex/modules/s3" + schedule: + interval: "daily" - package-ecosystem: "terraform" directory: "/terraform/environments/ccms-ebs" schedule: interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/ccms-ebs/modules" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/ccms-ebs/modules/cw-ec2" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/ccms-ebs/modules/cw-logs" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/ccms-ebs-upgrade" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/ccms-ebs-upgrade/modules" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/ccms-ebs-upgrade/modules/cw-ec2" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/ccms-ebs-upgrade/modules/cw-logs" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/cdpt-chaps" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/cdpt-ifs" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/cica-copilot" + schedule: + interval: "daily" - package-ecosystem: "terraform" directory: "/terraform/environments/cooker" schedule: interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/corporate-staff-rostering" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/cortex-xsiam" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/dacp" + schedule: + interval: "daily" - package-ecosystem: "terraform" directory: "/terraform/environments/data-and-insights-wepi" schedule: interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/data-platform" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/data-platform-apps-and-tools" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/data-platform-apps-and-tools/modules/auth0-log-streams" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/data-platform-compute" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/delius-core" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/delius-core/modules/components/delius_microservice" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/delius-core/modules/components/ebs_volume" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/delius-core/modules/components/ldap" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/delius-core/modules/components/oracle_db_instance" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/delius-core/modules/components/oracle_db_shared" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/delius-core/modules/ecs_policies" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/delius-core/modules/efs" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/delius-core/modules/environment_all_components" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/delius-core/modules/ldap_efs_datasync" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/delius-core/modules/nlb" + schedule: + interval: "daily" - package-ecosystem: "terraform" directory: "/terraform/environments/delius-iaps" schedule: interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/delius-jitbit" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/delius-mis" + schedule: + interval: "daily" - package-ecosystem: "terraform" directory: "/terraform/environments/digital-prison-reporting" schedule: interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/digital-prison-reporting/modules/apigateway/serverless-lambda-gw" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/digital-prison-reporting/modules/compute_node" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/digital-prison-reporting/modules/cw_alarm" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/digital-prison-reporting/modules/cw_insights" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/digital-prison-reporting/modules/dms" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/digital-prison-reporting/modules/dms_dps" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/digital-prison-reporting/modules/dms_s3_v2" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/digital-prison-reporting/modules/domains/dms-endpoints" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/digital-prison-reporting/modules/domains/dms-instance" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/digital-prison-reporting/modules/domains/dms-task" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/digital-prison-reporting/modules/domains/ingestion-jobs" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/digital-prison-reporting/modules/domains/ingestion-pipeline" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/digital-prison-reporting/modules/domains/pipeline-lambda" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/digital-prison-reporting/modules/domains/reload-pipeline" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/digital-prison-reporting/modules/dynamo_tables" + schedule: + interval: "daily" - package-ecosystem: "terraform" directory: "/terraform/environments/digital-prison-reporting/modules/ec2" schedule: @@ -59,10 +265,42 @@ updates: directory: "/terraform/environments/digital-prison-reporting/modules/glue_table" schedule: interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/digital-prison-reporting/modules/kinesis_firehose" + schedule: + interval: "daily" - package-ecosystem: "terraform" directory: "/terraform/environments/digital-prison-reporting/modules/kinesis_stream" schedule: interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/digital-prison-reporting/modules/lambdas/generic" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/digital-prison-reporting/modules/lambdas/layer" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/digital-prison-reporting/modules/lambda_trigger" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/digital-prison-reporting/modules/notifications/email" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/digital-prison-reporting/modules/notifications/eventbridge" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/digital-prison-reporting/modules/notifications/sns" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/digital-prison-reporting/modules/rds/postgres" + schedule: + interval: "daily" - package-ecosystem: "terraform" directory: "/terraform/environments/digital-prison-reporting/modules/redshift" schedule: @@ -71,6 +309,38 @@ updates: directory: "/terraform/environments/digital-prison-reporting/modules/s3_bucket" schedule: interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/digital-prison-reporting/modules/secrets_manager" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/digital-prison-reporting/modules/step_function" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/digital-prison-reporting/modules/vpc_endpoint" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/electronic-monitoring-data" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/electronic-monitoring-data/modules/landing_zone" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/electronic-monitoring-data/modules/landing_zone/landing_zone_user" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/electronic-monitoring-data/modules/landing_zone/server_security_group" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/electronic-monitoring-data/modules/s3_log_bucket" + schedule: + interval: "daily" - package-ecosystem: "terraform" directory: "/terraform/environments/equip" schedule: @@ -83,14 +353,50 @@ updates: directory: "/terraform/environments/equip/ec2-instance-module" schedule: interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/eric" + schedule: + interval: "daily" - package-ecosystem: "terraform" directory: "/terraform/environments/example" schedule: interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/hmpps-domain-services" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/hmpps-intelligence-management" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/hmpps-oem" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/laa-ccms-infra-azure-ad-sso" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/laa-oem" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/long-term-storage" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/maat" + schedule: + interval: "daily" - package-ecosystem: "terraform" directory: "/terraform/environments/maatdb" schedule: interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/maatdb/modules/rds" + schedule: + interval: "daily" - package-ecosystem: "terraform" directory: "/terraform/environments/mlra" schedule: @@ -103,28 +409,52 @@ updates: directory: "/terraform/environments/mlra/modules/cloudwatch" schedule: interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/mlra/modules/codebuild" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/mlra/modules/ecs" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/mojfin" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/ncas" + schedule: + interval: "daily" - package-ecosystem: "terraform" directory: "/terraform/environments/nomis" schedule: interval: "daily" - package-ecosystem: "terraform" - directory: "/terraform/environments/nomis/modules/database" + directory: "/terraform/environments/nomis/cloudwatch_dashboard" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/nomis-combined-reporting" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/nomis-data-hub" schedule: interval: "daily" - package-ecosystem: "terraform" - directory: "/terraform/environments/nomis/modules/ec2_autoscaling_group" + directory: "/terraform/environments/oas" schedule: interval: "daily" - package-ecosystem: "terraform" - directory: "/terraform/environments/nomis/modules/ec2_instance" + directory: "/terraform/environments/oas/modules/cloudwatch" schedule: interval: "daily" - package-ecosystem: "terraform" - directory: "/terraform/environments/nomis/modules/sns_topic" + directory: "/terraform/environments/oas/modules/rds" schedule: interval: "daily" - package-ecosystem: "terraform" - directory: "/terraform/environments/nomis/modules/weblogic" + directory: "/terraform/environments/oas/modules/rotate_secrets_lambda" schedule: interval: "daily" - package-ecosystem: "terraform" @@ -132,21 +462,53 @@ updates: schedule: interval: "daily" - package-ecosystem: "terraform" - directory: "/terraform/environments/oasys/modules/ec2_autoscaling_group" + directory: "/terraform/environments/observability-platform" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/observability-platform/modules/grafana/cloudwatch-source" schedule: interval: "daily" - package-ecosystem: "terraform" - directory: "/terraform/environments/oasys/modules/webserver" + directory: "/terraform/environments/observability-platform/modules/grafana/team" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/observability-platform/modules/grafana/xray-source" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/observability-platform/modules/observability-platform/tenant-configuration" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/observability-platform/modules/prometheus/iam-role" schedule: interval: "daily" - package-ecosystem: "terraform" directory: "/terraform/environments/performance-hub" schedule: interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/performance-hub/module/ecs" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/planetfm" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/portal" + schedule: + interval: "daily" - package-ecosystem: "terraform" directory: "/terraform/environments/ppud" schedule: interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/pra-register" + schedule: + interval: "daily" - package-ecosystem: "terraform" directory: "/terraform/environments/refer-monitor" schedule: @@ -160,10 +522,50 @@ updates: schedule: interval: "daily" - package-ecosystem: "terraform" - directory: "/terraform/environments/threat-and-vulnerability-mgmt" + directory: "/terraform/environments/tipstaff" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/tribunals" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/environments/wardship" schedule: interval: "daily" - package-ecosystem: "terraform" directory: "/terraform/environments/xhibit-portal" schedule: interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/modules/acm_certificate" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/modules/baseline" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/modules/baseline_presets" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/modules/cost_usage_report" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/modules/environment" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/modules/ip_addresses" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/modules/lb_listener" + schedule: + interval: "daily" + - package-ecosystem: "terraform" + directory: "/terraform/modules/rds_instance" + schedule: + interval: "daily" diff --git a/scripts/aws.sh b/scripts/aws.sh new file mode 100644 index 00000000000..b62c8702886 --- /dev/null +++ b/scripts/aws.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +# Get the current date in seconds +now=$(date +%s) + +# Get the AWS SSO session expiration date in seconds +# Assuming AWS_SSO_SESSION_EXPIRATION is in a format like '2024-01-24 05:34:21 UTC' +sessionExpiration=$(echo "$AWS_SSO_SESSION_EXPIRATION" | awk '{print $1 " " $2 " " $4}') +expiration=$(date -d "$sessionExpiration" +%s) + +# Calculate the difference in seconds +diff=$((expiration-now)) + +# Convert the difference to human-readable format +days=$((diff/86400)) +hours=$((diff%86400/3600)) +minutes=$((diff%3600/60)) +seconds=$((diff%60)) + +echo "Time left: $hours hours, $minutes minutes, $seconds seconds" \ No newline at end of file diff --git a/scripts/generate-dependabot-file.sh b/scripts/generate-dependabot-file.sh index 71c63f2f0be..c69950e7b5b 100755 --- a/scripts/generate-dependabot-file.sh +++ b/scripts/generate-dependabot-file.sh @@ -24,6 +24,12 @@ updates: directory: "/" schedule: interval: "daily" + - package-ecosystem: "devcontainers" + directory: "/" + schedule: + interval: "daily" + reviewers: + - "ministryofjustice/devcontainer-community" # Dependabot doesn't currently support wildcard or multiple directory declarations within # a dependabot configuration, so we need to add all directories individually # See: github.com/dependabot/dependabot-core/issues/2178