Skip to content
Open
Show file tree
Hide file tree
Changes from 38 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
b0b180e
fix(spec2cdk): Add grants.json path mapping for alpha modules
irem-kaya Feb 12, 2026
e2f7612
fix(spec2cdk): Add grants.json path mapping for alpha modules
irem-kaya Feb 12, 2026
c7221c6
Merge branch 'main' into fix/grants-json-alpha-modules
irem-kaya Feb 12, 2026
1d919f5
Merge branch 'main' into fix/grants-json-alpha-modules
irem-kaya Feb 12, 2026
327b277
Merge branch 'main' into fix/grants-json-alpha-modules
irem-kaya Feb 12, 2026
d68d137
Merge branch 'main' into fix/grants-json-alpha-modules
irem-kaya Feb 13, 2026
23941b2
Merge branch 'main' into fix/grants-json-alpha-modules
irem-kaya Feb 14, 2026
d42acbd
Update grants.test.ts
irem-kaya Feb 14, 2026
4058bd4
Merge branch 'main' into fix/grants-json-alpha-modules
irem-kaya Feb 15, 2026
efc0cb0
Merge branch 'main' into fix/grants-json-alpha-modules
irem-kaya Feb 16, 2026
0c453f1
Update generate.ts
irem-kaya Feb 16, 2026
97917ab
Update generate.ts
irem-kaya Feb 16, 2026
d152450
Update grants.test.ts
irem-kaya Feb 19, 2026
f34343a
Update grants.test.ts
irem-kaya Feb 19, 2026
f8b0f71
Merge branch 'main' into fix/grants-json-alpha-modules
irem-kaya Feb 19, 2026
74db739
Update grants.test.ts
irem-kaya Feb 19, 2026
db04511
Merge branch 'main' into fix/grants-json-alpha-modules
irem-kaya Feb 19, 2026
fdf40af
Merge branch 'main' into fix/grants-json-alpha-modules
irem-kaya Feb 24, 2026
7a56f32
Merge branch 'main' into fix/grants-json-alpha-modules
irem-kaya Feb 25, 2026
b4ebc01
Merge branch 'main' into fix/grants-json-alpha-modules
irem-kaya Feb 26, 2026
3ae1704
Update grants.test.ts
irem-kaya Mar 5, 2026
2ea90e2
Update generate.ts
irem-kaya Mar 5, 2026
dcc5e8d
Merge branch 'main' into fix/grants-json-alpha-modules
irem-kaya Mar 5, 2026
6418179
Update request-cli-integ-test.yml
irem-kaya Mar 5, 2026
1d0651a
Merge branch 'main' into fix/grants-json-alpha-modules
irem-kaya Mar 5, 2026
10ffcd8
Update generate.ts
irem-kaya Mar 6, 2026
4e311ee
Merge branch 'main' into fix/grants-json-alpha-modules
irem-kaya Mar 6, 2026
e0eb404
Merge branch 'main' into fix/grants-json-alpha-modules
irem-kaya Mar 9, 2026
f42c651
Merge branch 'main' into fix/grants-json-alpha-modules
irem-kaya Mar 10, 2026
a4d460d
Merge branch 'main' into fix/grants-json-alpha-modules
irem-kaya Mar 12, 2026
9630649
Merge branch 'main' into fix/grants-json-alpha-modules
irem-kaya Mar 13, 2026
baff1b2
Create elasticache-grants.generated.ts
irem-kaya Mar 13, 2026
41a0265
Update elasticache-grants.generated.ts
irem-kaya Mar 14, 2026
47c9010
Update elasticache-grants.generated.ts
irem-kaya Mar 14, 2026
4fa21eb
Update generate.ts
irem-kaya Mar 14, 2026
b8dce16
Merge branch 'main' into fix/grants-json-alpha-modules
irem-kaya Mar 16, 2026
8accff5
Merge branch 'main' into fix/grants-json-alpha-modules
irem-kaya Mar 18, 2026
9538154
Merge branch 'aws:main' into fix/grants-json-alpha-modules
irem-kaya Mar 26, 2026
2f80d83
Merge branch 'main' into fix/grants-json-alpha-modules
irem-kaya Mar 29, 2026
b139a78
Merge branch 'main' into fix/grants-json-alpha-modules
irem-kaya Mar 31, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions .github/workflows/request-cli-integ-test.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Request a deployment to the test pipeline

name: request-cli-integ-test
on:
pull_request_target:
Expand All @@ -9,10 +8,6 @@ on:
- reopened
- labeled
- unlabeled

permissions:
contents: read

jobs:
cli-changes:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -46,7 +41,6 @@ jobs:
- approve-test-pipeline
- cli-changes
runs-on: ubuntu-latest
environment: automation
steps:
- name: Checkout
uses: actions/checkout@v6
Expand All @@ -65,7 +59,6 @@ jobs:
with:
message: |
:arrow_right: **PR build request submitted to `test-main-pipeline`** :arrow_left:

A maintainer must now check the pipeline and add the `pr-linter/cli-integ-tested` label once the pipeline succeeds.
comment-tag: request-cli-integ-test
mode: recreate
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// This file is auto-generated. Do not edit it by hand.
// Generated by @aws-cdk/spec2cdk

import * as iam from 'aws-cdk-lib/aws-iam';
import * as cdk from 'aws-cdk-lib/core';
import * as elasticache from 'aws-cdk-lib/aws-elasticache';
import type { IServerlessCacheRef } from 'aws-cdk-lib/interfaces/generated/aws-elasticache-interfaces.generated';

/**
* Properties for ServerlessCacheGrants
*/
interface ServerlessCacheGrantsProps {
/** The resource on which actions will be allowed */
readonly resource: IServerlessCacheRef;
}

/**
* Collection of grant methods for a IServerlessCacheRef
*/
export class ServerlessCacheGrants {
protected readonly resource: IServerlessCacheRef;

private constructor(props: ServerlessCacheGrantsProps) {
this.resource = props.resource;
}

/**
* Creates grants for ServerlessCacheGrants
*/
public static fromServerlessCache(resource: IServerlessCacheRef): ServerlessCacheGrants {
return new ServerlessCacheGrants({ resource });
}

/**
* Grant the given identity custom permissions
*/
public actions(grantee: iam.IGrantable, actions: string[], options: cdk.PermissionsOptions = {}): iam.Grant {
const result = iam.Grant.addToPrincipal({
actions,
grantee,
resourceArns: options.resourceArns ?? [elasticache.CfnServerlessCache.arnForServerlessCache(this.resource)],
});
return result;
}

/**
* Grant connect permissions to the cache
*/
public connect(grantee: iam.IGrantable): iam.Grant {
const actions = ['elasticache:Connect', 'elasticache:DescribeServerlessCaches'];
return this.actions(grantee, actions, {});
}
}
15 changes: 14 additions & 1 deletion tools/@aws-cdk/spec2cdk/lib/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { queryDb, log, TsFileWriter } from './util';
export type BuilderProps<T> = T extends new (first: infer P, ...args: any[]) => any ? P : never;

export interface GenerateServiceRequest {

/**
* The namespace of the service to generate files for.
* In CloudFormation notation.
Expand Down Expand Up @@ -279,7 +280,19 @@ function mergeObjects<T>(all: T, res: T) {
}

function grantsConfigForModule(moduleName: string, modulePath: string, isStable: boolean): string | undefined {
const grantsFileLocation = isStable ? path.join(modulePath, moduleName) : path.join(modulePath, '..', `${moduleName}-alpha`);
// Mapping for alpha modules with non-standard directory names
const grantsJsonPathOverrides: { [key: string]: string } = {
'aws-bedrockagentcore': 'aws-bedrock-agentcore-alpha',
};

const actualModuleName = isStable
? (grantsJsonPathOverrides[moduleName] || moduleName)
: (grantsJsonPathOverrides[moduleName] || `${moduleName}-alpha`);

const grantsFileLocation = isStable
? path.join(modulePath, actualModuleName)
: path.join(modulePath, '..', actualModuleName);

const config = readGrantsConfig(grantsFileLocation);
return config == null ? undefined : config;
}
Expand Down
6 changes: 3 additions & 3 deletions tools/@aws-cdk/spec2cdk/test/grants.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ test('generates grants for methods with and without key actions', async () => {
},
},
};
const service = db.lookup('service', 'name', 'equals', 'aws-sns').only();
const module = new GrantsModule(service, db, config, 'aws-cdk-lib/aws-iam', true, 'aws-cdk-lib/core');

const service = db.lookup('service', 'name', 'equals', 'aws-sns').only();
const module = new GrantsModule(service, db, config, 'aws-cdk-lib/aws-iam', true);
const scope = new Module('@aws-cdk/aws-sns');
const refInterface = new InterfaceType(scope, {
export: true,
Expand All @@ -49,7 +49,7 @@ test('generates grants for methods with and without key actions', async () => {
ref: {
interfaceType: refInterface.type,
property: refInterface.properties[0],
struct: {} as unknown as StructType, // FIXME What should go here?
struct: {} as unknown as StructType,
},
},
});
Expand Down
Loading