From cb06a021177a6419748db880694bef16aabaaa85 Mon Sep 17 00:00:00 2001
From: Manish Jangid <msjangid@amazon.com>
Date: Wed, 19 Apr 2023 21:56:46 +0000
Subject: [PATCH] Removing resourcePrefix usage

---
 .../chart/templates/serviceparameters.yaml    |  4 +
 devops/aws/chart/values.yaml                  | 88 +------------------
 provider/notification-aws/pom.xml             |  8 +-
 .../src/main/resources/application.properties |  3 -
 4 files changed, 12 insertions(+), 91 deletions(-)
 create mode 100644 devops/aws/chart/templates/serviceparameters.yaml

diff --git a/devops/aws/chart/templates/serviceparameters.yaml b/devops/aws/chart/templates/serviceparameters.yaml
new file mode 100644
index 000000000..db735ba41
--- /dev/null
+++ b/devops/aws/chart/templates/serviceparameters.yaml
@@ -0,0 +1,4 @@
+{{- template "common.serviceparameters" (list . "os-notification.serviceparameters") -}}
+{{- define "os-notification.serviceparameters" -}}
+## Define overrides for the service parameters here
+{{- end -}}
\ No newline at end of file
diff --git a/devops/aws/chart/values.yaml b/devops/aws/chart/values.yaml
index 074aadecf..2db1c01d3 100644
--- a/devops/aws/chart/values.yaml
+++ b/devops/aws/chart/values.yaml
@@ -1,87 +1 @@
-# Service Config
-image: __CONTAINER__
-imagePullPolicy: Always
-service:
-  type: ClusterIP
-  port: 8080
-  apiPath: /api/notification/v1/
-  readinessProbeHttpPath: /api/notification/v1/actuator/health
-  livenessProbeHttpPath: /api/notification/v1/actuator/health
-
-environmentVariables:
-  - name: APPLICATION_PORT
-    value: "{{ .Values.service.port }}"
-  - name: AWS_REGION
-    value: "{{ .Values.global.region }}"
-  - name: RESOURCE_PREFIX
-    value: "{{ .Values.global.resourcePrefix }}"
-  - name: JAVA_OPTS
-    value: "-Xms538M -Xmx900M"
-  - name: LOG_LEVEL
-    value: "{{ default `INFO` .Values.global.logLevel }}"
-  - name: SSM_ENABLED
-    value: "True"
-  - name: SSL_ENABLED
-    value: "false"
-  - name: ENTITLEMENTS_BASE_URL
-    value: "http://os-entitlements:8080"
-  - name: REGISTER_BASE_URL
-    value: http://os-register:8080
-  - name: TMP_VOLUME_PATH
-    value: "/tmp"
-  - name: PARTITION_BASE_URL
-    value: http://os-partition:8080
-
-# Resource Config
-replicaCount: 1
-resources:
-  limits:
-    memory: 900M
-  requests:
-    cpu: 500m
-    memory: 900M
-autoscaling:
-  enabled: true
-  minReplicas: 1
-  maxReplicas: 100
-  targetCPUUtilizationPercentage: 80
-  # targetMemoryUtilizationPercentage: 80
-
-# Security Config
-serviceAccountRole: arn:aws:iam::{{ .Values.global.accountID }}:role/osdu-{{ .Values.global.resourcePrefix }}-{{ .Values.global.region }}-{{ include "common.name" . }}
-cors:
-  maxAge: "60m"
-  allowCredentials: true
-  allowMethods: 
-    - POST
-    - GET
-    - PATCH
-    - PUT
-    - DELETE
-  allowHeaders:
-    - Authorization
-    - Data-Partition-Id
-    - Correlation-Id
-    - Content-Type
-securityContext: 
-  runAsUser: 10001
-  runAsNonRoot: true
-  readOnlyRootFilesystem: true
-  allowPrivilegeEscalation: false
-  capabilities:
-    drop:
-    - ALL
-podSecurityContext: 
-  fsGroup: 1337
-  seccompProfile:
-    type: RuntimeDefault
-
-allowedPrincipals:
-  - cluster.local/ns/istio-system/sa/istio-ingressgateway
-  - cluster.local/ns/aws-binary-dms/sa/binary-dms
-  - cluster.local/ns/osdu-airflow/sa/airflow-dag-upload
-  - cluster.local/ns/osdu-ingest/sa/os-data-workflow
-  - cluster.local/ns/osdu-ingest/sa/os-ingestion-workflow
-  - cluster.local/ns/osdu-seismic-ddms/sa/os-seismic-store
-  - cluster.local/ns/osdu-well-delivery/sa/os-welldelivery
-  - cluster.local/ns/osdu-wellbore-ddms/sa/os-wellbore-ddms
+image: __CONTAINER__
\ No newline at end of file
diff --git a/provider/notification-aws/pom.xml b/provider/notification-aws/pom.xml
index 55ac703c5..72ae544ec 100644
--- a/provider/notification-aws/pom.xml
+++ b/provider/notification-aws/pom.xml
@@ -76,7 +76,13 @@
         <dependency>
             <groupId>org.opengroup.osdu.core.aws</groupId>
             <artifactId>os-core-lib-aws</artifactId>
-            <version>0.21.0-rc1</version>
+            <version>0.21.0-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>commons-io</groupId>
+            <artifactId>commons-io</artifactId>
+            <version>2.11.0</version>
+            <scope>compile</scope>
         </dependency>
 
         <!-- https://mvnrepository.com/artifact/com.amazonaws/aws-java-sdk-secretsmanager -->
diff --git a/provider/notification-aws/src/main/resources/application.properties b/provider/notification-aws/src/main/resources/application.properties
index 57c8d48c4..aba3d634a 100644
--- a/provider/notification-aws/src/main/resources/application.properties
+++ b/provider/notification-aws/src/main/resources/application.properties
@@ -22,9 +22,6 @@ PARTITION_API=${PARTITION_BASE_URL}/api/partition/v1
 REGISTER_SERVICE_URL=${REGISTER_BASE_URL}/api/register/v1
 
 aws.ssm=${SSM_ENABLED:True}
-aws.environment=${RESOURCE_PREFIX}
-aws.parameter.prefix=/osdu/${RESOURCE_PREFIX}
-aws.primary.region=${aws.parameter.prefix}/primary-region
 
 app.expireTime=300
 app.maxCacheSize=10
-- 
GitLab