Skip to content

Commit 451bee9

Browse files
committed
use new exports
1 parent 5d9767d commit 451bee9

4 files changed

Lines changed: 21 additions & 12 deletions

File tree

.github/scripts/release_code.sh

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,23 @@
11
#!/usr/bin/env bash
22

33
echo "$COMMIT_ID"
4-
5-
artifact_bucket=$(aws cloudformation list-exports --output json | jq -r '.Exports[] | select(.Name == "account-resources:ArtifactsBucket") | .Value' | grep -o '[^:]*$')
4+
CF_LONDON_EXPORTS=$(aws cloudformation list-exports --region eu-west-2 --output json)
5+
artifact_bucket=$(echo "$CF_LONDON_EXPORTS" | \
6+
jq \
7+
--arg EXPORT_NAME "account-resources-cdk-uk:Bucket:ArtifactsBucket:Arn" \
8+
-r '.Exports[] | select(.Name == $EXPORT_NAME) | .Value')
69
export artifact_bucket
710

8-
cloud_formation_execution_role=$(aws cloudformation list-exports --output json | jq -r '.Exports[] | select(.Name == "ci-resources:CloudFormationExecutionRole") | .Value' )
11+
cloud_formation_execution_role=$(echo "$CF_LONDON_EXPORTS" | \
12+
jq \
13+
--arg EXPORT_NAME "iam-cdk:IAM:CloudFormationExecutionRole:Arn" \
14+
-r '.Exports[] | select(.Name == $EXPORT_NAME) | .Value')
915
export cloud_formation_execution_role
1016

11-
TRUSTSTORE_BUCKET_ARN=$(aws cloudformation describe-stacks --stack-name account-resources --query "Stacks[0].Outputs[?OutputKey=='TrustStoreBucket'].OutputValue" --output text)
17+
TRUSTSTORE_BUCKET_ARN=$(echo "$CF_LONDON_EXPORTS" | \
18+
jq \
19+
--arg EXPORT_NAME "account-resources-cdk-uk:Bucket:TrustStoreBucket:Arn" \
20+
-r '.Exports[] | select(.Name == $EXPORT_NAME) | .Value')
1221
TRUSTSTORE_BUCKET_NAME=$(echo "${TRUSTSTORE_BUCKET_ARN}" | cut -d ":" -f 6)
1322
LATEST_TRUSTSTORE_VERSION=$(aws s3api list-object-versions --bucket "${TRUSTSTORE_BUCKET_NAME}" --prefix "${TRUSTSTORE_FILE}" --query 'Versions[?IsLatest].[VersionId]' --output text)
1423
export LATEST_TRUSTSTORE_VERSION

SAMtemplates/alarms/main.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ Resources:
4444
TreatMissingData: notBreaching
4545
ActionsEnabled: !Ref EnableAlerts
4646
AlarmActions:
47-
- !ImportValue lambda-resources:SlackAlertsSnsTopicArn
47+
- !ImportValue account-resources-cdk-uk:SNS:SlackAlertsSnsTopicArn:Arn
4848
InsufficientDataActions:
49-
- !ImportValue lambda-resources:SlackAlertsSnsTopicArn
49+
- !ImportValue account-resources-cdk-uk:SNS:SlackAlertsSnsTopicArn:Arn
5050
OKActions:
51-
- !ImportValue lambda-resources:SlackAlertsSnsTopicArn
51+
- !ImportValue account-resources-cdk-uk:SNS:SlackAlertsSnsTopicArn:Arn

SAMtemplates/lambda_resources.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ Resources:
8787
Service: "lambda.amazonaws.com"
8888
Action: "sts:AssumeRole"
8989
ManagedPolicyArns:
90-
- !ImportValue lambda-resources:LambdaInsightsLogGroupPolicy
91-
- !ImportValue account-resources:LambdaEncryptCloudwatchKMSPolicy
90+
- !ImportValue account-resources-cdk-uk:IAM:LambdaInsightsLogGroupPolicy:Arn
91+
- !ImportValue account-resources-cdk-uk:IAM:LambdaEncryptCloudwatchKMSPolicy:Arn
9292

9393
LambdaManagedPolicy:
9494
Type: AWS::IAM::ManagedPolicy

SAMtemplates/main_template.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ Resources:
5151
Location: lambda_resources.yaml
5252
Parameters:
5353
StackName: !Ref AWS::StackName
54-
CloudWatchKMSKey: !ImportValue account-resources:CloudwatchLogsKmsKeyArn
55-
SplunkSubscriptionFilterRole: !ImportValue lambda-resources:SplunkSubscriptionFilterRole
56-
SplunkDeliveryStream: !ImportValue lambda-resources:SplunkDeliveryStream
54+
CloudWatchKMSKey: !ImportValue account-resources-cdk-uk:KMS:CloudwatchLogsKmsKey:Arn
55+
SplunkSubscriptionFilterRole: !ImportValue account-resources-cdk-uk:IAM:SplunkSubscriptionFilterRole:Arn
56+
SplunkDeliveryStream: !ImportValue laaccount-resources-cdk-uk:Firehose:SplunkDeliveryStream:Arn
5757
EnableSplunk: "true"
5858
LambdaName: !Sub "${AWS::StackName}-FHIRValidatorUKCore"
5959
LambdaArn: !Sub arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:${AWS::StackName}-FHIRValidatorUKCore

0 commit comments

Comments
 (0)