Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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

This file was deleted.

60 changes: 0 additions & 60 deletions packages/@aws-cdk/aws-bedrock-agentcore-alpha/agentcore/index.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import * as kms from 'aws-cdk-lib/aws-kms';
import { Construct } from 'constructs';
// Internal imports
import { IGatewayAuthorizerConfig } from './inbound-auth/authorizer';
import { GatewayPerms } from './perms';
import { GATEWAY_GET_PERMS, GATEWAY_LIST_PERMS, GATEWAY_MANAGE_PERMS, GATEWAY_INVOKE_PERMS } from './perms';
import { IGatewayProtocolConfig } from './protocol';

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

const allResourceGrant = iam.Grant.addToPrincipal({
grantee: grantee,
resourceArns: ['*'],
actions: [...GatewayPerms.LIST_PERMS],
actions: [...GATEWAY_LIST_PERMS],
});
// Return combined grant
return resourceSpecificGrant.combine(allResourceGrant);
Expand All @@ -286,7 +286,7 @@ export abstract class GatewayBase extends Resource implements IGateway {
* @param grantee The principal to grant manage permissions to
*/
public grantManage(grantee: iam.IGrantable): iam.Grant {
return this.grant(grantee, ...GatewayPerms.MANAGE_PERMS);
return this.grant(grantee, ...GATEWAY_MANAGE_PERMS);
}

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

// ------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { Construct } from 'constructs';
import { GatewayBase, GatewayExceptionLevel, IGateway } from './gateway-base';
import { GatewayAuthorizer, IGatewayAuthorizerConfig } from './inbound-auth/authorizer';
import { ICredentialProviderConfig } from './outbound-auth/credential-provider';
import { GatewayPerms } from './perms';
import { GATEWAY_ASSUME_ROLE, GATEWAY_KMS_KEY_PERMS } from './perms';
import { IGatewayProtocolConfig, McpGatewaySearchType, McpProtocolConfiguration, MCPProtocolVersion } from './protocol';
import { ApiSchema } from './targets/schema/api-schema';
import { ToolSchema } from './targets/schema/tool-schema';
Expand Down Expand Up @@ -585,7 +585,7 @@ export class Gateway extends GatewayBase {
new iam.PolicyStatement({
effect: iam.Effect.ALLOW,
principals: [new iam.ServicePrincipal('bedrock-agentcore.amazonaws.com')],
actions: GatewayPerms.ASSUME_ROLE,
actions: GATEWAY_ASSUME_ROLE,
conditions: {
StringEquals: {
'aws:SourceAccount': account,
Expand All @@ -600,7 +600,7 @@ export class Gateway extends GatewayBase {
if (this.kmsKey) {
role.addToPolicy(new iam.PolicyStatement({
effect: iam.Effect.ALLOW,
actions: GatewayPerms.KMS_KEY_PERMS,
actions: GATEWAY_KMS_KEY_PERMS,
resources: [this.kmsKey.keyArn],
}));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Grant, IRole, PolicyStatement } from 'aws-cdk-lib/aws-iam';
import { CredentialProviderType, ICredentialProviderConfig } from './credential-provider';
import { GatewayPerms } from '../perms';
import { GATEWAY_API_KEY_PERMS, GATEWAY_WORKLOAD_IDENTITY_PERMS, GATEWAY_SECRETS_PERMS } from '../perms';

/******************************************************************************
* API KEY
Expand Down Expand Up @@ -152,13 +152,13 @@ export class ApiKeyCredentialProviderConfiguration implements ICredentialProvide
const statements = [
new PolicyStatement({
actions: [
...GatewayPerms.GATEWAY_API_KEY_PERMS,
...GatewayPerms.GATEWAY_WORKLOAD_IDENTITY_PERMS,
...GATEWAY_API_KEY_PERMS,
...GATEWAY_WORKLOAD_IDENTITY_PERMS,
],
resources: [this.providerArn],
}),
new PolicyStatement({
actions: GatewayPerms.SECRETS_PERMS,
actions: GATEWAY_SECRETS_PERMS,
resources: [this.secretArn],
}),
];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Grant, IRole, PolicyStatement } from 'aws-cdk-lib/aws-iam';
import { CredentialProviderType, ICredentialProviderConfig } from './credential-provider';
import { GatewayPerms } from '../perms';
import { GATEWAY_OAUTH_PERMS, GATEWAY_WORKLOAD_IDENTITY_PERMS, GATEWAY_SECRETS_PERMS } from '../perms';

/******************************************************************************
* OAuth
Expand Down Expand Up @@ -90,13 +90,13 @@ export class OAuthCredentialProviderConfiguration implements ICredentialProvider
const statements = [
new PolicyStatement({
actions: [
...GatewayPerms.GATEWAY_OAUTH_PERMS,
...GatewayPerms.GATEWAY_WORKLOAD_IDENTITY_PERMS,
...GATEWAY_OAUTH_PERMS,
...GATEWAY_WORKLOAD_IDENTITY_PERMS,
],
resources: [this.providerArn],
}),
new PolicyStatement({
actions: GatewayPerms.SECRETS_PERMS,
actions: GATEWAY_SECRETS_PERMS,
resources: [this.secretArn],
}),
];
Expand Down
Loading
Loading