Skip to content

Commit 0632262

Browse files
committed
Merge branch 'main' into fix-integ-runner-region-deployment
2 parents ce64d99 + 72d3e6f commit 0632262

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+282
-252
lines changed

packages/@aws-cdk/aws-bedrock-agentcore-alpha/agentcore/gateway/perms.ts

Lines changed: 0 additions & 124 deletions
This file was deleted.

packages/@aws-cdk/aws-bedrock-agentcore-alpha/agentcore/index.ts

Lines changed: 0 additions & 60 deletions
This file was deleted.

packages/@aws-cdk/aws-bedrock-agentcore-alpha/agentcore/gateway/gateway-base.ts renamed to packages/@aws-cdk/aws-bedrock-agentcore-alpha/lib/gateway/gateway-base.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import * as kms from 'aws-cdk-lib/aws-kms';
55
import { Construct } from 'constructs';
66
// Internal imports
77
import { IGatewayAuthorizerConfig } from './inbound-auth/authorizer';
8-
import { GatewayPerms } from './perms';
8+
import { GATEWAY_GET_PERMS, GATEWAY_LIST_PERMS, GATEWAY_MANAGE_PERMS, GATEWAY_INVOKE_PERMS } from './perms';
99
import { IGatewayProtocolConfig } from './protocol';
1010

1111
/******************************************************************************
@@ -269,12 +269,12 @@ export abstract class GatewayBase extends Resource implements IGateway {
269269
* @param grantee The principal to grant read permissions to
270270
*/
271271
public grantRead(grantee: iam.IGrantable): iam.Grant {
272-
const resourceSpecificGrant = this.grant(grantee, ...GatewayPerms.GET_PERMS);
272+
const resourceSpecificGrant = this.grant(grantee, ...GATEWAY_GET_PERMS);
273273

274274
const allResourceGrant = iam.Grant.addToPrincipal({
275275
grantee: grantee,
276276
resourceArns: ['*'],
277-
actions: [...GatewayPerms.LIST_PERMS],
277+
actions: [...GATEWAY_LIST_PERMS],
278278
});
279279
// Return combined grant
280280
return resourceSpecificGrant.combine(allResourceGrant);
@@ -286,7 +286,7 @@ export abstract class GatewayBase extends Resource implements IGateway {
286286
* @param grantee The principal to grant manage permissions to
287287
*/
288288
public grantManage(grantee: iam.IGrantable): iam.Grant {
289-
return this.grant(grantee, ...GatewayPerms.MANAGE_PERMS);
289+
return this.grant(grantee, ...GATEWAY_MANAGE_PERMS);
290290
}
291291

292292
/**
@@ -295,7 +295,7 @@ export abstract class GatewayBase extends Resource implements IGateway {
295295
* @param grantee The principal to grant invoke permissions to
296296
*/
297297
public grantInvoke(grantee: iam.IGrantable): iam.Grant {
298-
return this.grant(grantee, ...GatewayPerms.INVOKE_PERMS);
298+
return this.grant(grantee, ...GATEWAY_INVOKE_PERMS);
299299
}
300300

301301
// ------------------------------------------------------

packages/@aws-cdk/aws-bedrock-agentcore-alpha/agentcore/gateway/gateway.ts renamed to packages/@aws-cdk/aws-bedrock-agentcore-alpha/lib/gateway/gateway.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { Construct } from 'constructs';
1111
import { GatewayBase, GatewayExceptionLevel, IGateway } from './gateway-base';
1212
import { GatewayAuthorizer, IGatewayAuthorizerConfig } from './inbound-auth/authorizer';
1313
import { ICredentialProviderConfig } from './outbound-auth/credential-provider';
14-
import { GatewayPerms } from './perms';
14+
import { GATEWAY_ASSUME_ROLE, GATEWAY_KMS_KEY_PERMS } from './perms';
1515
import { IGatewayProtocolConfig, McpGatewaySearchType, McpProtocolConfiguration, MCPProtocolVersion } from './protocol';
1616
import { ApiSchema } from './targets/schema/api-schema';
1717
import { ToolSchema } from './targets/schema/tool-schema';
@@ -585,7 +585,7 @@ export class Gateway extends GatewayBase {
585585
new iam.PolicyStatement({
586586
effect: iam.Effect.ALLOW,
587587
principals: [new iam.ServicePrincipal('bedrock-agentcore.amazonaws.com')],
588-
actions: GatewayPerms.ASSUME_ROLE,
588+
actions: GATEWAY_ASSUME_ROLE,
589589
conditions: {
590590
StringEquals: {
591591
'aws:SourceAccount': account,
@@ -600,7 +600,7 @@ export class Gateway extends GatewayBase {
600600
if (this.kmsKey) {
601601
role.addToPolicy(new iam.PolicyStatement({
602602
effect: iam.Effect.ALLOW,
603-
actions: GatewayPerms.KMS_KEY_PERMS,
603+
actions: GATEWAY_KMS_KEY_PERMS,
604604
resources: [this.kmsKey.keyArn],
605605
}));
606606
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Grant, IRole, PolicyStatement } from 'aws-cdk-lib/aws-iam';
22
import { CredentialProviderType, ICredentialProviderConfig } from './credential-provider';
3-
import { GatewayPerms } from '../perms';
3+
import { GATEWAY_API_KEY_PERMS, GATEWAY_WORKLOAD_IDENTITY_PERMS, GATEWAY_SECRETS_PERMS } from '../perms';
44

55
/******************************************************************************
66
* API KEY
@@ -152,13 +152,13 @@ export class ApiKeyCredentialProviderConfiguration implements ICredentialProvide
152152
const statements = [
153153
new PolicyStatement({
154154
actions: [
155-
...GatewayPerms.GATEWAY_API_KEY_PERMS,
156-
...GatewayPerms.GATEWAY_WORKLOAD_IDENTITY_PERMS,
155+
...GATEWAY_API_KEY_PERMS,
156+
...GATEWAY_WORKLOAD_IDENTITY_PERMS,
157157
],
158158
resources: [this.providerArn],
159159
}),
160160
new PolicyStatement({
161-
actions: GatewayPerms.SECRETS_PERMS,
161+
actions: GATEWAY_SECRETS_PERMS,
162162
resources: [this.secretArn],
163163
}),
164164
];
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Grant, IRole, PolicyStatement } from 'aws-cdk-lib/aws-iam';
22
import { CredentialProviderType, ICredentialProviderConfig } from './credential-provider';
3-
import { GatewayPerms } from '../perms';
3+
import { GATEWAY_OAUTH_PERMS, GATEWAY_WORKLOAD_IDENTITY_PERMS, GATEWAY_SECRETS_PERMS } from '../perms';
44

55
/******************************************************************************
66
* OAuth
@@ -90,13 +90,13 @@ export class OAuthCredentialProviderConfiguration implements ICredentialProvider
9090
const statements = [
9191
new PolicyStatement({
9292
actions: [
93-
...GatewayPerms.GATEWAY_OAUTH_PERMS,
94-
...GatewayPerms.GATEWAY_WORKLOAD_IDENTITY_PERMS,
93+
...GATEWAY_OAUTH_PERMS,
94+
...GATEWAY_WORKLOAD_IDENTITY_PERMS,
9595
],
9696
resources: [this.providerArn],
9797
}),
9898
new PolicyStatement({
99-
actions: GatewayPerms.SECRETS_PERMS,
99+
actions: GATEWAY_SECRETS_PERMS,
100100
resources: [this.secretArn],
101101
}),
102102
];

0 commit comments

Comments
 (0)