-
Notifications
You must be signed in to change notification settings - Fork 1
Chore: [AEA-0000] - use new exports #2266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,14 +6,23 @@ echo "$COMMIT_ID" | |
| AWS_MAX_ATTEMPTS=10 | ||
| export AWS_MAX_ATTEMPTS | ||
|
|
||
| artifact_bucket=$(aws cloudformation list-exports --output json | jq -r '.Exports[] | select(.Name == "account-resources:ArtifactsBucket") | .Value' | grep -o '[^:]*$') | ||
| CF_LONDON_EXPORTS=$(aws cloudformation list-exports --region eu-west-2 --output json) | ||
| # change this to account-resources-cdk-uk:Bucket:ArtifactsBucket:Arn once other change is merged | ||
| artifact_bucket_arn=$(echo "$CF_LONDON_EXPORTS" | \ | ||
| jq \ | ||
| --arg EXPORT_NAME "account-resources:ArtifactsBucket" \ | ||
| -r '.Exports[] | select(.Name == $EXPORT_NAME) | .Value') | ||
| artifact_bucket=$(echo "$artifact_bucket_arn" | cut -d: -f6 | cut -d/ -f1) | ||
| if [ -z "${artifact_bucket}" ]; then | ||
| echo "could not retrieve artifact_bucket from aws cloudformation list-exports" | ||
| exit 1 | ||
| fi | ||
| export artifact_bucket | ||
|
|
||
| cloud_formation_execution_role=$(aws cloudformation list-exports --output json | jq -r '.Exports[] | select(.Name == "ci-resources:CloudFormationExecutionRole") | .Value' ) | ||
| cloud_formation_execution_role=$(echo "$CF_LONDON_EXPORTS" | \ | ||
| jq \ | ||
| --arg EXPORT_NAME "iam-cdk:IAM:CloudFormationExecutionRole:Arn" \ | ||
| -r '.Exports[] | select(.Name == $EXPORT_NAME) | .Value') | ||
| if [ -z "${cloud_formation_execution_role}" ]; then | ||
|
Comment on lines
+22
to
26
|
||
| echo "could not retrieve cloud_formation_execution_role from aws cloudformation list-exports" | ||
| exit 1 | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -152,7 +152,7 @@ Resources: | |||||
| Effect: Allow | ||||||
| Principal: | ||||||
| AWS: | ||||||
| - !ImportValue ci-resources:CloudFormationExecutionRole | ||||||
| - !ImportValue iam-cdk:IAM:CloudFormationExecutionRole:Arn | ||||||
| - !Sub arn:aws:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-eu-west-2 | ||||||
| Action: | ||||||
| - kms:DescribeKey | ||||||
|
|
@@ -255,9 +255,9 @@ Resources: | |||||
| Type: AWS::IAM::ManagedPolicy | ||||||
| Properties: | ||||||
| Roles: | ||||||
| - !ImportValue ci-resources:CloudFormationExecutionRoleName | ||||||
| - !ImportValue ci-resources:CloudFormationPrepareChangesetRoleName | ||||||
| - !ImportValue ci-resources:CloudFormationDeployRoleName | ||||||
| - !ImportValue iam-cdk:IAM:CloudFormationExecutionRole:Name | ||||||
| - !ImportValue iam-cdk:IAM:CloudFormationPrepareChangesetRole:Name | ||||||
| - !ImportValue iam-cdk:IAM:CloudFormationDeployRole:Name | ||||||
| PolicyDocument: | ||||||
| Version: 2012-10-17 | ||||||
| Statement: | ||||||
|
|
@@ -326,9 +326,9 @@ Resources: | |||||
| - Effect: Allow | ||||||
| Principal: | ||||||
| AWS: | ||||||
| - !ImportValue ci-resources:CloudFormationDeployRole | ||||||
| - !ImportValue ci-resources:CloudFormationExecutionRole | ||||||
| - !ImportValue ci-resources:CloudFormationPrepareChangesetRole | ||||||
| - !ImportValue iam-cdk:IAM:CloudFormationDeployRole:Arn | ||||||
| - !ImportValue iam-cdk:IAM:CloudFormationExecutionRole:Arn | ||||||
| - !ImportValue iam-cdk:IAM:CloudFormationPrepareChangesetRole:Arn | ||||||
| Action: | ||||||
| - s3:GetObject* | ||||||
| - s3:PutObject* | ||||||
|
|
@@ -340,7 +340,7 @@ Resources: | |||||
| - Effect: Allow | ||||||
| Principal: | ||||||
| AWS: | ||||||
| - !ImportValue ci-resources:CloudFormationDeployRole | ||||||
| - !ImportValue ciam-cdk:IAM:CloudFormationDeployRole:Arn | ||||||
|
||||||
| - !ImportValue ciam-cdk:IAM:CloudFormationDeployRole:Arn | |
| - !ImportValue iam-cdk:IAM:CloudFormationDeployRole:Arn |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -149,34 +149,34 @@ Resources: | |||||
| Action: | ||||||
| - secretsmanager:GetSecretValue | ||||||
| Resource: | ||||||
| - !ImportValue account-resources:PfpClientKeySecret | ||||||
| - !ImportValue account-resources:PfpClientCertSecret | ||||||
| - !ImportValue account-resources:PfpClientSandboxKeySecret | ||||||
| - !ImportValue account-resources:PfpClientSandboxCertSecret | ||||||
| - !ImportValue account-resources:PsuClientKeySecret | ||||||
| - !ImportValue account-resources:PsuClientSandboxKeySecret | ||||||
| - !ImportValue account-resources:PsuCACertSecret | ||||||
| - !ImportValue account-resources:PsuCAKeySecret | ||||||
| - !ImportValue account-resources:PsuClientCertSecret | ||||||
| - !ImportValue account-resources:PsuClientSandboxCertSecret | ||||||
| - !ImportValue account-resources:PSUProxygenPrivateKey | ||||||
| - !ImportValue account-resources:PSUProxygenPublicKey | ||||||
| - !ImportValue account-resources:CPSUProxygenPrivateKey | ||||||
| - !ImportValue account-resources:CPSUProxygenPublicKey | ||||||
| - !ImportValue account-resources:ClinicalTrackerClientKeySecret | ||||||
| - !ImportValue account-resources:ClinicalTrackerClientSandboxKeySecret | ||||||
| - !ImportValue account-resources:ClinicalTrackerCACertSecret | ||||||
| - !ImportValue account-resources:ClinicalTrackerCAKeySecret | ||||||
| - !ImportValue account-resources:ClinicalTrackerClientCertSecret | ||||||
| - !ImportValue account-resources:ClinicalTrackerClientSandboxCertSecret | ||||||
| - !ImportValue account-resources:ClinicalTrackerProxygenPrivateKey | ||||||
| - !ImportValue account-resources:ClinicalTrackerProxygenPublicKey | ||||||
| - !ImportValue account-resources:FhirFacadeClientKeySecret | ||||||
| - !ImportValue account-resources:FhirFacadeClientSandboxKeySecret | ||||||
| - !ImportValue account-resources:FhirFacadeCACertSecret | ||||||
| - !ImportValue account-resources:FhirFacadeCAKeySecret | ||||||
| - !ImportValue account-resources:FhirFacadeClientCertSecret | ||||||
| - !ImportValue account-resources:FhirFacadeClientSandboxCertSecret | ||||||
| - !ImportValue secrets-cdk:Secrets:PfpClientKeySecret:Arn | ||||||
| - !ImportValue secrets-cdk:Secrets:PfpClientSandboxCertSecret:Arn | ||||||
|
||||||
| - !ImportValue secrets-cdk:Secrets:PfpClientSandboxCertSecret:Arn | |
| - !ImportValue secrets-cdk:Secrets:PfpClientCertSecret:Arn |
Copilot
AI
Apr 27, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PSU sandbox secret imports appear incorrect: PsuClientSandboxKeySecret is missing, while PsuClientSandboxCertSecret is listed twice. This will grant permissions to the wrong set of secrets and may break workflows that expect access to the sandbox key secret.
| - !ImportValue secrets-cdk:Secrets:PsuClientSandboxCertSecret:Arn | |
| - !ImportValue secrets-cdk:Secrets:PsuClientSandboxKeySecret:Arn |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jq -rreturns the literal stringnullwhen the export name is not found, and the current-zcheck won’t catch that. Add a guard that also treatsnull(and ideally non-ARN values) as failure before deriving the bucket name, otherwise the script can proceed with an invalid bucket and fail later in less obvious ways.