@aws/nx-plugin 0.60.2 → 0.61.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/py/fast-api/__snapshots__/generator.spec.ts.snap +13 -11
- package/src/py/mcp-server/__snapshots__/generator.spec.ts.snap +85 -415
- package/src/py/strands-agent/__snapshots__/generator.spec.ts.snap +81 -407
- package/src/smithy/ts/api/__snapshots__/generator.spec.ts.snap +13 -11
- package/src/trpc/backend/__snapshots__/generator.spec.ts.snap +13 -11
- package/src/ts/mcp-server/__snapshots__/generator.spec.ts.snap +86 -416
- package/src/utils/agent-core-constructs/agent-core-constructs.js +3 -4
- package/src/utils/agent-core-constructs/agent-core-constructs.js.map +1 -1
- package/src/utils/agent-core-constructs/files/cdk/app/agent-core/__nameKebabCase__/__nameKebabCase__.ts.template +23 -19
- package/src/utils/agent-core-constructs/files/terraform/app/agent-core/__nameKebabCase__/__nameKebabCase__.tf.template +5 -3
- package/src/utils/agent-core-constructs/files/terraform/core/agent-core/runtime.tf.template +53 -222
- package/src/utils/api-constructs/files/cdk/app/apis/rest/__apiNameKebabCase__.ts.template +13 -16
- package/src/utils/versions.d.ts +2 -1
- package/src/utils/versions.js +1 -0
- package/src/utils/versions.js.map +1 -1
- package/src/utils/agent-core-constructs/files/cdk/core/agent-core/runtime.ts.template +0 -159
package/package.json
CHANGED
|
@@ -813,13 +813,12 @@ import {
|
|
|
813
813
|
Cors,
|
|
814
814
|
LambdaIntegration,
|
|
815
815
|
} from 'aws-cdk-lib/aws-apigateway';
|
|
816
|
-
import { Duration
|
|
816
|
+
import { Duration } from 'aws-cdk-lib';
|
|
817
817
|
import {
|
|
818
818
|
PolicyDocument,
|
|
819
819
|
PolicyStatement,
|
|
820
820
|
Effect,
|
|
821
821
|
AnyPrincipal,
|
|
822
|
-
AccountPrincipal,
|
|
823
822
|
IGrantable,
|
|
824
823
|
Grant,
|
|
825
824
|
} from 'aws-cdk-lib/aws-iam';
|
|
@@ -908,15 +907,6 @@ export class TestApi<
|
|
|
908
907
|
},
|
|
909
908
|
policy: new PolicyDocument({
|
|
910
909
|
statements: [
|
|
911
|
-
// Here we grant any AWS credentials from the account that the project is deployed in to call the api.
|
|
912
|
-
// Machine to machine fine-grained access can be defined here using more specific principals (eg roles or
|
|
913
|
-
// users) and resources (eg which api paths may be invoked by which principal) if required.
|
|
914
|
-
new PolicyStatement({
|
|
915
|
-
effect: Effect.ALLOW,
|
|
916
|
-
principals: [new AccountPrincipal(Stack.of(scope).account)],
|
|
917
|
-
actions: ['execute-api:Invoke'],
|
|
918
|
-
resources: ['execute-api:/*'],
|
|
919
|
-
}),
|
|
920
910
|
// Open up OPTIONS to allow browsers to make unauthenticated preflight requests
|
|
921
911
|
new PolicyStatement({
|
|
922
912
|
effect: Effect.ALLOW,
|
|
@@ -937,6 +927,18 @@ export class TestApi<
|
|
|
937
927
|
* @param grantee - The IAM principal to grant permissions to
|
|
938
928
|
*/
|
|
939
929
|
public grantInvokeAccess(grantee: IGrantable) {
|
|
930
|
+
// Here we grant grantee permission to call the api.
|
|
931
|
+
// Machine to machine fine-grained access can be defined here using more specific principals (eg roles or
|
|
932
|
+
// users) and resources (eg which api paths may be invoked by which principal) if required.
|
|
933
|
+
this.api.addToResourcePolicy(
|
|
934
|
+
new PolicyStatement({
|
|
935
|
+
effect: Effect.ALLOW,
|
|
936
|
+
principals: [grantee.grantPrincipal],
|
|
937
|
+
actions: ['execute-api:Invoke'],
|
|
938
|
+
resources: ['execute-api:/*'],
|
|
939
|
+
}),
|
|
940
|
+
);
|
|
941
|
+
|
|
940
942
|
Grant.addToPrincipal({
|
|
941
943
|
grantee,
|
|
942
944
|
actions: ['execute-api:Invoke'],
|