Skip to content

Commit 4b3303f

Browse files
authored
Merge branch 'main' into task/FTRS-3181-use-eventbridge-cmk
2 parents 97e7bcd + a46dcd7 commit 4b3303f

File tree

5 files changed

+102
-16
lines changed

5 files changed

+102
-16
lines changed

.github/workflows/pipeline-build-release.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,31 @@ jobs:
159159
ACCOUNT_ID: ${{ secrets.ACCOUNT_ID }}
160160
MGMT_ACCOUNT_ID: ${{ secrets.MGMT_ACCOUNT_ID }}
161161

162+
deploy-proxy-to-apim:
163+
name: "Deploy ${{ matrix.api_name }} API to Proxygen"
164+
needs:
165+
- metadata
166+
- tag-release
167+
- deploy-application-infrastructure
168+
uses: ./.github/workflows/authenticate-and-deploy-to-apim.yaml
169+
strategy:
170+
fail-fast: false
171+
matrix:
172+
api_name:
173+
- dos-search
174+
- dos-ingest
175+
# Add more API names here as needed
176+
with:
177+
environment: ${{ needs.metadata.outputs.environment }}
178+
workspace: "rc"
179+
api_name: ${{ matrix.api_name }}
180+
apim_env: ${{ needs.metadata.outputs.environment == 'dev' && 'internal-dev' || needs.metadata.outputs.environment == 'test' && 'internal-qa' || needs.metadata.outputs.environment }}
181+
ref: ${{ needs.tag-release.outputs.release_tag }}
182+
secrets:
183+
ACCOUNT_ID: ${{ secrets.ACCOUNT_ID }}
184+
AWS_REGION: ${{ vars.AWS_REGION }}
185+
PROXYGEN_URL: ${{ secrets.PROXYGEN_URL }}
186+
162187
restore-dynamodb-from-s3:
163188
name: "Restore S3 data to DynamoDB tables for release candidate in the ${{ needs.metadata.outputs.environment }} environment"
164189
if: ${{ needs.metadata.outputs.environment && needs.metadata.outputs.environment != 'prod' }}
@@ -247,6 +272,7 @@ jobs:
247272
- metadata
248273
- tag-release
249274
- deploy-data-migration-service
275+
- deploy-proxy-to-apim
250276
uses: ./.github/workflows/service-automation-test.yaml
251277
with:
252278
environment: ${{ needs.metadata.outputs.environment }}

.github/workflows/pipeline-deploy-account-infrastructure.yaml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ on:
2323
- "infrastructure/modules/aws-backup-source/**"
2424
- "infrastructure/modules/s3/**"
2525
- "infrastructure/modules/shield/**"
26-
- "infrastructure/stacks/slack_notifier/**"
2726
workflow_run:
2827
workflows: ["Pipeline Deploy Policies Infrastructure"]
2928
types:
@@ -148,6 +147,27 @@ jobs:
148147
workspace: "default"
149148
ref: ${{ inputs.ref }}
150149

150+
build-services:
151+
name: "Build slack-notifier"
152+
needs:
153+
- metadata
154+
- quality-checks
155+
- check-stack-toggles
156+
uses: ./.github/workflows/build-project.yaml
157+
with:
158+
name: "slack-notifier"
159+
build_type: "service"
160+
python_version: ${{ needs.metadata.outputs.python_version }}
161+
commit_hash: ${{ needs.metadata.outputs.commit_hash }}
162+
environment: ${{ needs.metadata.outputs.mgmt_environment }}
163+
repo_name: ${{ needs.metadata.outputs.reponame }}
164+
workspace: "default"
165+
type: account
166+
ref: ${{ inputs.ref }}
167+
build_enabled: ${{ needs.check-stack-toggles.outputs.slack_notifier_enabled == 'true' }}
168+
secrets:
169+
ACCOUNT_ID: ${{ secrets.ACCOUNT_ID }}
170+
151171
plan-infrastructure:
152172
name: "Plan ${{ matrix.name }} infrastructure deployment for ${{ matrix.environment }}"
153173
concurrency:
@@ -157,6 +177,7 @@ jobs:
157177
- metadata
158178
- quality-checks
159179
- check-stack-toggles
180+
- build-services
160181
strategy:
161182
fail-fast: false
162183
matrix:

.github/workflows/pipeline-deploy-application.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,6 @@ jobs:
9797
- name: "python"
9898
build_type: "package"
9999
build_enabled: true
100-
- name: "slack-notifier"
101-
build_type: "service"
102-
build_enabled: ${{ needs.check-stack-toggles.outputs.slack_notifier_enabled == 'true' }}
103100
- name: "crud-apis"
104101
build_type: "service"
105102
build_enabled: true
@@ -197,7 +194,7 @@ jobs:
197194
workspace: ${{ needs.metadata.outputs.workspace }}
198195
ref: ${{ inputs.ref }}
199196
workflow_timeout: 30
200-
stacks: "['slack_notifier', 'database', 'crud_apis', 'data_migration', 'read_only_viewer', 'opensearch', 'etl_ods', 'dos_search', 'is_performance', 'ui', 'athena']"
197+
stacks: "['database', 'crud_apis', 'data_migration', 'read_only_viewer', 'opensearch', 'etl_ods', 'dos_search', 'is_performance', 'ui', 'athena']"
201198
secrets:
202199
ACCOUNT_ID: ${{ secrets.ACCOUNT_ID }}
203200
MGMT_ACCOUNT_ID: ${{ secrets.MGMT_ACCOUNT_ID }}

.github/workflows/pipeline-deploy-release.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,29 @@ jobs:
120120
ACCOUNT_ID: ${{ secrets.ACCOUNT_ID }}
121121
MGMT_ACCOUNT_ID: ${{ secrets.MGMT_ACCOUNT_ID }}
122122

123+
deploy-proxy-to-apim:
124+
name: "Deploy ${{ matrix.api_name }} API to Proxygen"
125+
needs:
126+
- deploy-application-infrastructure
127+
uses: ./.github/workflows/authenticate-and-deploy-to-apim.yaml
128+
strategy:
129+
fail-fast: false
130+
matrix:
131+
api_name:
132+
- dos-search
133+
- dos-ingest
134+
# Add more API names here as needed
135+
with:
136+
environment: ${{ inputs.environment }}
137+
workspace: default
138+
api_name: ${{ matrix.api_name }}
139+
apim_env: ${{ inputs.environment == 'dev' && 'internal-dev' || inputs.environment == 'test' && 'internal-qa' || inputs.environment }}
140+
ref: ${{ inputs.release_tag }}
141+
secrets:
142+
ACCOUNT_ID: ${{ secrets.ACCOUNT_ID }}
143+
AWS_REGION: ${{ vars.AWS_REGION }}
144+
PROXYGEN_URL: ${{ secrets.PROXYGEN_URL }}
145+
123146
deploy-frontend-services:
124147
name: "Deploy ${{ matrix.name }} to ${{ inputs.environment }}"
125148
concurrency:
@@ -165,6 +188,7 @@ jobs:
165188
type: "bdd"
166189
needs:
167190
- deploy-application-infrastructure
191+
- deploy-proxy-to-apim
168192
uses: ./.github/workflows/service-automation-test.yaml
169193
with:
170194
environment: ${{ inputs.environment }}

infrastructure/stacks/account_wide/kms.tf

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -282,24 +282,42 @@ module "scheduler_encryption_key" {
282282
description = "Encryption key for EventBridge scheduler in ${var.environment} environment"
283283
additional_policy_statements = [
284284
{
285-
"Sid" : "AllowEventBridgeSchedulerToUseKMS",
286-
"Effect" : "Allow",
287-
"Principal" : {
288-
"Service" : "scheduler.amazonaws.com"
289-
},
290-
"Action" : [
285+
Sid = "AllowEventBridgeSchedulerToUseKMS"
286+
Effect = "Allow"
287+
Principal = {
288+
Service = ["scheduler.amazonaws.com"]
289+
}
290+
Action = [
291291
"kms:CreateGrant",
292292
"kms:RetireGrant",
293293
"kms:Decrypt",
294294
"kms:GenerateDataKey*",
295295
"kms:DescribeKey"
296-
],
297-
"Resource" : "*",
298-
"Condition" : {
299-
"StringEquals" : {
300-
"aws:SourceAccount" : data.aws_caller_identity.current.account_id
296+
]
297+
Resource = "*"
298+
Condition = {
299+
StringEquals = {
300+
"aws:SourceAccount" = data.aws_caller_identity.current.account_id
301301
}
302302
}
303+
},
304+
{
305+
Sid = "AllowGitHubRunnerAccess"
306+
Effect = "Allow"
307+
Principal = {
308+
AWS = [
309+
"arn:aws:iam::${data.aws_caller_identity.current.account_id}:role/${local.account_prefix}-${var.app_github_runner_role_name}",
310+
"arn:aws:iam::${data.aws_caller_identity.current.account_id}:role/${local.account_prefix}-${var.account_github_runner_role_name}"
311+
]
312+
}
313+
Action = [
314+
"kms:Decrypt",
315+
"kms:Encrypt",
316+
"kms:GenerateDataKey*",
317+
"kms:DescribeKey"
318+
]
319+
Resource = "*"
320+
Condition = {}
303321
}
304322
]
305323
}

0 commit comments

Comments
 (0)