Skip to content

Commit 2f8c952

Browse files
authored
Merge branch 'main' into dependabot/npm_and_yarn/js-yaml-3.14.2
2 parents d65d5ce + 368ce17 commit 2f8c952

File tree

11 files changed

+53
-20
lines changed

11 files changed

+53
-20
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
echo "TAG_FORMAT=$TAG_FORMAT" >> "$GITHUB_OUTPUT"
2929
3030
quality_checks:
31-
uses: NHSDigital/eps-common-workflows/.github/workflows/quality-checks.yml@a7daff06de7b695f601d9b1723ca184daca7d898
31+
uses: NHSDigital/eps-common-workflows/.github/workflows/quality-checks.yml@4fb41faab9c92d8a1444719bc1ab45a989caf756
3232
needs: [get_asdf_version]
3333
with:
3434
asdfVersion: ${{ needs.get_asdf_version.outputs.asdf_version }}

.github/workflows/pull_request.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ env:
1010
jobs:
1111
dependabot-auto-approve-and-merge:
1212
needs: quality_checks
13-
uses: NHSDigital/eps-common-workflows/.github/workflows/dependabot-auto-approve-and-merge.yml@a7daff06de7b695f601d9b1723ca184daca7d898
13+
uses: NHSDigital/eps-common-workflows/.github/workflows/dependabot-auto-approve-and-merge.yml@4fb41faab9c92d8a1444719bc1ab45a989caf756
1414
secrets:
1515
AUTOMERGE_APP_ID: ${{ secrets.AUTOMERGE_APP_ID }}
1616
AUTOMERGE_PEM: ${{ secrets.AUTOMERGE_PEM }}
@@ -33,15 +33,15 @@ jobs:
3333
echo "TAG_FORMAT=$TAG_FORMAT" >> "$GITHUB_OUTPUT"
3434
3535
quality_checks:
36-
uses: NHSDigital/eps-common-workflows/.github/workflows/quality-checks.yml@a7daff06de7b695f601d9b1723ca184daca7d898
36+
uses: NHSDigital/eps-common-workflows/.github/workflows/quality-checks.yml@4fb41faab9c92d8a1444719bc1ab45a989caf756
3737
needs: [get_asdf_version]
3838
with:
3939
asdfVersion: ${{ needs.get_asdf_version.outputs.asdf_version }}
4040
secrets:
4141
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
4242

4343
pr_title_format_check:
44-
uses: NHSDigital/eps-common-workflows/.github/workflows/pr_title_check.yml@a7daff06de7b695f601d9b1723ca184daca7d898
44+
uses: NHSDigital/eps-common-workflows/.github/workflows/pr_title_check.yml@4fb41faab9c92d8a1444719bc1ab45a989caf756
4545

4646
get_issue_number:
4747
runs-on: ubuntu-22.04

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
echo "TAG_FORMAT=$TAG_FORMAT" >> "$GITHUB_OUTPUT"
3333
3434
quality_checks:
35-
uses: NHSDigital/eps-common-workflows/.github/workflows/quality-checks.yml@a7daff06de7b695f601d9b1723ca184daca7d898
35+
uses: NHSDigital/eps-common-workflows/.github/workflows/quality-checks.yml@4fb41faab9c92d8a1444719bc1ab45a989caf756
3636
needs: [get_asdf_version]
3737
with:
3838
asdfVersion: ${{ needs.get_asdf_version.outputs.asdf_version }}

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,3 +130,6 @@ cdk-watch:
130130

131131
sync-docs:
132132
./scripts/sync_docs.sh
133+
134+
compile:
135+
echo "Does nothing currently"

package-lock.json

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"devDependencies": {
2020
"@semantic-release/changelog": "^6.0.3",
2121
"@semantic-release/release-notes-generator": "^14.1.0",
22-
"@types/aws-lambda": "^8.10.158",
22+
"@types/aws-lambda": "^8.10.159",
2323
"@types/jest": "^30.0.0",
2424
"@types/node": "^24.10.1",
2525
"@typescript-eslint/eslint-plugin": "^8.46.4",

packages/cdk/constructs/DelayResource.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def handler(event, context):
5858
print(f"Received event: {json.dumps(event, default=str)}")
5959
6060
try:
61-
if event["RequestType"] in ["Create", "Update"]:
61+
if event["RequestType"] in ["Create"]:
6262
wait_seconds = int(event["ResourceProperties"].get("WaitSeconds", 0))
6363
print(f"Waiting for {wait_seconds} seconds...")
6464
sleep(wait_seconds)

packages/cdk/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@
1919
},
2020
"devDependencies": {
2121
"@types/node": "^24.10.1",
22-
"aws-cdk": "^2.1031.2"
22+
"aws-cdk": "^2.1033.0"
2323
}
2424
}

packages/cdk/resources/OpenSearchResources.ts

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import {
55
VectorCollection,
66
VectorCollectionStandbyReplicas
77
} from "@cdklabs/generative-ai-cdk-constructs/lib/cdk-lib/opensearchserverless"
8+
import {generatePhysicalNameV2} from "@cdklabs/generative-ai-cdk-constructs/lib/common/helpers/utils"
9+
import {CfnAccessPolicy} from "aws-cdk-lib/aws-opensearchserverless"
810

911
export interface OpenSearchResourcesProps {
1012
readonly stackName: string
@@ -15,6 +17,7 @@ export interface OpenSearchResourcesProps {
1517

1618
export class OpenSearchResources extends Construct {
1719
public readonly collection: VectorCollection
20+
public readonly deploymentPolicy: CfnAccessPolicy
1821

1922
constructor(scope: Construct, id: string, props: OpenSearchResourcesProps) {
2023
super(scope, id)
@@ -31,7 +34,34 @@ export class OpenSearchResources extends Construct {
3134

3235
// Grant access to the Bedrock execution role
3336
this.collection.grantDataAccess(props.bedrockExecutionRole)
34-
this.collection.grantDataAccess(props.cdkExecutionRole)
37+
38+
// Grant access to the CDK execution role for deployment operations
39+
const dataAccessPolicyName = generatePhysicalNameV2(this,
40+
"DataAccessPolicy",
41+
{maxLength: 32, lower: true})
42+
const dataAccessPolicyDocument = [{
43+
Rules: [
44+
{
45+
Resource: [`index/${this.collection.collectionName}/*`],
46+
Permission: [
47+
"aoss:UpdateIndex",
48+
"aoss:DescribeIndex",
49+
"aoss:CreateIndex",
50+
"aoss:DeleteIndex"
51+
],
52+
ResourceType: "index"
53+
}
54+
],
55+
Principal: [
56+
props.cdkExecutionRole.roleArn
57+
],
58+
Description: ""
59+
}]
60+
this.deploymentPolicy = new CfnAccessPolicy(this, "DataAccessPolicy", {
61+
name: dataAccessPolicyName,
62+
type: "data",
63+
policy: JSON.stringify(dataAccessPolicyDocument)
64+
})
3565

3666
}
3767
}

packages/cdk/resources/VectorIndex.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export class VectorIndex extends Construct {
7070
// a fix for an annoying time sync issue that adds a small delay
7171
// to ensure data access policies are synced before index creation
7272
const policySyncWait = new DelayResource(this, "PolicySyncWait", {
73-
delaySeconds: 15,
73+
delaySeconds: 60,
7474
description: "Wait for OpenSearch data access policies to sync"
7575
})
7676

@@ -84,7 +84,7 @@ export class VectorIndex extends Construct {
8484
// a fix for an annoying time sync issue that adds a small delay
8585
// to ensure index is actually available for Bedrock
8686
const indexReadyWait = new DelayResource(this, "IndexReadyWait", {
87-
delaySeconds: 30,
87+
delaySeconds: 60,
8888
description: "Wait for OpenSearch index to be fully available"
8989
})
9090

0 commit comments

Comments
 (0)