From 7321f861aa7c7f8119bcb1e2ad616043322ec338 Mon Sep 17 00:00:00 2001 From: biffgaut <78155736+biffgaut@users.noreply.github.com> Date: Thu, 9 Mar 2023 12:57:56 -0500 Subject: [PATCH 1/6] chore(core): Add warnings about using core functions from outside of Solutions Constructs (#917) * Add file header warning * Add function header comments * Use latest CDK to address .NET version issue * Fix 2 typos * One last typo --- deployment/v2/align-version.js | 2 +- .../core/lib/alb-defaults.ts | 8 ++++ .../core/lib/alb-helper.ts | 42 +++++++++++++++---- .../core/lib/apigateway-defaults.ts | 15 +++++++ .../core/lib/apigateway-helper.ts | 16 +++++++ .../lib/cloudfront-distribution-defaults.ts | 14 +++++++ .../lib/cloudfront-distribution-helper.ts | 17 ++++++++ .../core/lib/cloudwatch-log-group-defaults.ts | 8 ++++ .../core/lib/cloudwatch-log-group-helper.ts | 8 ++++ .../core/lib/cognito-defaults.ts | 11 +++++ .../core/lib/cognito-helper.ts | 20 +++++++++ .../core/lib/dynamodb-table-defaults.ts | 5 +++ .../core/lib/dynamodb-table-helper.ts | 17 ++++++++ .../core/lib/elasticache-defaults.ts | 11 +++++ .../core/lib/elasticache-helper.ts | 14 +++++++ .../core/lib/elasticsearch-defaults.ts | 8 ++++ .../core/lib/elasticsearch-helper.ts | 11 +++++ .../core/lib/eventbridge-helper.ts | 8 ++++ .../core/lib/events-rule-defaults.ts | 8 ++++ .../core/lib/fargate-defaults.ts | 20 +++++++++ .../core/lib/fargate-helper.ts | 14 +++++++ .../core/lib/glue-database-defaults.ts | 7 +++- .../core/lib/glue-database-helper.ts | 7 ++++ .../core/lib/glue-job-defaults.ts | 8 ++++ .../core/lib/glue-job-helper.ts | 17 ++++++++ .../core/lib/glue-table-defaults.ts | 8 ++++ .../core/lib/glue-table-helper.ts | 7 ++++ .../core/lib/input-validation.ts | 11 +++++ .../core/lib/iot-topic-rule-defaults.ts | 8 ++++ .../core/lib/kinesis-analytics-defaults.ts | 5 +++ .../core/lib/kinesis-analytics-helper.ts | 8 ++++ .../core/lib/kinesis-firehose-s3-defaults.ts | 8 ++++ .../core/lib/kinesis-streams-defaults.ts | 5 +++ .../core/lib/kinesis-streams-helper.ts | 11 +++++ .../core/lib/kms-defaults.ts | 5 +++ .../core/lib/kms-helper.ts | 8 ++++ .../core/lib/lambda-defaults.ts | 8 ++++ .../lambda-event-source-mapping-defaults.ts | 14 +++++++ .../core/lib/lambda-helper.ts | 24 +++++++++-- .../core/lib/mediastore-defaults.ts | 8 ++++ .../core/lib/mediastore-helper.ts | 8 ++++ .../core/lib/opensearch-defaults.ts | 8 ++++ .../core/lib/opensearch-helper.ts | 11 +++++ .../core/lib/override-warning-service.ts | 7 ++++ .../core/lib/s3-bucket-defaults.ts | 11 +++++ .../core/lib/s3-bucket-helper.ts | 17 ++++++++ .../core/lib/sagemaker-defaults.ts | 17 ++++++++ .../core/lib/sagemaker-helper.ts | 23 ++++++++++ .../core/lib/secretsmanager-defaults.ts | 5 +++ .../core/lib/secretsmanager-helper.ts | 7 ++++ .../core/lib/security-group-helper.ts | 11 +++++ .../core/lib/sns-defaults.ts | 5 +++ .../core/lib/sns-helper.ts | 8 ++++ .../core/lib/sqs-defaults.ts | 8 ++++ .../core/lib/sqs-helper.ts | 11 +++++ .../core/lib/ssm-string-parameter-helper.ts | 7 ++++ .../core/lib/step-function-defaults.ts | 8 ++++ .../core/lib/step-function-helper.ts | 10 +++++ .../core/lib/utils.ts | 19 +++++++++ .../core/lib/vpc-defaults.ts | 11 +++-- .../core/lib/vpc-helper.ts | 14 +++++++ .../core/lib/waf-defaults.ts | 14 +++++++ .../core/lib/waf-helper.ts | 8 ++++ 63 files changed, 686 insertions(+), 16 deletions(-) diff --git a/deployment/v2/align-version.js b/deployment/v2/align-version.js index d98ddf673..017d868a9 100755 --- a/deployment/v2/align-version.js +++ b/deployment/v2/align-version.js @@ -10,7 +10,7 @@ const findVersion = process.argv[2]; const replaceVersion = process.argv[3]; // these versions need to be sourced from a config file -const awsCdkLibVersion = '2.67.0'; +const awsCdkLibVersion = '2.68.0'; const constructsVersion = '10.0.0'; const MODULE_EXEMPTIONS = new Set([ '@aws-cdk/cloudformation-diff', diff --git a/source/patterns/@aws-solutions-constructs/core/lib/alb-defaults.ts b/source/patterns/@aws-solutions-constructs/core/lib/alb-defaults.ts index 42a7445e0..80a19979a 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/alb-defaults.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/alb-defaults.ts @@ -11,8 +11,16 @@ * and limitations under the License. */ +/* + * The functions found here in the core library are for internal use and can be changed + * or removed outside of a major release. We recommend against calling them directly from client code. + */ + import * as elb from "aws-cdk-lib/aws-elasticloadbalancingv2"; +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function DefaultListenerProps(loadBalancer: elb.ApplicationLoadBalancer): elb.ApplicationListenerProps { return { loadBalancer, diff --git a/source/patterns/@aws-solutions-constructs/core/lib/alb-helper.ts b/source/patterns/@aws-solutions-constructs/core/lib/alb-helper.ts index 7ae024bea..8ecd2c749 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/alb-helper.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/alb-helper.ts @@ -11,6 +11,11 @@ * and limitations under the License. */ +/* + * The functions found here in the core library are for internal use and can be changed + * or removed outside of a major release. We recommend against calling them directly from client code. + */ + import * as elb from "aws-cdk-lib/aws-elasticloadbalancingv2"; import { Construct } from "constructs"; import * as ec2 from "aws-cdk-lib/aws-ec2"; @@ -24,8 +29,12 @@ import { DefaultListenerProps } from "./alb-defaults"; import { createAlbLoggingBucket } from "./s3-bucket-helper"; import { DefaultLoggingBucketProps } from "./s3-bucket-defaults"; -// Returns the correct ALB Load Balancer to use in this construct, either an existing -// one provided as an argument or create new one otherwise. +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + * + * Returns the correct ALB Load Balancer to use in this construct, either an existing + * one provided as an argument or create new one otherwise. + */ export function ObtainAlb( scope: Construct, id: string, @@ -56,6 +65,9 @@ export function ObtainAlb( return loadBalancer; } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function AddListener( scope: Construct, id: string, @@ -111,9 +123,13 @@ export function AddListener( return listener; } -// Creates a Target Group for Lambda functions and adds the -// provided functions as a target to that group. Then adds -// the new Target Group to the provided Listener. +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + * + * Creates a Target Group for Lambda functions and adds the + * provided functions as a target to that group. Then adds + * the new Target Group to the provided Listener. + */ export function AddLambdaTarget( scope: Construct, id: string, @@ -140,6 +156,9 @@ export function AddLambdaTarget( return newTargetGroup; } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function AddFargateTarget( scope: Construct, id: string, @@ -165,9 +184,13 @@ export function AddFargateTarget( return newTargetGroup; } -// Looks for the listener associated with Target Groups -// If there is a single listener, this returns it whether it is HTTP or HTTPS -// If there are 2 listeners, it finds the HTTPS listener (we assume the HTTP listener redirects to HTTPS) +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + * + * Looks for the listener associated with Target Groups + * If there is a single listener, this returns it whether it is HTTP or HTTPS + * If there are 2 listeners, it finds the HTTPS listener (we assume the HTTP listener redirects to HTTPS) + */ export function GetActiveListener(listeners: elb.ApplicationListener[]): elb.ApplicationListener { let listener: elb.ApplicationListener; @@ -182,6 +205,9 @@ export function GetActiveListener(listeners: elb.ApplicationListener[]): elb.App return listener; } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function CheckAlbProps(props: any) { let errorMessages = ''; let errorFound = false; diff --git a/source/patterns/@aws-solutions-constructs/core/lib/apigateway-defaults.ts b/source/patterns/@aws-solutions-constructs/core/lib/apigateway-defaults.ts index 79daaec13..f3b3cac32 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/apigateway-defaults.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/apigateway-defaults.ts @@ -11,6 +11,11 @@ * and limitations under the License. */ +/* + * The functions found here in the core library are for internal use and can be changed + * or removed outside of a major release. We recommend against calling them directly from client code. + */ + import * as api from 'aws-cdk-lib/aws-apigateway'; import { IntegrationResponse } from 'aws-cdk-lib/aws-apigateway'; import * as lambda from 'aws-cdk-lib/aws-lambda'; @@ -44,6 +49,8 @@ function DefaultRestApiProps(_endpointType: api.EndpointType[], _logGroup: LogGr } /** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + * * Provides the default set of properties for Edge/Global Lambda backed RestApi * @param scope - the construct to which the RestApi should be attached to. * @param _endpointType - endpoint type for Api Gateway e.g. Regional, Global, Private @@ -60,6 +67,8 @@ export function DefaultGlobalLambdaRestApiProps(_existingLambdaObj: lambda.Funct } /** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + * * Provides the default set of properties for Regional Lambda backed RestApi * @param scope - the construct to which the RestApi should be attached to. * @param _endpointType - endpoint type for Api Gateway e.g. Regional, Global, Private @@ -76,6 +85,8 @@ export function DefaultRegionalLambdaRestApiProps(_existingLambdaObj: lambda.Fun } /** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + * * Provides the default set of properties for Edge/Global RestApi * @param _logGroup - CW Log group for Api Gateway access logging */ @@ -84,6 +95,8 @@ export function DefaultGlobalRestApiProps(_logGroup: LogGroup) { } /** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + * * Provides the default set of properties for Regional RestApi * @param _logGroup - CW Log group for Api Gateway access logging */ @@ -92,6 +105,8 @@ export function DefaultRegionalRestApiProps(_logGroup: LogGroup) { } /** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + * * @returns The set of default integration responses for status codes 200 and 500. */ export function DefaultIntegrationResponses(): IntegrationResponse[] { diff --git a/source/patterns/@aws-solutions-constructs/core/lib/apigateway-helper.ts b/source/patterns/@aws-solutions-constructs/core/lib/apigateway-helper.ts index a4a1f0982..bffd0d628 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/apigateway-helper.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/apigateway-helper.ts @@ -11,6 +11,11 @@ * and limitations under the License. */ +/* + * The functions found here in the core library are for internal use and can be changed + * or removed outside of a major release. We recommend against calling them directly from client code. + */ + // Imports import * as logs from 'aws-cdk-lib/aws-logs'; import * as lambda from 'aws-cdk-lib/aws-lambda'; @@ -180,6 +185,8 @@ export interface GlobalLambdaRestApiResponse { } /** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + * * Builds and returns a global api.RestApi designed to be used with an AWS Lambda function. * @param scope - the construct to which the RestApi should be attached to. * @param _existingLambdaObj - an existing AWS Lambda function. @@ -202,6 +209,8 @@ export interface RegionalLambdaRestApiResponse { } /** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + * * Builds and returns a regional api.RestApi designed to be used with an AWS Lambda function. * @param scope - the construct to which the RestApi should be attached to. * @param existingLambdaObj - an existing AWS Lambda function. @@ -224,6 +233,8 @@ export interface GlobalRestApiResponse { } /** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + * * Builds and returns a standard api.RestApi. * @param scope - the construct to which the RestApi should be attached to. * @param apiGatewayProps - (optional) user-specified properties to override the default properties. @@ -245,6 +256,8 @@ export interface RegionalRestApiResponse { } /** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + * * Builds and returns a Regional api.RestApi. * @param scope - the construct to which the RestApi should be attached to. * @param apiGatewayProps - (optional) user-specified properties to override the default properties. @@ -276,6 +289,9 @@ export interface AddProxyMethodToApiResourceInputParams { readonly methodOptions?: apigateway.MethodOptions } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function addProxyMethodToApiResource(params: AddProxyMethodToApiResourceInputParams): apigateway.Method { // Make sure the user hasn't also specified the application/json content-type in the additionalRequestTemplates optional property if (params.additionalRequestTemplates && 'application/json' in params.additionalRequestTemplates) { diff --git a/source/patterns/@aws-solutions-constructs/core/lib/cloudfront-distribution-defaults.ts b/source/patterns/@aws-solutions-constructs/core/lib/cloudfront-distribution-defaults.ts index b2fb6108b..f88b3c467 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/cloudfront-distribution-defaults.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/cloudfront-distribution-defaults.ts @@ -11,6 +11,11 @@ * and limitations under the License. */ +/* + * The functions found here in the core library are for internal use and can be changed + * or removed outside of a major release. We recommend against calling them directly from client code. + */ + import * as api from 'aws-cdk-lib/aws-apigateway'; import * as cloudfront from 'aws-cdk-lib/aws-cloudfront'; import { FunctionEventType, IOrigin } from 'aws-cdk-lib/aws-cloudfront'; @@ -20,6 +25,9 @@ import * as s3 from 'aws-cdk-lib/aws-s3'; import * as cdk from 'aws-cdk-lib'; import {BehaviorOptions} from "aws-cdk-lib/aws-cloudfront/lib/distribution"; +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function DefaultCloudFrontWebDistributionForApiGatewayProps(apiEndPoint: api.RestApi, loggingBucket: s3.Bucket | undefined, setHttpSecurityHeaders: boolean, @@ -47,6 +55,9 @@ export function DefaultCloudFrontWebDistributionForApiGatewayProps(apiEndPoint: }; } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function DefaultCloudFrontWebDistributionForS3Props( sourceBucket: s3.IBucket, loggingBucket: s3.Bucket | undefined, @@ -80,6 +91,9 @@ export function DefaultCloudFrontWebDistributionForS3Props( }; } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function DefaultCloudFrontDisributionForMediaStoreProps(mediastoreContainer: mediastore.CfnContainer, loggingBucket: s3.Bucket | undefined, originRequestPolicy: cloudfront.OriginRequestPolicy, diff --git a/source/patterns/@aws-solutions-constructs/core/lib/cloudfront-distribution-helper.ts b/source/patterns/@aws-solutions-constructs/core/lib/cloudfront-distribution-helper.ts index 934b1d1a5..ddf73c3af 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/cloudfront-distribution-helper.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/cloudfront-distribution-helper.ts @@ -11,6 +11,11 @@ * and limitations under the License. */ +/* + * The functions found here in the core library are for internal use and can be changed + * or removed outside of a major release. We recommend against calling them directly from client code. + */ + import * as cloudfront from 'aws-cdk-lib/aws-cloudfront'; import * as s3 from 'aws-cdk-lib/aws-s3'; import * as cdk from 'aws-cdk-lib'; @@ -68,6 +73,9 @@ export interface CloudFrontDistributionForApiGatewayResponse { readonly loggingBucket?: s3.Bucket } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function CloudFrontDistributionForApiGateway(scope: Construct, apiEndPoint: api.RestApi, cloudFrontDistributionProps?: cloudfront.DistributionProps | any, @@ -101,6 +109,9 @@ export interface CloudFrontDistributionForS3Response { readonly cloudfrontFunction?: cloudfront.Function, } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function CloudFrontDistributionForS3( scope: Construct, sourceBucket: s3.IBucket, @@ -148,6 +159,9 @@ export interface CloudFrontDistributionForMediaStoreResponse { readonly cloudfrontFunction?: cloudfront.Function } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function CloudFrontDistributionForMediaStore(scope: Construct, mediaStoreContainer: mediastore.CfnContainer, cloudFrontDistributionProps?: cloudfront.DistributionProps | any, @@ -211,6 +225,9 @@ export function CloudFrontDistributionForMediaStore(scope: Construct, return { distribution: cfDistribution, loggingBucket, requestPolicy: originRequestPolicy, cloudfrontFunction }; } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function CloudFrontOriginAccessIdentity(scope: Construct, comment?: string) { return new cloudfront.OriginAccessIdentity(scope, 'CloudFrontOriginAccessIdentity', { comment: comment ? comment : `access-identity-${cdk.Aws.REGION}-${cdk.Aws.STACK_NAME}` diff --git a/source/patterns/@aws-solutions-constructs/core/lib/cloudwatch-log-group-defaults.ts b/source/patterns/@aws-solutions-constructs/core/lib/cloudwatch-log-group-defaults.ts index 0b0e231a6..00e75706f 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/cloudwatch-log-group-defaults.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/cloudwatch-log-group-defaults.ts @@ -11,8 +11,16 @@ * and limitations under the License. */ +/* + * The functions found here in the core library are for internal use and can be changed + * or removed outside of a major release. We recommend against calling them directly from client code. + */ + import * as logs from 'aws-cdk-lib/aws-logs'; +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function DefaultLogGroupProps(): logs.LogGroupProps { const logGroupProps: logs.LogGroupProps = { diff --git a/source/patterns/@aws-solutions-constructs/core/lib/cloudwatch-log-group-helper.ts b/source/patterns/@aws-solutions-constructs/core/lib/cloudwatch-log-group-helper.ts index 965b975ce..3a9a73644 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/cloudwatch-log-group-helper.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/cloudwatch-log-group-helper.ts @@ -11,12 +11,20 @@ * and limitations under the License. */ +/* + * The functions found here in the core library are for internal use and can be changed + * or removed outside of a major release. We recommend against calling them directly from client code. + */ + import { DefaultLogGroupProps } from './cloudwatch-log-group-defaults'; import * as logs from 'aws-cdk-lib/aws-logs'; import { addCfnSuppressRules, consolidateProps } from './utils'; // Note: To ensure CDKv2 compatibility, keep the import statement for Construct separate import { Construct } from 'constructs'; +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function buildLogGroup(scope: Construct, logGroupId?: string, logGroupProps?: logs.LogGroupProps): logs.LogGroup { let _logGroupProps: logs.LogGroupProps; diff --git a/source/patterns/@aws-solutions-constructs/core/lib/cognito-defaults.ts b/source/patterns/@aws-solutions-constructs/core/lib/cognito-defaults.ts index a76522e1b..16edfd977 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/cognito-defaults.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/cognito-defaults.ts @@ -11,11 +11,19 @@ * and limitations under the License. */ +/* + * The functions found here in the core library are for internal use and can be changed + * or removed outside of a major release. We recommend against calling them directly from client code. + */ + import * as cognito from 'aws-cdk-lib/aws-cognito'; const DefaultUserPoolProps: cognito.UserPoolProps = { }; +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function DefaultIdentityPoolProps(userPoolClientId: string, userPoolProviderName: string): cognito.CfnIdentityPoolProps { return { allowUnauthenticatedIdentities: false, @@ -27,6 +35,9 @@ export function DefaultIdentityPoolProps(userPoolClientId: string, userPoolProvi } as cognito.CfnIdentityPoolProps; } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function DefaultUserPoolClientProps(userpool: cognito.UserPool): cognito.UserPoolClientProps { return { userPool: userpool diff --git a/source/patterns/@aws-solutions-constructs/core/lib/cognito-helper.ts b/source/patterns/@aws-solutions-constructs/core/lib/cognito-helper.ts index 0549baf9b..1022b4137 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/cognito-helper.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/cognito-helper.ts @@ -11,6 +11,11 @@ * and limitations under the License. */ +/* + * The functions found here in the core library are for internal use and can be changed + * or removed outside of a major release. We recommend against calling them directly from client code. + */ + import * as cognito from 'aws-cdk-lib/aws-cognito'; import * as iam from 'aws-cdk-lib/aws-iam'; import * as cdk from 'aws-cdk-lib'; @@ -25,6 +30,9 @@ export interface CognitoOptions { readonly userpoolclient: cognito.UserPoolClient } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function buildUserPool(scope: Construct, userPoolProps?: cognito.UserPoolProps): cognito.UserPool { let cognitoUserPoolProps: cognito.UserPoolProps; @@ -54,6 +62,9 @@ export function buildUserPool(scope: Construct, userPoolProps?: cognito.UserPool return userPool; } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function buildUserPoolClient(scope: Construct, userPool: cognito.UserPool, cognitoUserPoolClientProps?: cognito.UserPoolClientProps): cognito.UserPoolClient { @@ -64,6 +75,9 @@ export function buildUserPoolClient(scope: Construct, userPool: cognito.UserPool return new cognito.UserPoolClient(scope, 'CognitoUserPoolClient', userPoolClientProps); } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function buildIdentityPool(scope: Construct, userpool: cognito.UserPool, userpoolclient: cognito.UserPoolClient, identityPoolProps?: cognito.CfnIdentityPoolProps): cognito.CfnIdentityPool { @@ -77,6 +91,9 @@ export function buildIdentityPool(scope: Construct, userpool: cognito.UserPool, return idPool; } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function setupCognitoForSearchService(scope: Construct, domainName: string, options: CognitoOptions): iam.Role { // Create the domain for Cognito UserPool @@ -121,6 +138,9 @@ export function setupCognitoForSearchService(scope: Construct, domainName: strin return cognitoAuthorizedRole; } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function buildCognitoForSearchService(scope: Construct, domainName: string): [cognito.UserPool, cognito.UserPoolClient, cognito.CfnIdentityPool, iam.Role] { const userPool = buildUserPool(scope); diff --git a/source/patterns/@aws-solutions-constructs/core/lib/dynamodb-table-defaults.ts b/source/patterns/@aws-solutions-constructs/core/lib/dynamodb-table-defaults.ts index c9f30f5f7..8e67b9a23 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/dynamodb-table-defaults.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/dynamodb-table-defaults.ts @@ -11,6 +11,11 @@ * and limitations under the License. */ +/* + * The functions found here in the core library are for internal use and can be changed + * or removed outside of a major release. We recommend against calling them directly from client code. + */ + import * as dynamodb from 'aws-cdk-lib/aws-dynamodb'; const DefaultTableProps: dynamodb.TableProps = { diff --git a/source/patterns/@aws-solutions-constructs/core/lib/dynamodb-table-helper.ts b/source/patterns/@aws-solutions-constructs/core/lib/dynamodb-table-helper.ts index 862de8aa5..9d28b59b4 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/dynamodb-table-helper.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/dynamodb-table-helper.ts @@ -11,6 +11,11 @@ * and limitations under the License. */ +/* + * The functions found here in the core library are for internal use and can be changed + * or removed outside of a major release. We recommend against calling them directly from client code. + */ + import * as dynamodb from 'aws-cdk-lib/aws-dynamodb'; import { DefaultTableProps, DefaultTableWithStreamProps } from './dynamodb-table-defaults'; import { consolidateProps } from './utils'; @@ -61,6 +66,9 @@ export interface BuildDynamoDBTableResponse { readonly tableObject?: dynamodb.Table, } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function buildDynamoDBTable(scope: Construct, props: BuildDynamoDBTableProps): BuildDynamoDBTableResponse { checkTableProps(props); @@ -76,6 +84,9 @@ export function buildDynamoDBTable(scope: Construct, props: BuildDynamoDBTablePr } } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function checkTableProps(props: BuildDynamoDBTableProps) { let errorMessages = ''; let errorFound = false; @@ -105,6 +116,9 @@ export interface BuildDynamoDBTableWithStreamResponse { readonly tableObject?: dynamodb.Table, } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function buildDynamoDBTableWithStream(scope: Construct, props: BuildDynamoDBTableWithStreamProps): BuildDynamoDBTableWithStreamResponse { // Conditional DynamoDB Table creation if (!props.existingTableInterface) { @@ -117,6 +131,9 @@ export function buildDynamoDBTableWithStream(scope: Construct, props: BuildDynam } } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function getPartitionKeyNameFromTable(table: dynamodb.Table): string { const cfnTable = table.node.findChild('Resource') as dynamodb.CfnTable; const keySchema = cfnTable.keySchema as dynamodb.CfnTable.KeySchemaProperty[]; diff --git a/source/patterns/@aws-solutions-constructs/core/lib/elasticache-defaults.ts b/source/patterns/@aws-solutions-constructs/core/lib/elasticache-defaults.ts index 29e138e4d..30a998176 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/elasticache-defaults.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/elasticache-defaults.ts @@ -11,11 +11,22 @@ * and limitations under the License. */ +/* + * The functions found here in the core library are for internal use and can be changed + * or removed outside of a major release. We recommend against calling them directly from client code. + */ + +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function GetDefaultCachePort() { // Best practice not to use default port 11211 return 11222; } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function GetMemcachedDefaults(id: string, port: number) { return { clusterName: `${id}-cdk-cluster`, diff --git a/source/patterns/@aws-solutions-constructs/core/lib/elasticache-helper.ts b/source/patterns/@aws-solutions-constructs/core/lib/elasticache-helper.ts index bddf3c241..6d5914bde 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/elasticache-helper.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/elasticache-helper.ts @@ -11,6 +11,11 @@ * and limitations under the License. */ +/* + * The functions found here in the core library are for internal use and can be changed + * or removed outside of a major release. We recommend against calling them directly from client code. + */ + import * as ec2 from "aws-cdk-lib/aws-ec2"; import * as cache from "aws-cdk-lib/aws-elasticache"; import { Construct } from "constructs"; @@ -25,6 +30,9 @@ export interface ObtainMemcachedClusterProps { readonly vpc?: ec2.IVpc, } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function obtainMemcachedCluster( scope: Construct, id: string, @@ -65,6 +73,9 @@ export function obtainMemcachedCluster( } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function createCacheSubnetGroup( construct: Construct, vpc: ec2.IVpc, @@ -86,6 +97,9 @@ export function createCacheSubnetGroup( }); } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function getCachePort( clientCacheProps?: cache.CfnCacheClusterProps | any, existingCache?: cache.CfnCacheCluster diff --git a/source/patterns/@aws-solutions-constructs/core/lib/elasticsearch-defaults.ts b/source/patterns/@aws-solutions-constructs/core/lib/elasticsearch-defaults.ts index a38ad0ca4..f1b6127c3 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/elasticsearch-defaults.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/elasticsearch-defaults.ts @@ -11,11 +11,19 @@ * and limitations under the License. */ +/* + * The functions found here in the core library are for internal use and can be changed + * or removed outside of a major release. We recommend against calling them directly from client code. + */ + import * as elasticsearch from 'aws-cdk-lib/aws-elasticsearch'; import * as iam from 'aws-cdk-lib/aws-iam'; import * as cdk from 'aws-cdk-lib'; import { BuildElasticSearchProps } from './elasticsearch-helper'; +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function DefaultCfnDomainProps(domainName: string, cognitoKibanaConfigureRole: iam.Role, props: BuildElasticSearchProps): elasticsearch.CfnDomainProps { const roleARNs: iam.IPrincipal[] = []; diff --git a/source/patterns/@aws-solutions-constructs/core/lib/elasticsearch-helper.ts b/source/patterns/@aws-solutions-constructs/core/lib/elasticsearch-helper.ts index 122820650..f6acbc76c 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/elasticsearch-helper.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/elasticsearch-helper.ts @@ -11,6 +11,11 @@ * and limitations under the License. */ +/* + * The functions found here in the core library are for internal use and can be changed + * or removed outside of a major release. We recommend against calling them directly from client code. + */ + import * as elasticsearch from 'aws-cdk-lib/aws-elasticsearch'; import { DefaultCfnDomainProps } from './elasticsearch-defaults'; import { retrievePrivateSubnetIds } from './vpc-helper'; @@ -41,6 +46,9 @@ export interface BuildElasticSearchResponse { readonly role: iam.Role } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function buildElasticSearch(scope: Construct, props: BuildElasticSearchProps): BuildElasticSearchResponse { let subnetIds: string[] = []; @@ -91,6 +99,9 @@ export function buildElasticSearch(scope: Construct, props: BuildElasticSearchPr return { domain: esDomain, role: cognitoKibanaConfigureRole }; } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function buildElasticSearchCWAlarms(scope: Construct): cloudwatch.Alarm[] { // Setup CW Alarms for ES const alarms: cloudwatch.Alarm[] = new Array(); diff --git a/source/patterns/@aws-solutions-constructs/core/lib/eventbridge-helper.ts b/source/patterns/@aws-solutions-constructs/core/lib/eventbridge-helper.ts index 734f1c2cb..ea4a7b4f7 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/eventbridge-helper.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/eventbridge-helper.ts @@ -11,6 +11,11 @@ * and limitations under the License. */ +/* + * The functions found here in the core library are for internal use and can be changed + * or removed outside of a major release. We recommend against calling them directly from client code. + */ + // Note: To ensure CDKv2 compatibility, keep the import statement for Construct separate import { Construct } from 'constructs'; import * as events from 'aws-cdk-lib/aws-events'; @@ -30,6 +35,9 @@ export interface BuildEventBusProps { readonly eventBusProps?: events.EventBusProps; } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function buildEventBus(scope: Construct, props: BuildEventBusProps): events.IEventBus | undefined { // Check whether existing EventBus is provided if (props.existingEventBusInterface) { diff --git a/source/patterns/@aws-solutions-constructs/core/lib/events-rule-defaults.ts b/source/patterns/@aws-solutions-constructs/core/lib/events-rule-defaults.ts index 7c6100f35..b25799d1d 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/events-rule-defaults.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/events-rule-defaults.ts @@ -11,8 +11,16 @@ * and limitations under the License. */ +/* + * The functions found here in the core library are for internal use and can be changed + * or removed outside of a major release. We recommend against calling them directly from client code. + */ + import * as events from 'aws-cdk-lib/aws-events'; +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function DefaultEventsRuleProps(_targets: events.IRuleTarget[], _eventBus?: events.IEventBus) { const defaultEventsRuleProps: events.RuleProps = { targets: _targets, diff --git a/source/patterns/@aws-solutions-constructs/core/lib/fargate-defaults.ts b/source/patterns/@aws-solutions-constructs/core/lib/fargate-defaults.ts index edde77b5b..8c9fd1bcd 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/fargate-defaults.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/fargate-defaults.ts @@ -11,16 +11,27 @@ * and limitations under the License. */ +/* + * The functions found here in the core library are for internal use and can be changed + * or removed outside of a major release. We recommend against calling them directly from client code. + */ + import * as ec2 from "aws-cdk-lib/aws-ec2"; import * as ecs from "aws-cdk-lib/aws-ecs"; import * as elb from "aws-cdk-lib/aws-elasticloadbalancingv2"; +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function DefaultClusterProps() { return { }; } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function DefaultFargateServiceProps( ) { return { @@ -32,6 +43,9 @@ export function DefaultFargateServiceProps( }; } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function DefaultFargateTaskDefinitionProps(): ecs.FargateTaskDefinitionProps { return { cpu: 256, @@ -39,6 +53,9 @@ export function DefaultFargateTaskDefinitionProps(): ecs.FargateTaskDefinitionPr }; } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function DefaultApplicationTargetGroupProps(vpc: ec2.IVpc): elb.ApplicationTargetGroupProps { return { port: 8080, @@ -50,6 +67,9 @@ export function DefaultApplicationTargetGroupProps(vpc: ec2.IVpc): elb.Applicati }; } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function DefaultContainerDefinitionProps(): ecs.ContainerDefinitionOptions | any { return { memoryReservationMiB: 512, diff --git a/source/patterns/@aws-solutions-constructs/core/lib/fargate-helper.ts b/source/patterns/@aws-solutions-constructs/core/lib/fargate-helper.ts index 555b9fc18..932d4a0b0 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/fargate-helper.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/fargate-helper.ts @@ -11,6 +11,11 @@ * and limitations under the License. */ +/* + * The functions found here in the core library are for internal use and can be changed + * or removed outside of a major release. We recommend against calling them directly from client code. + */ + import { Construct } from "constructs"; import * as ec2 from "aws-cdk-lib/aws-ec2"; import * as ecs from "aws-cdk-lib/aws-ecs"; @@ -23,6 +28,9 @@ export interface CreateFargateServiceResponse { readonly containerDefinition: ecs.ContainerDefinition } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function CreateFargateService( scope: Construct, id: string, @@ -205,6 +213,9 @@ function CreateTaskDefinition( return { taskDefinition, containerDefinition }; } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function CheckFargateProps(props: any) { let errorMessages = ""; let errorFound = false; @@ -275,6 +286,9 @@ export function CheckFargateProps(props: any) { } } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function getServiceVpcSecurityGroupIds(service: ecs.FargateService): string[] { const securityGroupIds: string[] = []; diff --git a/source/patterns/@aws-solutions-constructs/core/lib/glue-database-defaults.ts b/source/patterns/@aws-solutions-constructs/core/lib/glue-database-defaults.ts index 5e36f53d1..822742e2f 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/glue-database-defaults.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/glue-database-defaults.ts @@ -11,11 +11,16 @@ * and limitations under the License. */ +/* + * The functions found here in the core library are for internal use and can be changed + * or removed outside of a major release. We recommend against calling them directly from client code. + */ + import { CfnDatabaseProps } from "aws-cdk-lib/aws-glue"; import { Aws } from "aws-cdk-lib"; /** - * Default database props + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. */ export function DefaultGlueDatabaseProps(): CfnDatabaseProps { const _databaseProps: CfnDatabaseProps = { diff --git a/source/patterns/@aws-solutions-constructs/core/lib/glue-database-helper.ts b/source/patterns/@aws-solutions-constructs/core/lib/glue-database-helper.ts index a9147c531..be6cd4c43 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/glue-database-helper.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/glue-database-helper.ts @@ -11,10 +11,17 @@ * and limitations under the License. */ +/* + * The functions found here in the core library are for internal use and can be changed + * or removed outside of a major release. We recommend against calling them directly from client code. + */ + import { CfnDatabase, CfnDatabaseProps } from "aws-cdk-lib/aws-glue"; import { Construct } from "constructs"; /** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + * * Create an AWS Glue database with the properties provided * * @param scope diff --git a/source/patterns/@aws-solutions-constructs/core/lib/glue-job-defaults.ts b/source/patterns/@aws-solutions-constructs/core/lib/glue-job-defaults.ts index 21360913a..8693ba99e 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/glue-job-defaults.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/glue-job-defaults.ts @@ -11,10 +11,18 @@ * and limitations under the License. */ +/* + * The functions found here in the core library are for internal use and can be changed + * or removed outside of a major release. We recommend against calling them directly from client code. + */ + import { CfnJobProps } from 'aws-cdk-lib/aws-glue'; import { IRole } from 'aws-cdk-lib/aws-iam'; import * as s3assets from "aws-cdk-lib/aws-s3-assets"; +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function DefaultGlueJobProps(jobRole: IRole, userProvidedGlueJobProps: CfnJobProps | any, glueSecurityConfigName: string, defaultArguments: {}, etlCodeAsset?: s3assets.Asset): CfnJobProps { const glueVersion: string | undefined = userProvidedGlueJobProps.glueVersion; diff --git a/source/patterns/@aws-solutions-constructs/core/lib/glue-job-helper.ts b/source/patterns/@aws-solutions-constructs/core/lib/glue-job-helper.ts index ff5a3b9f1..5a6acd091 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/glue-job-helper.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/glue-job-helper.ts @@ -11,6 +11,11 @@ * and limitations under the License. */ +/* + * The functions found here in the core library are for internal use and can be changed + * or removed outside of a major release. We recommend against calling them directly from client code. + */ + import { Construct } from 'constructs'; import * as glue from 'aws-cdk-lib/aws-glue'; import { Effect, IRole, Policy, PolicyStatement, Role, ServicePrincipal } from 'aws-cdk-lib/aws-iam'; @@ -94,6 +99,9 @@ export interface BuildGlueJobResponse { readonly loggingBucket?: Bucket, } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function buildGlueJob(scope: Construct, props: BuildGlueJobProps): BuildGlueJobResponse { if (!props.existingCfnJob) { if (props.glueJobProps) { @@ -129,6 +137,9 @@ export interface DeployGlueJobResponse { readonly loggingBucket?: Bucket, } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function deployGlueJob(scope: Construct, glueJobProps: glue.CfnJobProps, database: glue.CfnDatabase, table: glue.CfnTable, outputDataStore: SinkDataStoreProps, etlCodeAsset?: s3assets.Asset): DeployGlueJobResponse { @@ -215,6 +226,8 @@ export function deployGlueJob(scope: Construct, glueJobProps: glue.CfnJobProps, } /** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + * * This is a helper method to create the Role required for the Glue Job. If a role is already created then this * method is not required to be called. * @@ -228,6 +241,8 @@ export function createGlueJobRole(scope: Construct): Role { } /** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + * * This method creates an AWS Glue table. The method is called when an existing Glue table is not provided */ export function createGlueTable(scope: Construct, database: glue.CfnDatabase, tableProps?: glue.CfnTableProps, @@ -237,6 +252,8 @@ export function createGlueTable(scope: Construct, database: glue.CfnDatabase, ta } /** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + * * This method creates an AWS Glue database. The method is only called with an existing Glue database type is not provided. * The method uses the user provided props to override the defaul props for the Glue database * diff --git a/source/patterns/@aws-solutions-constructs/core/lib/glue-table-defaults.ts b/source/patterns/@aws-solutions-constructs/core/lib/glue-table-defaults.ts index 5e8cb830e..50eb85a47 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/glue-table-defaults.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/glue-table-defaults.ts @@ -11,9 +11,17 @@ * and limitations under the License. */ +/* + * The functions found here in the core library are for internal use and can be changed + * or removed outside of a major release. We recommend against calling them directly from client code. + */ + import * as glue from "aws-cdk-lib/aws-glue"; import { Aws } from "aws-cdk-lib"; +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function DefaultGlueTableProps(database: glue.CfnDatabase, fieldSchema: glue.CfnTable.ColumnProperty[], sourceType?: string, parameters?: any): glue.CfnTableProps | any { let _tableProps: glue.CfnTableProps; diff --git a/source/patterns/@aws-solutions-constructs/core/lib/glue-table-helper.ts b/source/patterns/@aws-solutions-constructs/core/lib/glue-table-helper.ts index 1d17a52f1..447c57a38 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/glue-table-helper.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/glue-table-helper.ts @@ -11,10 +11,17 @@ * and limitations under the License. */ +/* + * The functions found here in the core library are for internal use and can be changed + * or removed outside of a major release. We recommend against calling them directly from client code. + */ + import { CfnTable, CfnTableProps } from "aws-cdk-lib/aws-glue"; import { Construct } from "constructs"; /** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + * * Method to build the default table props * * @param scope diff --git a/source/patterns/@aws-solutions-constructs/core/lib/input-validation.ts b/source/patterns/@aws-solutions-constructs/core/lib/input-validation.ts index 8bca7cde6..d2711c992 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/input-validation.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/input-validation.ts @@ -11,6 +11,11 @@ * and limitations under the License. */ +/* + * The functions found here in the core library are for internal use and can be changed + * or removed outside of a major release. We recommend against calling them directly from client code. + */ + import * as dynamodb from 'aws-cdk-lib/aws-dynamodb'; import * as kinesis from 'aws-cdk-lib/aws-kinesis'; import * as lambda from 'aws-cdk-lib/aws-lambda'; @@ -84,6 +89,9 @@ export interface VerifiedProps { readonly openSearchDomainProps?: opensearch.CfnDomainProps; } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function CheckProps(propsObject: VerifiedProps | any) { let errorMessages = ''; let errorFound = false; @@ -242,6 +250,9 @@ export function CheckProps(propsObject: VerifiedProps | any) { } } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function CheckListValues(allowedPermissions: string[], submittedValues: string[], valueType: string) { submittedValues.forEach((submittedValue) => { if (!allowedPermissions.includes(submittedValue)) { diff --git a/source/patterns/@aws-solutions-constructs/core/lib/iot-topic-rule-defaults.ts b/source/patterns/@aws-solutions-constructs/core/lib/iot-topic-rule-defaults.ts index 78814e0b4..6ee1d1060 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/iot-topic-rule-defaults.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/iot-topic-rule-defaults.ts @@ -11,8 +11,16 @@ * and limitations under the License. */ +/* + * The functions found here in the core library are for internal use and can be changed + * or removed outside of a major release. We recommend against calling them directly from client code. + */ + import * as iot from 'aws-cdk-lib/aws-iot'; +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function DefaultCfnTopicRuleProps(_actions: iot.CfnTopicRule.ActionProperty[], _sql: string = '') { const _topicRulePayload: iot.CfnTopicRule.TopicRulePayloadProperty = { ruleDisabled: false, diff --git a/source/patterns/@aws-solutions-constructs/core/lib/kinesis-analytics-defaults.ts b/source/patterns/@aws-solutions-constructs/core/lib/kinesis-analytics-defaults.ts index 376d11efc..fe62b05b8 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/kinesis-analytics-defaults.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/kinesis-analytics-defaults.ts @@ -11,6 +11,11 @@ * and limitations under the License. */ +/* + * The functions found here in the core library are for internal use and can be changed + * or removed outside of a major release. We recommend against calling them directly from client code. + */ + import * as kinesisanalytics from 'aws-cdk-lib/aws-kinesisanalytics'; const DefaultCfnApplicationProps: kinesisanalytics.CfnApplicationProps = { diff --git a/source/patterns/@aws-solutions-constructs/core/lib/kinesis-analytics-helper.ts b/source/patterns/@aws-solutions-constructs/core/lib/kinesis-analytics-helper.ts index 3b49f2eee..a1695067b 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/kinesis-analytics-helper.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/kinesis-analytics-helper.ts @@ -11,6 +11,11 @@ * and limitations under the License. */ +/* + * The functions found here in the core library are for internal use and can be changed + * or removed outside of a major release. We recommend against calling them directly from client code. + */ + // Imports import * as kinesisAnalytics from 'aws-cdk-lib/aws-kinesisanalytics'; import * as kinesisFirehose from 'aws-cdk-lib/aws-kinesisfirehose'; @@ -35,6 +40,9 @@ export interface BuildKinesisAnalyticsAppProps { readonly kinesisAnalyticsProps?: kinesisAnalytics.CfnApplicationProps | any } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function buildKinesisAnalyticsApp(scope: Construct, props: BuildKinesisAnalyticsAppProps): kinesisAnalytics.CfnApplication { // Setup the IAM role for Kinesis Analytics diff --git a/source/patterns/@aws-solutions-constructs/core/lib/kinesis-firehose-s3-defaults.ts b/source/patterns/@aws-solutions-constructs/core/lib/kinesis-firehose-s3-defaults.ts index 1bbe8b3e8..e883a8f9b 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/kinesis-firehose-s3-defaults.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/kinesis-firehose-s3-defaults.ts @@ -11,9 +11,17 @@ * and limitations under the License. */ +/* + * The functions found here in the core library are for internal use and can be changed + * or removed outside of a major release. We recommend against calling them directly from client code. + */ + import { CfnDeliveryStreamProps } from 'aws-cdk-lib/aws-kinesisfirehose'; import { IKey } from 'aws-cdk-lib/aws-kms'; +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function DefaultCfnDeliveryStreamProps(_bucketArn: string, _roleArn: string, _logGroupName: string, _logStreamName: string, _kms: IKey, deliveryStreamName?: string): CfnDeliveryStreamProps { diff --git a/source/patterns/@aws-solutions-constructs/core/lib/kinesis-streams-defaults.ts b/source/patterns/@aws-solutions-constructs/core/lib/kinesis-streams-defaults.ts index 0ec965eba..02bd0733d 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/kinesis-streams-defaults.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/kinesis-streams-defaults.ts @@ -11,6 +11,11 @@ * and limitations under the License. */ +/* + * The functions found here in the core library are for internal use and can be changed + * or removed outside of a major release. We recommend against calling them directly from client code. + */ + import * as kinesis from 'aws-cdk-lib/aws-kinesis'; const DefaultStreamProps: kinesis.StreamProps = { diff --git a/source/patterns/@aws-solutions-constructs/core/lib/kinesis-streams-helper.ts b/source/patterns/@aws-solutions-constructs/core/lib/kinesis-streams-helper.ts index d203221d3..f366dafc8 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/kinesis-streams-helper.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/kinesis-streams-helper.ts @@ -11,6 +11,11 @@ * and limitations under the License. */ +/* + * The functions found here in the core library are for internal use and can be changed + * or removed outside of a major release. We recommend against calling them directly from client code. + */ + // Imports import * as kinesis from 'aws-cdk-lib/aws-kinesis'; import { DefaultStreamProps } from './kinesis-streams-defaults'; @@ -36,6 +41,9 @@ export interface BuildKinesisStreamProps { readonly kinesisStreamProps?: kinesis.StreamProps } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function buildKinesisStream(scope: Construct, props: BuildKinesisStreamProps): kinesis.Stream { if (props.existingStreamObj) { @@ -51,6 +59,9 @@ export function buildKinesisStream(scope: Construct, props: BuildKinesisStreamPr return new kinesis.Stream(scope, 'KinesisStream', kinesisStreamProps); } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function buildKinesisStreamCWAlarms(scope: Construct): cloudwatch.Alarm[] { // Setup CW Alarms for KinesisStream const alarms: cloudwatch.Alarm[] = new Array(); diff --git a/source/patterns/@aws-solutions-constructs/core/lib/kms-defaults.ts b/source/patterns/@aws-solutions-constructs/core/lib/kms-defaults.ts index 2ca2f5338..c0538b652 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/kms-defaults.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/kms-defaults.ts @@ -11,6 +11,11 @@ * and limitations under the License. */ +/* + * The functions found here in the core library are for internal use and can be changed + * or removed outside of a major release. We recommend against calling them directly from client code. + */ + import { KeyProps } from 'aws-cdk-lib/aws-kms'; const DefaultEncryptionProps: KeyProps = { diff --git a/source/patterns/@aws-solutions-constructs/core/lib/kms-helper.ts b/source/patterns/@aws-solutions-constructs/core/lib/kms-helper.ts index 3894cd09b..89409af5c 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/kms-helper.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/kms-helper.ts @@ -11,12 +11,20 @@ * and limitations under the License. */ +/* + * The functions found here in the core library are for internal use and can be changed + * or removed outside of a major release. We recommend against calling them directly from client code. + */ + import * as kms from 'aws-cdk-lib/aws-kms'; import { DefaultEncryptionProps } from './kms-defaults'; import { consolidateProps } from './utils'; // Note: To ensure CDKv2 compatibility, keep the import statement for Construct separate import { Construct } from 'constructs'; +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function buildEncryptionKey(scope: Construct, keyProps?: kms.KeyProps): kms.Key { // Setup the key properties let encryptionKeyProps; diff --git a/source/patterns/@aws-solutions-constructs/core/lib/lambda-defaults.ts b/source/patterns/@aws-solutions-constructs/core/lib/lambda-defaults.ts index 1cb92fbe5..09b05c397 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/lambda-defaults.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/lambda-defaults.ts @@ -11,9 +11,17 @@ * and limitations under the License. */ +/* + * The functions found here in the core library are for internal use and can be changed + * or removed outside of a major release. We recommend against calling them directly from client code. + */ + import * as lambda from 'aws-cdk-lib/aws-lambda'; import * as iam from 'aws-cdk-lib/aws-iam'; +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function DefaultLambdaFunctionProps(lambdaServiceRole: iam.Role): lambda.FunctionProps | any { const lambdaFunctionProps: lambda.FunctionProps | any = { diff --git a/source/patterns/@aws-solutions-constructs/core/lib/lambda-event-source-mapping-defaults.ts b/source/patterns/@aws-solutions-constructs/core/lib/lambda-event-source-mapping-defaults.ts index 9e66e5c94..36c814ec5 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/lambda-event-source-mapping-defaults.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/lambda-event-source-mapping-defaults.ts @@ -11,6 +11,11 @@ * and limitations under the License. */ +/* + * The functions found here in the core library are for internal use and can be changed + * or removed outside of a major release. We recommend against calling them directly from client code. + */ + import { Construct } from 'constructs'; import * as lambda from 'aws-cdk-lib/aws-lambda'; import { consolidateProps } from './utils'; @@ -26,6 +31,9 @@ export interface EventSourceProps { readonly sqsDlqQueueProps?: sqs.QueueProps } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function DynamoEventSourceProps(scope: Construct, _dynamoEventSourceProps?: EventSourceProps): DynamoEventSourceProps { const baseProps: DynamoEventSourceProps = { @@ -53,6 +61,9 @@ export function DynamoEventSourceProps(scope: Construct, _dynamoEventSourceProps return consolidateProps(defaultDynamoEventSourceProps, _dynamoEventSourceProps?.eventSourceProps); } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function S3EventSourceProps(_s3EventSourceProps?: S3EventSourceProps) { const defaultS3EventSourceProps: S3EventSourceProps = { @@ -62,6 +73,9 @@ export function S3EventSourceProps(_s3EventSourceProps?: S3EventSourceProps) { return consolidateProps(defaultS3EventSourceProps, _s3EventSourceProps); } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function KinesisEventSourceProps(scope: Construct, _kinesisEventSourceProps?: EventSourceProps): KinesisEventSourceProps { const baseProps: KinesisEventSourceProps = { startingPosition: lambda.StartingPosition.TRIM_HORIZON, diff --git a/source/patterns/@aws-solutions-constructs/core/lib/lambda-helper.ts b/source/patterns/@aws-solutions-constructs/core/lib/lambda-helper.ts index c7405b267..3a5f27c16 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/lambda-helper.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/lambda-helper.ts @@ -11,6 +11,11 @@ * and limitations under the License. */ +/* + * The functions found here in the core library are for internal use and can be changed + * or removed outside of a major release. We recommend against calling them directly from client code. + */ + import * as lambda from 'aws-cdk-lib/aws-lambda'; import * as iam from 'aws-cdk-lib/aws-iam'; import * as ec2 from "aws-cdk-lib/aws-ec2"; @@ -43,6 +48,9 @@ export interface BuildLambdaFunctionProps { readonly vpc?: ec2.IVpc; } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function buildLambdaFunction(scope: Construct, props: BuildLambdaFunctionProps): lambda.Function { // Conditional lambda function creation if (!props.existingLambdaObj) { @@ -69,6 +77,9 @@ export function buildLambdaFunction(scope: Construct, props: BuildLambdaFunction } } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function deployLambdaFunction(scope: Construct, lambdaFunctionProps: lambda.FunctionProps, functionId?: string, @@ -180,9 +191,13 @@ export function deployLambdaFunction(scope: Construct, return lambdafunction; } -// A wrapper above Function.addPermision that -// prevents two different calls to addPermission using -// the same construct id. +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + * + * A wrapper above Function.addPermision that + * prevents two different calls to addPermission using + * the same construct id. + */ export function addPermission(targetFunction: lambda.Function, name: string, permission: lambda.Permission): any { targetFunction.addPermission(GetNextId(targetFunction.permissionsNode.children, name), permission); } @@ -212,6 +227,9 @@ function GetNextId(children: IConstruct[], coreName: string): string { return `${coreName}-${lastSuffix + 1}`; } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function getLambdaVpcSecurityGroupIds(lambdaFunction: lambda.Function): string[] { const securityGroupIds: string[] = []; diff --git a/source/patterns/@aws-solutions-constructs/core/lib/mediastore-defaults.ts b/source/patterns/@aws-solutions-constructs/core/lib/mediastore-defaults.ts index c15c57de5..fd09e56ee 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/mediastore-defaults.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/mediastore-defaults.ts @@ -11,9 +11,17 @@ * and limitations under the License. */ +/* + * The functions found here in the core library are for internal use and can be changed + * or removed outside of a major release. We recommend against calling them directly from client code. + */ + import * as cdk from 'aws-cdk-lib'; import * as mediastore from 'aws-cdk-lib/aws-mediastore'; +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function MediaStoreContainerProps(): mediastore.CfnContainerProps { return { containerName: cdk.Aws.STACK_NAME, diff --git a/source/patterns/@aws-solutions-constructs/core/lib/mediastore-helper.ts b/source/patterns/@aws-solutions-constructs/core/lib/mediastore-helper.ts index e161bfd03..b8428283c 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/mediastore-helper.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/mediastore-helper.ts @@ -11,6 +11,11 @@ * and limitations under the License. */ +/* + * The functions found here in the core library are for internal use and can be changed + * or removed outside of a major release. We recommend against calling them directly from client code. + */ + import * as cdk from 'aws-cdk-lib'; import * as mediastore from 'aws-cdk-lib/aws-mediastore'; import { MediaStoreContainerProps } from './mediastore-defaults'; @@ -18,6 +23,9 @@ import { consolidateProps } from './utils'; // Note: To ensure CDKv2 compatibility, keep the import statement for Construct separate import { Construct } from 'constructs'; +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function MediaStoreContainer(scope: Construct, mediaStoreContainerProps?: mediastore.CfnContainerProps): mediastore.CfnContainer { const defaultprops: mediastore.CfnContainerProps = MediaStoreContainerProps(); let mediaStoreProps: mediastore.CfnContainerProps; diff --git a/source/patterns/@aws-solutions-constructs/core/lib/opensearch-defaults.ts b/source/patterns/@aws-solutions-constructs/core/lib/opensearch-defaults.ts index e5a27dc77..406506975 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/opensearch-defaults.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/opensearch-defaults.ts @@ -11,11 +11,19 @@ * and limitations under the License. */ +/* + * The functions found here in the core library are for internal use and can be changed + * or removed outside of a major release. We recommend against calling them directly from client code. + */ + import * as opensearch from 'aws-cdk-lib/aws-opensearchservice'; import * as iam from 'aws-cdk-lib/aws-iam'; import * as cdk from 'aws-cdk-lib'; import { BuildOpenSearchProps } from './opensearch-helper'; +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function DefaultOpenSearchCfnDomainProps(domainName: string, cognitoConfigureRole: iam.Role, props: BuildOpenSearchProps): opensearch.CfnDomainProps { const roleARNs: iam.IPrincipal[] = []; diff --git a/source/patterns/@aws-solutions-constructs/core/lib/opensearch-helper.ts b/source/patterns/@aws-solutions-constructs/core/lib/opensearch-helper.ts index a91b93781..613ea64bd 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/opensearch-helper.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/opensearch-helper.ts @@ -11,6 +11,11 @@ * and limitations under the License. */ +/* + * The functions found here in the core library are for internal use and can be changed + * or removed outside of a major release. We recommend against calling them directly from client code. + */ + import * as opensearch from 'aws-cdk-lib/aws-opensearchservice'; import { DefaultOpenSearchCfnDomainProps } from './opensearch-defaults'; import { retrievePrivateSubnetIds } from './vpc-helper'; @@ -41,6 +46,9 @@ export interface BuildOpenSearchResponse { readonly role: iam.Role } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function buildOpenSearch(scope: Construct, props: BuildOpenSearchProps): BuildOpenSearchResponse { let subnetIds: string[] = []; const constructDrivenProps: any = {}; @@ -90,6 +98,9 @@ export function buildOpenSearch(scope: Construct, props: BuildOpenSearchProps): return { domain: opensearchDomain, role: cognitoDashboardConfigureRole }; } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function buildOpenSearchCWAlarms(scope: Construct): cloudwatch.Alarm[] { const alarms: cloudwatch.Alarm[] = new Array(); diff --git a/source/patterns/@aws-solutions-constructs/core/lib/override-warning-service.ts b/source/patterns/@aws-solutions-constructs/core/lib/override-warning-service.ts index 7e9cbb481..635a049d1 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/override-warning-service.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/override-warning-service.ts @@ -11,10 +11,17 @@ * and limitations under the License. */ +/* + * The functions found here in the core library are for internal use and can be changed + * or removed outside of a major release. We recommend against calling them directly from client code. + */ + import * as deepdiff from 'deep-diff'; import { printWarning } from './utils'; /** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + * * Emits a warning to the console when a prescriptive default value is overridden by the user. * @param {object} defaultProps the prescriptive defaults for the pattern. * @param {object} userProps the properties provided by the user, to be compared against the defaultProps. diff --git a/source/patterns/@aws-solutions-constructs/core/lib/s3-bucket-defaults.ts b/source/patterns/@aws-solutions-constructs/core/lib/s3-bucket-defaults.ts index 7c220aab8..73f96a192 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/s3-bucket-defaults.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/s3-bucket-defaults.ts @@ -11,10 +11,18 @@ * and limitations under the License. */ +/* + * The functions found here in the core library are for internal use and can be changed + * or removed outside of a major release. We recommend against calling them directly from client code. + */ + import * as s3 from 'aws-cdk-lib/aws-s3'; import { RemovalPolicy } from 'aws-cdk-lib'; import { Bucket, BucketProps } from 'aws-cdk-lib/aws-s3'; +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function DefaultS3Props(loggingBucket?: Bucket, lifecycleRules?: s3.LifecycleRule[]): s3.BucketProps { return { encryption: s3.BucketEncryption.S3_MANAGED, @@ -27,6 +35,9 @@ export function DefaultS3Props(loggingBucket?: Bucket, lifecycleRules?: s3.Lifec } as BucketProps; } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function DefaultLoggingBucketProps(): s3.BucketProps { return { encryption: s3.BucketEncryption.S3_MANAGED, diff --git a/source/patterns/@aws-solutions-constructs/core/lib/s3-bucket-helper.ts b/source/patterns/@aws-solutions-constructs/core/lib/s3-bucket-helper.ts index 548e43301..d99d72f3c 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/s3-bucket-helper.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/s3-bucket-helper.ts @@ -11,6 +11,11 @@ * and limitations under the License. */ +/* + * The functions found here in the core library are for internal use and can be changed + * or removed outside of a major release. We recommend against calling them directly from client code. + */ + import * as iam from 'aws-cdk-lib/aws-iam'; import * as lambda from 'aws-cdk-lib/aws-lambda'; import * as s3 from 'aws-cdk-lib/aws-s3'; @@ -44,6 +49,9 @@ export interface BuildS3BucketProps { readonly logS3AccessLogs?: boolean; } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function createLoggingBucket(scope: Construct, bucketId: string, loggingBucketProps: s3.BucketProps): s3.Bucket { @@ -76,6 +84,9 @@ export function createLoggingBucket(scope: Construct, return loggingBucket; } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function createAlbLoggingBucket(scope: Construct, bucketId: string, loggingBucketProps: s3.BucketProps): s3.Bucket { @@ -101,6 +112,9 @@ export interface BuildS3BucketResponse { readonly loggingBucket?: s3.Bucket } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function buildS3Bucket(scope: Construct, props: BuildS3BucketProps, bucketId?: string): BuildS3BucketResponse { @@ -149,6 +163,9 @@ export function buildS3Bucket(scope: Construct, return { bucket: s3Bucket, loggingBucket }; } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function addCfnNagS3BucketNotificationRulesToSuppress(stackRoot: cdk.Stack, logicalId: string) { const notificationsResourceHandler = stackRoot.node.tryFindChild(logicalId) as lambda.Function; const notificationsResourceHandlerRoleRole = notificationsResourceHandler.node.findChild('Role') as iam.Role; diff --git a/source/patterns/@aws-solutions-constructs/core/lib/sagemaker-defaults.ts b/source/patterns/@aws-solutions-constructs/core/lib/sagemaker-defaults.ts index 5077ce37f..c44d797be 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/sagemaker-defaults.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/sagemaker-defaults.ts @@ -11,6 +11,11 @@ * and limitations under the License. */ +/* + * The functions found here in the core library are for internal use and can be changed + * or removed outside of a major release. We recommend against calling them directly from client code. + */ + import { CfnNotebookInstanceProps, CfnModelProps, @@ -19,6 +24,9 @@ import { CfnEndpointProps, } from 'aws-cdk-lib/aws-sagemaker'; +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function DefaultSagemakerNotebookProps( roleArn: string, kmsKeyId: string, @@ -34,6 +42,9 @@ export function DefaultSagemakerNotebookProps( } as CfnNotebookInstanceProps; } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function DefaultSagemakerModelProps( executionRoleArn: string, primaryContainer: CfnModel.ContainerDefinitionProperty, @@ -46,6 +57,9 @@ export function DefaultSagemakerModelProps( } as CfnModelProps; } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function DefaultSagemakerEndpointConfigProps(modelName: string, kmsKeyId?: string): CfnEndpointConfigProps { return { productionVariants: [ @@ -61,6 +75,9 @@ export function DefaultSagemakerEndpointConfigProps(modelName: string, kmsKeyId? } as CfnEndpointConfigProps; } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function DefaultSagemakerEndpointProps(endpointConfigName: string): CfnEndpointProps { return { endpointConfigName, diff --git a/source/patterns/@aws-solutions-constructs/core/lib/sagemaker-helper.ts b/source/patterns/@aws-solutions-constructs/core/lib/sagemaker-helper.ts index 743c62669..9ea8f7786 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/sagemaker-helper.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/sagemaker-helper.ts @@ -11,6 +11,11 @@ * and limitations under the License. */ +/* + * The functions found here in the core library are for internal use and can be changed + * or removed outside of a major release. We recommend against calling them directly from client code. + */ + import * as sagemaker from 'aws-cdk-lib/aws-sagemaker'; import * as ec2 from 'aws-cdk-lib/aws-ec2'; import { buildEncryptionKey } from './kms-helper'; @@ -220,6 +225,9 @@ export interface BuildSagemakerNotebookResponse { readonly securityGroup?: ec2.SecurityGroup } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function buildSagemakerNotebook( scope: Construct, props: BuildSagemakerNotebookProps @@ -342,6 +350,9 @@ export interface BuildSagemakerEndpointResponse { readonly model?: sagemaker.CfnModel } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function BuildSagemakerEndpoint( scope: Construct, props: BuildSagemakerEndpointProps @@ -366,6 +377,9 @@ export interface DeploySagemakerEndpointResponse { readonly model?: sagemaker.CfnModel } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function deploySagemakerEndpoint( scope: Construct, props: BuildSagemakerEndpointProps @@ -410,6 +424,9 @@ export function deploySagemakerEndpoint( } } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function createSagemakerModel( scope: Construct, modelProps: sagemaker.CfnModelProps, @@ -474,6 +491,9 @@ export function createSagemakerModel( } } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function createSagemakerEndpointConfig( scope: Construct, modelName: string, @@ -499,6 +519,9 @@ export function createSagemakerEndpointConfig( return endpointConfig; } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function createSagemakerEndpoint( scope: Construct, endpointConfigName: string, diff --git a/source/patterns/@aws-solutions-constructs/core/lib/secretsmanager-defaults.ts b/source/patterns/@aws-solutions-constructs/core/lib/secretsmanager-defaults.ts index 33c99df4f..48900b3de 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/secretsmanager-defaults.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/secretsmanager-defaults.ts @@ -11,6 +11,11 @@ * and limitations under the License. */ +/* + * The functions found here in the core library are for internal use and can be changed + * or removed outside of a major release. We recommend against calling them directly from client code. + */ + import { SecretProps } from 'aws-cdk-lib/aws-secretsmanager'; import { RemovalPolicy } from 'aws-cdk-lib'; diff --git a/source/patterns/@aws-solutions-constructs/core/lib/secretsmanager-helper.ts b/source/patterns/@aws-solutions-constructs/core/lib/secretsmanager-helper.ts index 442c64ecd..095c96271 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/secretsmanager-helper.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/secretsmanager-helper.ts @@ -11,6 +11,11 @@ * and limitations under the License. */ +/* + * The functions found here in the core library are for internal use and can be changed + * or removed outside of a major release. We recommend against calling them directly from client code. + */ + import { Secret, SecretProps } from 'aws-cdk-lib/aws-secretsmanager'; // Note: To ensure CDKv2 compatibility, keep the import statement for Construct separate import { Construct } from 'constructs'; @@ -18,6 +23,8 @@ import { DefaultSecretProps } from './secretsmanager-defaults'; import { consolidateProps, addCfnSuppressRules } from './utils'; /** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + * * Method to build the default AWS Secrets Manager Secret * * @param scope diff --git a/source/patterns/@aws-solutions-constructs/core/lib/security-group-helper.ts b/source/patterns/@aws-solutions-constructs/core/lib/security-group-helper.ts index 995f8ad32..a8b4a7181 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/security-group-helper.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/security-group-helper.ts @@ -11,6 +11,11 @@ * and limitations under the License. */ +/* + * The functions found here in the core library are for internal use and can be changed + * or removed outside of a major release. We recommend against calling them directly from client code. + */ + // import { countResources } from "@aws-cdk/assert"; import * as ec2 from "aws-cdk-lib/aws-ec2"; import { Construct } from "constructs"; @@ -23,6 +28,9 @@ export interface SecurityGroupRuleDefinition { readonly remoteRule?: boolean } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function buildSecurityGroup( scope: Construct, name: string, @@ -56,6 +64,9 @@ export function buildSecurityGroup( return newSecurityGroup; } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function CreateSelfReferencingSecurityGroup(scope: Construct, id: string, vpc: ec2.IVpc, cachePort: any) { const newCacheSG = new ec2.SecurityGroup(scope, `${id}-cachesg`, { vpc, diff --git a/source/patterns/@aws-solutions-constructs/core/lib/sns-defaults.ts b/source/patterns/@aws-solutions-constructs/core/lib/sns-defaults.ts index 3d7301ff0..af0384df3 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/sns-defaults.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/sns-defaults.ts @@ -11,6 +11,11 @@ * and limitations under the License. */ +/* + * The functions found here in the core library are for internal use and can be changed + * or removed outside of a major release. We recommend against calling them directly from client code. + */ + import * as sns from 'aws-cdk-lib/aws-sns'; const DefaultSnsTopicProps: sns.TopicProps = {}; diff --git a/source/patterns/@aws-solutions-constructs/core/lib/sns-helper.ts b/source/patterns/@aws-solutions-constructs/core/lib/sns-helper.ts index 6cc262fdb..5e0c61beb 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/sns-helper.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/sns-helper.ts @@ -11,6 +11,11 @@ * and limitations under the License. */ +/* + * The functions found here in the core library are for internal use and can be changed + * or removed outside of a major release. We recommend against calling them directly from client code. + */ + // Imports import * as sns from 'aws-cdk-lib/aws-sns'; import * as kms from 'aws-cdk-lib/aws-kms'; @@ -131,6 +136,9 @@ export interface BuildTopicResponse { readonly key?: kms.Key } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function buildTopic(scope: Construct, props: BuildTopicProps): BuildTopicResponse { if (!props.existingTopicObj) { // Setup the topic properties diff --git a/source/patterns/@aws-solutions-constructs/core/lib/sqs-defaults.ts b/source/patterns/@aws-solutions-constructs/core/lib/sqs-defaults.ts index fc3ca5425..cbf8a5de2 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/sqs-defaults.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/sqs-defaults.ts @@ -11,8 +11,16 @@ * and limitations under the License. */ +/* + * The functions found here in the core library are for internal use and can be changed + * or removed outside of a major release. We recommend against calling them directly from client code. + */ + import * as sqs from 'aws-cdk-lib/aws-sqs'; +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function DefaultQueueProps() { const _DefaultQueueProps: sqs.QueueProps = { encryption: sqs.QueueEncryption.KMS_MANAGED diff --git a/source/patterns/@aws-solutions-constructs/core/lib/sqs-helper.ts b/source/patterns/@aws-solutions-constructs/core/lib/sqs-helper.ts index 4ada7f9cf..6966eea1a 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/sqs-helper.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/sqs-helper.ts @@ -11,6 +11,11 @@ * and limitations under the License. */ +/* + * The functions found here in the core library are for internal use and can be changed + * or removed outside of a major release. We recommend against calling them directly from client code. + */ + // Imports import * as sqs from 'aws-cdk-lib/aws-sqs'; import * as defaults from './sqs-defaults'; @@ -67,6 +72,9 @@ export interface BuildQueueResponse { readonly key?: kms.IKey } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function buildQueue(scope: Construct, id: string, props: BuildQueueProps): BuildQueueResponse { if ((props.queueProps?.encryptionMasterKey || props.encryptionKey || props.encryptionKeyProps) @@ -142,6 +150,9 @@ export interface BuildDeadLetterQueueProps { readonly maxReceiveCount?: number } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function buildDeadLetterQueue(scope: Construct, props: BuildDeadLetterQueueProps): sqs.DeadLetterQueue | undefined { if (!props.existingQueueObj && (props.deployDeadLetterQueue || props.deployDeadLetterQueue === undefined)) { // Create the Dead Letter Queue diff --git a/source/patterns/@aws-solutions-constructs/core/lib/ssm-string-parameter-helper.ts b/source/patterns/@aws-solutions-constructs/core/lib/ssm-string-parameter-helper.ts index c593ae3af..fcac75679 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/ssm-string-parameter-helper.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/ssm-string-parameter-helper.ts @@ -11,10 +11,17 @@ * and limitations under the License. */ +/* + * The functions found here in the core library are for internal use and can be changed + * or removed outside of a major release. We recommend against calling them directly from client code. + */ + import {StringParameter, StringParameterProps} from 'aws-cdk-lib/aws-ssm'; import {Construct} from 'constructs'; /** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + * * Method to build the default AWS SSM Parameter Store * * @param scope diff --git a/source/patterns/@aws-solutions-constructs/core/lib/step-function-defaults.ts b/source/patterns/@aws-solutions-constructs/core/lib/step-function-defaults.ts index e14bdd4d2..63a5a8000 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/step-function-defaults.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/step-function-defaults.ts @@ -11,9 +11,17 @@ * and limitations under the License. */ +/* + * The functions found here in the core library are for internal use and can be changed + * or removed outside of a major release. We recommend against calling them directly from client code. + */ + import * as sfn from 'aws-cdk-lib/aws-stepfunctions'; import { ILogGroup } from 'aws-cdk-lib/aws-logs'; +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function DefaultStateMachineProps(_logGroup: ILogGroup): sfn.StateMachineProps | any { const stateMachineProps: sfn.StateMachineProps | any = { diff --git a/source/patterns/@aws-solutions-constructs/core/lib/step-function-helper.ts b/source/patterns/@aws-solutions-constructs/core/lib/step-function-helper.ts index 64397129a..5aba5c9cb 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/step-function-helper.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/step-function-helper.ts @@ -11,6 +11,11 @@ * and limitations under the License. */ +/* + * The functions found here in the core library are for internal use and can be changed + * or removed outside of a major release. We recommend against calling them directly from client code. + */ + // Imports import * as logs from 'aws-cdk-lib/aws-logs'; import * as cdk from 'aws-cdk-lib'; @@ -28,6 +33,8 @@ export interface BuildStateMachineResponse { readonly logGroup: logs.ILogGroup } /** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + * * Builds and returns a StateMachine. * @param scope - the construct to which the StateMachine should be attached to. * @param stateMachineProps - user-specified properties to override the default properties. @@ -108,6 +115,9 @@ export function buildStateMachine(scope: Construct, stateMachineProps: sfn.State return { stateMachine: newStateMachine, logGroup }; } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function buildStepFunctionCWAlarms(scope: Construct, sm: sfn.StateMachine): cloudwatch.Alarm[] { // Setup CW Alarms for State Machine const alarms: cloudwatch.Alarm[] = new Array(); diff --git a/source/patterns/@aws-solutions-constructs/core/lib/utils.ts b/source/patterns/@aws-solutions-constructs/core/lib/utils.ts index 2c7db764d..f1a7ed046 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/utils.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/utils.ts @@ -11,6 +11,11 @@ * and limitations under the License. */ +/* + * The functions found here in the core library are for internal use and can be changed + * or removed outside of a major release. We recommend against calling them directly from client code. + */ + import * as deepmerge from 'deepmerge'; import { flagOverriddenDefaults } from './override-warning-service'; import * as log from 'npmlog'; @@ -62,6 +67,9 @@ function overwriteMerge(target: any[], source: any[]) { return target; } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function overrideProps(DefaultProps: object, userProps: object, concatArray: boolean = false): any { // Notify the user via console output if defaults are overridden const overrideWarningsEnabled = (process.env.overrideWarningsEnabled !== 'false'); @@ -82,6 +90,9 @@ export function overrideProps(DefaultProps: object, userProps: object, concatArr } } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function printWarning(message: string) { // Style the log output log.prefixStyle.bold = true; @@ -91,6 +102,8 @@ export function printWarning(message: string) { } /** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + * * @summary Creates a resource name in the style of the CDK (string+hash) * @param {string[]} parts - the various string components of the name (eg - stackName, solutions construct ID, L2 construct ID) * @param {number} maxLength - the longest string that can be returned @@ -136,6 +149,8 @@ export interface CfnNagSuppressRule { } /** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + * * Adds CFN NAG suppress rules to the CDK resource. * @param resource The CDK resource * @param rules The CFN NAG suppress rules @@ -155,6 +170,8 @@ export function addCfnSuppressRules(resource: cdk.Resource | cdk.CfnResource, ru } /** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + * * Creates the props to be used to instantiate a CDK L2 construct within a Solutions Construct * * @param defaultProps The default props to be used by the construct @@ -180,6 +197,8 @@ export function consolidateProps(defaultProps: object, clientProps?: object, con } /** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + * * Generates a name unique to this location in this stack with this stackname. Truncates to under 64 characters if needed. * (will allow 2 copies of the stack with different stack names, but will collide if both stacks have the same name) * diff --git a/source/patterns/@aws-solutions-constructs/core/lib/vpc-defaults.ts b/source/patterns/@aws-solutions-constructs/core/lib/vpc-defaults.ts index 7149230ac..c54043e94 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/vpc-defaults.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/vpc-defaults.ts @@ -11,10 +11,15 @@ * and limitations under the License. */ +/* + * The functions found here in the core library are for internal use and can be changed + * or removed outside of a major release. We recommend against calling them directly from client code. + */ + import * as ec2 from "aws-cdk-lib/aws-ec2"; /** - * Default VPC with public and private subnets + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. */ export function DefaultPublicPrivateVpcProps(): ec2.VpcProps { return { @@ -22,7 +27,7 @@ export function DefaultPublicPrivateVpcProps(): ec2.VpcProps { } /** - * Default VPC with isolated subnets + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. */ export function DefaultIsolatedVpcProps(): ec2.VpcProps { return { @@ -38,7 +43,7 @@ export function DefaultIsolatedVpcProps(): ec2.VpcProps { } /** - * Default VPC with private subnets w/NAT + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. */ export function DefaultPrivateVpcProps(): ec2.VpcProps { return { diff --git a/source/patterns/@aws-solutions-constructs/core/lib/vpc-helper.ts b/source/patterns/@aws-solutions-constructs/core/lib/vpc-helper.ts index 0e2450b55..3413a55fc 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/vpc-helper.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/vpc-helper.ts @@ -11,6 +11,11 @@ * and limitations under the License. */ +/* + * The functions found here in the core library are for internal use and can be changed + * or removed outside of a major release. We recommend against calling them directly from client code. + */ + import * as ec2 from "aws-cdk-lib/aws-ec2"; import { CfnLogGroup } from "aws-cdk-lib/aws-logs"; import { Construct } from "constructs"; @@ -37,6 +42,9 @@ export interface BuildVpcProps { readonly constructVpcProps?: ec2.VpcProps; } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function buildVpc(scope: Construct, props: BuildVpcProps): ec2.IVpc { if (props?.existingVpc) { return props?.existingVpc; @@ -153,6 +161,9 @@ const endpointSettings: EndpointDefinition[] = [ } ]; +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function AddAwsServiceEndpoint( scope: Construct, vpc: ec2.IVpc, @@ -232,6 +243,9 @@ function AddGatewayEndpoint(vpc: ec2.IVpc, service: EndpointDefinition, interfac }); } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function retrievePrivateSubnetIds(vpc: ec2.IVpc) { let targetSubnetType; diff --git a/source/patterns/@aws-solutions-constructs/core/lib/waf-defaults.ts b/source/patterns/@aws-solutions-constructs/core/lib/waf-defaults.ts index c44014f24..929c47486 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/waf-defaults.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/waf-defaults.ts @@ -11,8 +11,16 @@ * and limitations under the License. */ +/* + * The functions found here in the core library are for internal use and can be changed + * or removed outside of a major release. We recommend against calling them directly from client code. + */ + import * as waf from "aws-cdk-lib/aws-wafv2"; +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function DefaultWafRules(): waf.CfnRuleGroup.RuleProperty[] { return [ wrapManagedRuleSet("AWSManagedRulesBotControlRuleSet", "AWS", 0), @@ -25,6 +33,9 @@ export function DefaultWafRules(): waf.CfnRuleGroup.RuleProperty[] { ] as waf.CfnWebACL.RuleProperty[]; } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function wrapManagedRuleSet(managedGroupName: string, vendorName: string, priority: number) { return { name: `${vendorName}-${managedGroupName}`, @@ -44,6 +55,9 @@ export function wrapManagedRuleSet(managedGroupName: string, vendorName: string, } as waf.CfnRuleGroup.RuleProperty; } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function DefaultWafwebaclProps(webaclScope: string) { return { defaultAction: { diff --git a/source/patterns/@aws-solutions-constructs/core/lib/waf-helper.ts b/source/patterns/@aws-solutions-constructs/core/lib/waf-helper.ts index 3b67e240c..4e34f1a52 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/waf-helper.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/waf-helper.ts @@ -11,6 +11,11 @@ * and limitations under the License. */ +/* + * The functions found here in the core library are for internal use and can be changed + * or removed outside of a major release. We recommend against calling them directly from client code. + */ + import { Construct } from "constructs"; import * as waf from "aws-cdk-lib/aws-wafv2"; import { DefaultWafwebaclProps } from "./waf-defaults"; @@ -27,6 +32,9 @@ export interface BuildWebaclProps { readonly webaclProps?: waf.CfnWebACLProps; } +/** + * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. + */ export function buildWebacl(scope: Construct, webaclScope: string, props: BuildWebaclProps): waf.CfnWebACL { let webAcl; From 84e581cad10f59daf827fb6e8f8101e1ec6b11f3 Mon Sep 17 00:00:00 2001 From: biffgaut <78155736+biffgaut@users.noreply.github.com> Date: Fri, 17 Mar 2023 13:11:25 -0400 Subject: [PATCH 2/6] fix(StepFunctions): Address LogGroup behavior problems (#922) * Implementation * Clean up some code cruft --- .../test/eventbridge-stepfunctions.test.ts | 27 +++++- ...pfunctions-existing-eventbus.expected.json | 2 +- ...tbridge-stepfunctions-existing-eventbus.ts | 3 +- ...e-stepfunctions-new-eventbus.expected.json | 2 +- ....eventbridge-stepfunctions-new-eventbus.ts | 3 +- ...ge-stepfunctions-no-argument.expected.json | 2 +- ...g.eventbridge-stepfunctions-no-argument.ts | 3 +- ...ge-stepfunctions-with-lambda.expected.json | 2 +- ...g.eventbridge-stepfunctions-with-lambda.ts | 3 +- .../test/fargate-stepfunctions.test.ts | 28 +++++- .../test/integ.new-resources.expected.json | 2 +- .../test/integ.new-resources.ts | 3 +- .../integ.no-cloudwatch-alarms.expected.json | 2 +- .../test/integ.no-cloudwatch-alarms.ts | 3 +- .../test/integ.deploy-lambda.expected.json | 2 +- .../test/integ.deploy-lambda.ts | 5 +- .../integ.deployFunctionWithVpc.expected.json | 2 +- .../test/integ.deployFunctionWithVpc.ts | 7 +- .../integ.existing-function.expected.json | 2 +- .../test/integ.existing-function.ts | 5 +- .../test/lambda-stepfunctions.test.ts | 40 ++++++++- .../integ.customLoggingBucket.expected.json | 2 +- .../test/integ.customLoggingBucket.ts | 3 +- .../integ.pre-existing-bucket.expected.json | 2 +- .../test/integ.pre-existing-bucket.ts | 3 +- ...s3-stepfunctions-no-argument.expected.json | 2 +- .../integ.s3-stepfunctions-no-argument.ts | 3 +- .../test/s3-stepfunctions.test.ts | 27 +++++- .../core/lib/cloudwatch-log-group-helper.ts | 12 +-- .../core/lib/step-function-helper.ts | 65 +++++++------- .../core/lib/utils.ts | 7 +- .../core/test/step-function-helper.test.ts | 90 +++++++++++++++---- .../core/test/utils.test.ts | 39 ++++---- 33 files changed, 302 insertions(+), 101 deletions(-) diff --git a/source/patterns/@aws-solutions-constructs/aws-eventbridge-stepfunctions/test/eventbridge-stepfunctions.test.ts b/source/patterns/@aws-solutions-constructs/aws-eventbridge-stepfunctions/test/eventbridge-stepfunctions.test.ts index cf8ab359d..324c8f44d 100644 --- a/source/patterns/@aws-solutions-constructs/aws-eventbridge-stepfunctions/test/eventbridge-stepfunctions.test.ts +++ b/source/patterns/@aws-solutions-constructs/aws-eventbridge-stepfunctions/test/eventbridge-stepfunctions.test.ts @@ -17,6 +17,7 @@ import { Duration } from 'aws-cdk-lib'; import * as sfn from 'aws-cdk-lib/aws-stepfunctions'; import '@aws-cdk/assert/jest'; import * as cdk from 'aws-cdk-lib'; +import { Template } from 'aws-cdk-lib/assertions'; function deployNewStateMachine(stack: cdk.Stack) { @@ -192,4 +193,28 @@ test('check custom event bus resource with props when deploy:true', () => { expect(stack).toHaveResource('AWS::Events::EventBus', { Name: 'testcustomeventbus' }); -}); \ No newline at end of file +}); + +test('check LogGroup name', () => { + const stack = new cdk.Stack(); + + deployNewStateMachine(stack); + + // Perform some fancy stuff to examine the specifics of the LogGroupName + const expectedPrefix = '/aws/vendedlogs/states/constructs/'; + const lengthOfDatetimeSuffix = 13; + + const LogGroup = Template.fromStack(stack).findResources("AWS::Logs::LogGroup"); + + const logName = LogGroup.testeventbridgestepfunctionsStateMachineLogGroup826A5B74.Properties.LogGroupName; + const suffix = logName.slice(-lengthOfDatetimeSuffix); + + // Look for the expected Prefix and the 13 digit time suffix + expect(logName.slice(0, expectedPrefix.length)).toEqual(expectedPrefix); + expect(IsWholeNumber(suffix)).not.toBe(false); +}); + +function IsWholeNumber(target: string): boolean { + const numberPattern = /[0-9]{13}/; + return target.match(numberPattern) !== null; +} diff --git a/source/patterns/@aws-solutions-constructs/aws-eventbridge-stepfunctions/test/integ.eventbridge-stepfunctions-existing-eventbus.expected.json b/source/patterns/@aws-solutions-constructs/aws-eventbridge-stepfunctions/test/integ.eventbridge-stepfunctions-existing-eventbus.expected.json index 0b621f511..bfbfb3c3f 100644 --- a/source/patterns/@aws-solutions-constructs/aws-eventbridge-stepfunctions/test/integ.eventbridge-stepfunctions-existing-eventbus.expected.json +++ b/source/patterns/@aws-solutions-constructs/aws-eventbridge-stepfunctions/test/integ.eventbridge-stepfunctions-existing-eventbus.expected.json @@ -147,7 +147,7 @@ "testeventbridgestepfunctionsneweventbusconstructStateMachineLogGroup6DC6AD59": { "Type": "AWS::Logs::LogGroup", "Properties": { - "LogGroupName": "/aws/vendedlogs/states/eventbridgestepfunctionsexistingeventbustesteventbridgestepfunctionsneweventbusconstructstatemachinelogac9442d7e2fa" + "LogGroupName": "integ-test-existing-eventbus" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete", diff --git a/source/patterns/@aws-solutions-constructs/aws-eventbridge-stepfunctions/test/integ.eventbridge-stepfunctions-existing-eventbus.ts b/source/patterns/@aws-solutions-constructs/aws-eventbridge-stepfunctions/test/integ.eventbridge-stepfunctions-existing-eventbus.ts index 6c79ef908..f3a66a610 100644 --- a/source/patterns/@aws-solutions-constructs/aws-eventbridge-stepfunctions/test/integ.eventbridge-stepfunctions-existing-eventbus.ts +++ b/source/patterns/@aws-solutions-constructs/aws-eventbridge-stepfunctions/test/integ.eventbridge-stepfunctions-existing-eventbus.ts @@ -50,7 +50,8 @@ const props: EventbridgeToStepfunctionsProps = { }, existingEventBusInterface: existingEventBus, logGroupProps: { - removalPolicy: RemovalPolicy.DESTROY + removalPolicy: RemovalPolicy.DESTROY, + logGroupName: "integ-test-existing-eventbus" }, }; diff --git a/source/patterns/@aws-solutions-constructs/aws-eventbridge-stepfunctions/test/integ.eventbridge-stepfunctions-new-eventbus.expected.json b/source/patterns/@aws-solutions-constructs/aws-eventbridge-stepfunctions/test/integ.eventbridge-stepfunctions-new-eventbus.expected.json index 27bdbb151..48269ef73 100644 --- a/source/patterns/@aws-solutions-constructs/aws-eventbridge-stepfunctions/test/integ.eventbridge-stepfunctions-new-eventbus.expected.json +++ b/source/patterns/@aws-solutions-constructs/aws-eventbridge-stepfunctions/test/integ.eventbridge-stepfunctions-new-eventbus.expected.json @@ -141,7 +141,7 @@ "testeventbridgestepfunctionsneweventbusconstructStateMachineLogGroup6DC6AD59": { "Type": "AWS::Logs::LogGroup", "Properties": { - "LogGroupName": "/aws/vendedlogs/states/eventbridgestepfunctionsneweventbustesteventbridgestepfunctionsneweventbusconstructstatemachinelog651032919fdf" + "LogGroupName": "integ-test-new-eventbus" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete", diff --git a/source/patterns/@aws-solutions-constructs/aws-eventbridge-stepfunctions/test/integ.eventbridge-stepfunctions-new-eventbus.ts b/source/patterns/@aws-solutions-constructs/aws-eventbridge-stepfunctions/test/integ.eventbridge-stepfunctions-new-eventbus.ts index 978436bc2..05c23d75c 100644 --- a/source/patterns/@aws-solutions-constructs/aws-eventbridge-stepfunctions/test/integ.eventbridge-stepfunctions-new-eventbus.ts +++ b/source/patterns/@aws-solutions-constructs/aws-eventbridge-stepfunctions/test/integ.eventbridge-stepfunctions-new-eventbus.ts @@ -48,7 +48,8 @@ const props: EventbridgeToStepfunctionsProps = { }, eventBusProps: { eventBusName: 'test' }, logGroupProps: { - removalPolicy: RemovalPolicy.DESTROY + removalPolicy: RemovalPolicy.DESTROY, + logGroupName: "integ-test-new-eventbus" }, }; diff --git a/source/patterns/@aws-solutions-constructs/aws-eventbridge-stepfunctions/test/integ.eventbridge-stepfunctions-no-argument.expected.json b/source/patterns/@aws-solutions-constructs/aws-eventbridge-stepfunctions/test/integ.eventbridge-stepfunctions-no-argument.expected.json index a34bcbdb5..0c108fa64 100644 --- a/source/patterns/@aws-solutions-constructs/aws-eventbridge-stepfunctions/test/integ.eventbridge-stepfunctions-no-argument.expected.json +++ b/source/patterns/@aws-solutions-constructs/aws-eventbridge-stepfunctions/test/integ.eventbridge-stepfunctions-no-argument.expected.json @@ -3,7 +3,7 @@ "testeventbridgestepfunctionsconstructStateMachineLogGroup3098B32C": { "Type": "AWS::Logs::LogGroup", "Properties": { - "LogGroupName": "/aws/vendedlogs/states/eventbridgestepfunctionsnoargumenttesteventbridgestepfunctionsconstructstatemachinelog56559569213c" + "LogGroupName": "integ-test-no-arguments" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete", diff --git a/source/patterns/@aws-solutions-constructs/aws-eventbridge-stepfunctions/test/integ.eventbridge-stepfunctions-no-argument.ts b/source/patterns/@aws-solutions-constructs/aws-eventbridge-stepfunctions/test/integ.eventbridge-stepfunctions-no-argument.ts index d59d4ebb1..cd487eaa8 100644 --- a/source/patterns/@aws-solutions-constructs/aws-eventbridge-stepfunctions/test/integ.eventbridge-stepfunctions-no-argument.ts +++ b/source/patterns/@aws-solutions-constructs/aws-eventbridge-stepfunctions/test/integ.eventbridge-stepfunctions-no-argument.ts @@ -32,7 +32,8 @@ const props: EventbridgeToStepfunctionsProps = { schedule: events.Schedule.rate(Duration.minutes(5)) }, logGroupProps: { - removalPolicy: RemovalPolicy.DESTROY + removalPolicy: RemovalPolicy.DESTROY, + logGroupName: "integ-test-no-arguments" }, }; diff --git a/source/patterns/@aws-solutions-constructs/aws-eventbridge-stepfunctions/test/integ.eventbridge-stepfunctions-with-lambda.expected.json b/source/patterns/@aws-solutions-constructs/aws-eventbridge-stepfunctions/test/integ.eventbridge-stepfunctions-with-lambda.expected.json index 515689eb6..1575bb1b5 100644 --- a/source/patterns/@aws-solutions-constructs/aws-eventbridge-stepfunctions/test/integ.eventbridge-stepfunctions-with-lambda.expected.json +++ b/source/patterns/@aws-solutions-constructs/aws-eventbridge-stepfunctions/test/integ.eventbridge-stepfunctions-with-lambda.expected.json @@ -141,7 +141,7 @@ "testeventbridgestepfunctionsandlambdaconstructStateMachineLogGroup7C2D036A": { "Type": "AWS::Logs::LogGroup", "Properties": { - "LogGroupName": "/aws/vendedlogs/states/eventbridgestepfunctionswithlambdatesteventbridgestepfunctionsandlambdaconstructstatemachinelog1db1bc901e42" + "LogGroupName": "with-lambda" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete", diff --git a/source/patterns/@aws-solutions-constructs/aws-eventbridge-stepfunctions/test/integ.eventbridge-stepfunctions-with-lambda.ts b/source/patterns/@aws-solutions-constructs/aws-eventbridge-stepfunctions/test/integ.eventbridge-stepfunctions-with-lambda.ts index e6985685c..e71a200a4 100644 --- a/source/patterns/@aws-solutions-constructs/aws-eventbridge-stepfunctions/test/integ.eventbridge-stepfunctions-with-lambda.ts +++ b/source/patterns/@aws-solutions-constructs/aws-eventbridge-stepfunctions/test/integ.eventbridge-stepfunctions-with-lambda.ts @@ -46,7 +46,8 @@ const props: EventbridgeToStepfunctionsProps = { schedule: events.Schedule.rate(Duration.minutes(5)) }, logGroupProps: { - removalPolicy: RemovalPolicy.DESTROY + removalPolicy: RemovalPolicy.DESTROY, + logGroupName: "with-lambda" }, }; diff --git a/source/patterns/@aws-solutions-constructs/aws-fargate-stepfunctions/test/fargate-stepfunctions.test.ts b/source/patterns/@aws-solutions-constructs/aws-fargate-stepfunctions/test/fargate-stepfunctions.test.ts index 6e6518e80..efc8d6111 100644 --- a/source/patterns/@aws-solutions-constructs/aws-fargate-stepfunctions/test/fargate-stepfunctions.test.ts +++ b/source/patterns/@aws-solutions-constructs/aws-fargate-stepfunctions/test/fargate-stepfunctions.test.ts @@ -18,6 +18,7 @@ import { FargateToStepfunctions } from "../lib"; import * as stepfunctions from 'aws-cdk-lib/aws-stepfunctions'; import * as ecs from 'aws-cdk-lib/aws-ecs'; import * as ec2 from 'aws-cdk-lib/aws-ec2'; +import { Template } from 'aws-cdk-lib/assertions'; const clusterName = "custom-cluster-name"; const containerName = "custom-container-name"; @@ -311,4 +312,29 @@ function testStateMachineProps(stack: cdk.Stack, userProps?: stepfunctions.State const defaultTestProp = { definition: new stepfunctions.Pass(stack, 'StartState') }; return defaults.consolidateProps(defaultTestProp, userProps); -} \ No newline at end of file +} + +test('check LogGroup name', () => { + const stack = new cdk.Stack(); + const publicApi = true; + + createFargateConstructWithNewResources(stack, publicApi); + + // Perform some fancy stuff to examine the specifics of the LogGroupName + const expectedPrefix = '/aws/vendedlogs/states/constructs/'; + const lengthOfDatetimeSuffix = 13; + + const LogGroup = Template.fromStack(stack).findResources("AWS::Logs::LogGroup"); + + const logName = LogGroup.testconstructStateMachineLogGroup2EB4F48B.Properties.LogGroupName; + const suffix = logName.slice(-lengthOfDatetimeSuffix); + + // Look for the expected Prefix and the 13 digit time suffix + expect(logName.slice(0, expectedPrefix.length)).toEqual(expectedPrefix); + expect(IsWholeNumber(suffix)).not.toBe(false); +}); + +function IsWholeNumber(target: string): boolean { + const numberPattern = /[0-9]{13}/; + return target.match(numberPattern) !== null; +} diff --git a/source/patterns/@aws-solutions-constructs/aws-fargate-stepfunctions/test/integ.new-resources.expected.json b/source/patterns/@aws-solutions-constructs/aws-fargate-stepfunctions/test/integ.new-resources.expected.json index 86a56ac3b..2c7a36d6d 100644 --- a/source/patterns/@aws-solutions-constructs/aws-fargate-stepfunctions/test/integ.new-resources.expected.json +++ b/source/patterns/@aws-solutions-constructs/aws-fargate-stepfunctions/test/integ.new-resources.expected.json @@ -1076,7 +1076,7 @@ "testconstructStateMachineLogGroup2EB4F48B": { "Type": "AWS::Logs::LogGroup", "Properties": { - "LogGroupName": "/aws/vendedlogs/states/newresourcestestconstructstatemachinelog63b3cb15f80b" + "LogGroupName": "with-lambda" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete", diff --git a/source/patterns/@aws-solutions-constructs/aws-fargate-stepfunctions/test/integ.new-resources.ts b/source/patterns/@aws-solutions-constructs/aws-fargate-stepfunctions/test/integ.new-resources.ts index 7fbc9bd56..45619476f 100644 --- a/source/patterns/@aws-solutions-constructs/aws-fargate-stepfunctions/test/integ.new-resources.ts +++ b/source/patterns/@aws-solutions-constructs/aws-fargate-stepfunctions/test/integ.new-resources.ts @@ -49,7 +49,8 @@ const constructProps: FargateToStepfunctionsProps = { existingFargateServiceObject: createFargateServiceResponse.service, stateMachineEnvironmentVariableName: 'CUSTOM_NAME', logGroupProps: { - removalPolicy: RemovalPolicy.DESTROY + removalPolicy: RemovalPolicy.DESTROY, + logGroupName: "with-lambda" } }; diff --git a/source/patterns/@aws-solutions-constructs/aws-fargate-stepfunctions/test/integ.no-cloudwatch-alarms.expected.json b/source/patterns/@aws-solutions-constructs/aws-fargate-stepfunctions/test/integ.no-cloudwatch-alarms.expected.json index 059f83da6..8da9fc9df 100644 --- a/source/patterns/@aws-solutions-constructs/aws-fargate-stepfunctions/test/integ.no-cloudwatch-alarms.expected.json +++ b/source/patterns/@aws-solutions-constructs/aws-fargate-stepfunctions/test/integ.no-cloudwatch-alarms.expected.json @@ -1076,7 +1076,7 @@ "testconstructStateMachineLogGroup2EB4F48B": { "Type": "AWS::Logs::LogGroup", "Properties": { - "LogGroupName": "/aws/vendedlogs/states/nocloudwatchalarmstestconstructstatemachinelogdbb9902b27ea" + "LogGroupName": "with-lambda" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete", diff --git a/source/patterns/@aws-solutions-constructs/aws-fargate-stepfunctions/test/integ.no-cloudwatch-alarms.ts b/source/patterns/@aws-solutions-constructs/aws-fargate-stepfunctions/test/integ.no-cloudwatch-alarms.ts index d42018563..14afcb378 100644 --- a/source/patterns/@aws-solutions-constructs/aws-fargate-stepfunctions/test/integ.no-cloudwatch-alarms.ts +++ b/source/patterns/@aws-solutions-constructs/aws-fargate-stepfunctions/test/integ.no-cloudwatch-alarms.ts @@ -49,7 +49,8 @@ const constructProps: FargateToStepfunctionsProps = { existingFargateServiceObject: createFargateServiceResponse.service, createCloudWatchAlarms: false, logGroupProps: { - removalPolicy: RemovalPolicy.DESTROY + removalPolicy: RemovalPolicy.DESTROY, + logGroupName: "with-lambda" } }; diff --git a/source/patterns/@aws-solutions-constructs/aws-lambda-stepfunctions/test/integ.deploy-lambda.expected.json b/source/patterns/@aws-solutions-constructs/aws-lambda-stepfunctions/test/integ.deploy-lambda.expected.json index 4645282eb..5b143ae00 100644 --- a/source/patterns/@aws-solutions-constructs/aws-lambda-stepfunctions/test/integ.deploy-lambda.expected.json +++ b/source/patterns/@aws-solutions-constructs/aws-lambda-stepfunctions/test/integ.deploy-lambda.expected.json @@ -3,7 +3,7 @@ "testlambdastepfunctionsconstructStateMachineLogGroup1FD4C0D4": { "Type": "AWS::Logs::LogGroup", "Properties": { - "LogGroupName": "/aws/vendedlogs/states/deploylambdatestlambdastepfunctionsconstructstatemachinelogb258d52dbe27" + "LogGroupName": "with-lambda" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete", diff --git a/source/patterns/@aws-solutions-constructs/aws-lambda-stepfunctions/test/integ.deploy-lambda.ts b/source/patterns/@aws-solutions-constructs/aws-lambda-stepfunctions/test/integ.deploy-lambda.ts index c27c27f06..fbfddad5a 100644 --- a/source/patterns/@aws-solutions-constructs/aws-lambda-stepfunctions/test/integ.deploy-lambda.ts +++ b/source/patterns/@aws-solutions-constructs/aws-lambda-stepfunctions/test/integ.deploy-lambda.ts @@ -36,8 +36,9 @@ const props: LambdaToStepfunctionsProps = { definition: startState }, logGroupProps: { - removalPolicy: RemovalPolicy.DESTROY - }, + removalPolicy: RemovalPolicy.DESTROY, + logGroupName: "with-lambda" + } }; // Add the pattern diff --git a/source/patterns/@aws-solutions-constructs/aws-lambda-stepfunctions/test/integ.deployFunctionWithVpc.expected.json b/source/patterns/@aws-solutions-constructs/aws-lambda-stepfunctions/test/integ.deployFunctionWithVpc.expected.json index c4be8351f..b6a15e9ab 100644 --- a/source/patterns/@aws-solutions-constructs/aws-lambda-stepfunctions/test/integ.deployFunctionWithVpc.expected.json +++ b/source/patterns/@aws-solutions-constructs/aws-lambda-stepfunctions/test/integ.deployFunctionWithVpc.expected.json @@ -4,7 +4,7 @@ "testlambdastepfunctionsStateMachineLogGroupD3F22A89": { "Type": "AWS::Logs::LogGroup", "Properties": { - "LogGroupName": "/aws/vendedlogs/states/deployfunctionwithvpctestlambdastepfunctionsstatemachinelog97398dca7a29" + "LogGroupName": "with-lambda" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete", diff --git a/source/patterns/@aws-solutions-constructs/aws-lambda-stepfunctions/test/integ.deployFunctionWithVpc.ts b/source/patterns/@aws-solutions-constructs/aws-lambda-stepfunctions/test/integ.deployFunctionWithVpc.ts index 4daec5f7b..7039ee02d 100644 --- a/source/patterns/@aws-solutions-constructs/aws-lambda-stepfunctions/test/integ.deployFunctionWithVpc.ts +++ b/source/patterns/@aws-solutions-constructs/aws-lambda-stepfunctions/test/integ.deployFunctionWithVpc.ts @@ -36,10 +36,11 @@ const props: LambdaToStepfunctionsProps = { stateMachineProps: { definition: startState }, - logGroupProps: { - removalPolicy: RemovalPolicy.DESTROY - }, deployVpc: true, + logGroupProps: { + removalPolicy: RemovalPolicy.DESTROY, + logGroupName: "with-lambda" + } }; new LambdaToStepfunctions(stack, "test-lambda-stepfunctions", props); diff --git a/source/patterns/@aws-solutions-constructs/aws-lambda-stepfunctions/test/integ.existing-function.expected.json b/source/patterns/@aws-solutions-constructs/aws-lambda-stepfunctions/test/integ.existing-function.expected.json index f61f1d68f..710fba8bd 100644 --- a/source/patterns/@aws-solutions-constructs/aws-lambda-stepfunctions/test/integ.existing-function.expected.json +++ b/source/patterns/@aws-solutions-constructs/aws-lambda-stepfunctions/test/integ.existing-function.expected.json @@ -151,7 +151,7 @@ "testlambdastepfunctionsconstructStateMachineLogGroup1FD4C0D4": { "Type": "AWS::Logs::LogGroup", "Properties": { - "LogGroupName": "/aws/vendedlogs/states/existingfunctiontestlambdastepfunctionsconstructstatemachinelog9e0bca5b4cd6" + "LogGroupName": "with-lambda" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete", diff --git a/source/patterns/@aws-solutions-constructs/aws-lambda-stepfunctions/test/integ.existing-function.ts b/source/patterns/@aws-solutions-constructs/aws-lambda-stepfunctions/test/integ.existing-function.ts index 7bdee1ac6..3eb37c182 100644 --- a/source/patterns/@aws-solutions-constructs/aws-lambda-stepfunctions/test/integ.existing-function.ts +++ b/source/patterns/@aws-solutions-constructs/aws-lambda-stepfunctions/test/integ.existing-function.ts @@ -43,8 +43,9 @@ const props: LambdaToStepfunctionsProps = { definition: startState }, logGroupProps: { - removalPolicy: RemovalPolicy.DESTROY - }, + removalPolicy: RemovalPolicy.DESTROY, + logGroupName: "with-lambda" + } }; // Add the pattern diff --git a/source/patterns/@aws-solutions-constructs/aws-lambda-stepfunctions/test/lambda-stepfunctions.test.ts b/source/patterns/@aws-solutions-constructs/aws-lambda-stepfunctions/test/lambda-stepfunctions.test.ts index ec0594f98..6fdb8334d 100644 --- a/source/patterns/@aws-solutions-constructs/aws-lambda-stepfunctions/test/lambda-stepfunctions.test.ts +++ b/source/patterns/@aws-solutions-constructs/aws-lambda-stepfunctions/test/lambda-stepfunctions.test.ts @@ -19,6 +19,7 @@ import * as stepfunctions from 'aws-cdk-lib/aws-stepfunctions'; import * as ec2 from "aws-cdk-lib/aws-ec2"; import { LambdaToStepfunctions } from '../lib'; import '@aws-cdk/assert/jest'; +import { Template } from "aws-cdk-lib/assertions"; // -------------------------------------------------------------- // Test deployment with new Lambda function @@ -461,4 +462,41 @@ test("Test bad call with existingVpc and deployVpc", () => { }; // Assertion expect(app).toThrowError(); -}); \ No newline at end of file +}); + +test('check LogGroup name', () => { + // Stack + const stack = new Stack(); + // Helper declaration + const startState = new stepfunctions.Pass(stack, 'StartState'); + new LambdaToStepfunctions(stack, 'lambda-to-step-function-stack', { + lambdaFunctionProps: { + runtime: lambda.Runtime.NODEJS_14_X, + handler: 'index.handler', + code: lambda.Code.fromAsset(`${__dirname}/lambda`), + environment: { + LAMBDA_NAME: 'existing-function' + } + }, + stateMachineProps: { + definition: startState + } + }); + // Perform some fancy stuff to examine the specifics of the LogGroupName + const expectedPrefix = '/aws/vendedlogs/states/constructs/'; + const lengthOfDatetimeSuffix = 13; + + const LogGroup = Template.fromStack(stack).findResources("AWS::Logs::LogGroup"); + + const logName = LogGroup.lambdatostepfunctionstackStateMachineLogGroupEAD4854E.Properties.LogGroupName; + const suffix = logName.slice(-lengthOfDatetimeSuffix); + + // Look for the expected Prefix and the 13 digit time suffix + expect(logName.slice(0, expectedPrefix.length)).toEqual(expectedPrefix); + expect(IsWholeNumber(suffix)).not.toBe(false); +}); + +function IsWholeNumber(target: string): boolean { + const numberPattern = /[0-9]{13}/; + return target.match(numberPattern) !== null; +} diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.customLoggingBucket.expected.json b/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.customLoggingBucket.expected.json index 445cbbb3d..568575791 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.customLoggingBucket.expected.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.customLoggingBucket.expected.json @@ -195,7 +195,7 @@ "tests3stepfunctionstests3stepfunctionseventrulestepfunctionconstructStateMachineLogGroupB4555776": { "Type": "AWS::Logs::LogGroup", "Properties": { - "LogGroupName": "/aws/vendedlogs/states/customloggingbuckettests3stepfunctionseventrulestepfunctionconstructstatemachineloga4e9bc58c9e9" + "LogGroupName": "with-lambda" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete", diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.customLoggingBucket.ts b/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.customLoggingBucket.ts index 54cf31a70..ae11eb701 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.customLoggingBucket.ts +++ b/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.customLoggingBucket.ts @@ -39,7 +39,8 @@ new S3ToStepfunctions(stack, 'test-s3-stepfunctions', { versioned: true }, logGroupProps: { - removalPolicy: RemovalPolicy.DESTROY + removalPolicy: RemovalPolicy.DESTROY, + logGroupName: "with-lambda" } }); diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.pre-existing-bucket.expected.json b/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.pre-existing-bucket.expected.json index 041d4c232..6fcc7914c 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.pre-existing-bucket.expected.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.pre-existing-bucket.expected.json @@ -160,7 +160,7 @@ "tests3stepfunctionspreexistingbucketconstructtests3stepfunctionspreexistingbucketconstructeventrulestepfunctionconstructStateMachineLogGroup9D5E3E4D": { "Type": "AWS::Logs::LogGroup", "Properties": { - "LogGroupName": "/aws/vendedlogs/states/preexistingbuckettests3stepfunctionspreexistingbucketconstructeventrulestepfunctstatemachineloga29d0790019e" + "LogGroupName": "with-lambda" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete", diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.pre-existing-bucket.ts b/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.pre-existing-bucket.ts index e27a328d5..f8ecc4893 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.pre-existing-bucket.ts +++ b/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.pre-existing-bucket.ts @@ -32,7 +32,8 @@ const props: S3ToStepfunctionsProps = { definition: startState }, logGroupProps: { - removalPolicy: RemovalPolicy.DESTROY + removalPolicy: RemovalPolicy.DESTROY, + logGroupName: "with-lambda" }, logS3AccessLogs: false }; diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3-stepfunctions-no-argument.expected.json b/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3-stepfunctions-no-argument.expected.json index e9f39cf5f..456f580d9 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3-stepfunctions-no-argument.expected.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3-stepfunctions-no-argument.expected.json @@ -116,7 +116,7 @@ "tests3stepfunctionsconstructtests3stepfunctionsconstructeventrulestepfunctionconstructStateMachineLogGroupE86C2CF5": { "Type": "AWS::Logs::LogGroup", "Properties": { - "LogGroupName": "/aws/vendedlogs/states/s3stepfunctionsnoargumenttests3stepfunctionsconstructeventrulestepfunctionconstructstatemachinelogf07752992857" + "LogGroupName": "with-lambda" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete", diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3-stepfunctions-no-argument.ts b/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3-stepfunctions-no-argument.ts index 032575f5c..184941c9d 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3-stepfunctions-no-argument.ts +++ b/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3-stepfunctions-no-argument.ts @@ -32,7 +32,8 @@ const props: S3ToStepfunctionsProps = { removalPolicy: RemovalPolicy.DESTROY, }, logGroupProps: { - removalPolicy: RemovalPolicy.DESTROY + removalPolicy: RemovalPolicy.DESTROY, + logGroupName: "with-lambda" }, logS3AccessLogs: false }; diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/s3-stepfunctions.test.ts b/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/s3-stepfunctions.test.ts index 5c41152cd..d6a3ae3a2 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/s3-stepfunctions.test.ts +++ b/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/s3-stepfunctions.test.ts @@ -16,6 +16,7 @@ import * as sfn from 'aws-cdk-lib/aws-stepfunctions'; import '@aws-cdk/assert/jest'; import * as cdk from 'aws-cdk-lib'; import { Bucket } from 'aws-cdk-lib/aws-s3'; +import { Template } from 'aws-cdk-lib/assertions'; function deployNewStateMachine(stack: cdk.Stack) { @@ -186,4 +187,28 @@ test('s3 bucket with no logging bucket', () => { expect(stack).toHaveResource("Custom::S3BucketNotifications", {}); expect(construct.s3LoggingBucket).toEqual(undefined); -}); \ No newline at end of file +}); + +test('check LogGroup name', () => { + const stack = new cdk.Stack(); + + deployNewStateMachine(stack); + + // Perform some fancy stuff to examine the specifics of the LogGroupName + const expectedPrefix = '/aws/vendedlogs/states/constructs/'; + const lengthOfDatetimeSuffix = 13; + + const LogGroup = Template.fromStack(stack).findResources("AWS::Logs::LogGroup"); + + const logName = LogGroup.tests3stepfunctionstests3stepfunctionseventrulestepfunctionconstructStateMachineLogGroupB4555776.Properties.LogGroupName; + const suffix = logName.slice(-lengthOfDatetimeSuffix); + + // Look for the expected Prefix and the 13 digit time suffix + expect(logName.slice(0, expectedPrefix.length)).toEqual(expectedPrefix); + expect(IsWholeNumber(suffix)).not.toBe(false); +}); + +function IsWholeNumber(target: string): boolean { + const numberPattern = /[0-9]{13}/; + return target.match(numberPattern) !== null; +} diff --git a/source/patterns/@aws-solutions-constructs/core/lib/cloudwatch-log-group-helper.ts b/source/patterns/@aws-solutions-constructs/core/lib/cloudwatch-log-group-helper.ts index 3a9a73644..56abd5e9e 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/cloudwatch-log-group-helper.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/cloudwatch-log-group-helper.ts @@ -26,19 +26,19 @@ import { Construct } from 'constructs'; * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. */ export function buildLogGroup(scope: Construct, logGroupId?: string, logGroupProps?: logs.LogGroupProps): logs.LogGroup { - let _logGroupProps: logs.LogGroupProps; + let consolidatedLogGroupProps: logs.LogGroupProps; // Override user provided CW LogGroup props with the DefaultLogGroupProps - _logGroupProps = consolidateProps(DefaultLogGroupProps(), logGroupProps); + consolidatedLogGroupProps = consolidateProps(DefaultLogGroupProps(), logGroupProps); // Set the LogGroup Id - const _logGroupId = logGroupId ? logGroupId : 'CloudWatchLogGroup'; + const adjustedLogGroupId = logGroupId ? logGroupId : 'CloudWatchLogGroup'; // Create the CW Log Group - const logGroup = new logs.LogGroup(scope, _logGroupId, _logGroupProps); + const logGroup = new logs.LogGroup(scope, adjustedLogGroupId, consolidatedLogGroupProps); // If required, suppress the Cfn Nag WARNINGS - if (_logGroupProps.retention === logs.RetentionDays.INFINITE) { + if (consolidatedLogGroupProps.retention === logs.RetentionDays.INFINITE) { addCfnSuppressRules( logGroup, [ { id: 'W86', @@ -47,7 +47,7 @@ export function buildLogGroup(scope: Construct, logGroupId?: string, logGroupPro ]); } - if (!_logGroupProps.encryptionKey) { + if (!consolidatedLogGroupProps.encryptionKey) { addCfnSuppressRules( logGroup, [ { id: 'W84', diff --git a/source/patterns/@aws-solutions-constructs/core/lib/step-function-helper.ts b/source/patterns/@aws-solutions-constructs/core/lib/step-function-helper.ts index 5aba5c9cb..ea62e10a8 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/step-function-helper.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/step-function-helper.ts @@ -60,7 +60,7 @@ export function buildStateMachine(scope: Construct, stateMachineProps: sfn.State consolidatedLogGroupProps = {}; } if (!consolidatedLogGroupProps?.logGroupName) { - const logGroupPrefix = '/aws/vendedlogs/states/'; + const logGroupPrefix = '/aws/vendedlogs/states/constructs/'; const maxResourceNameLength = 255 - logGroupPrefix.length; const nameParts: string[] = [ cdk.Stack.of(scope).stackName, // Name of the stack @@ -68,7 +68,7 @@ export function buildStateMachine(scope: Construct, stateMachineProps: sfn.State 'StateMachineLog' // Literal string for log group name portion ]; - const logGroupName = logGroupPrefix + generateResourceName(nameParts, maxResourceNameLength); + const logGroupName = logGroupPrefix + generateResourceName(nameParts, maxResourceNameLength, true); consolidatedLogGroupProps = overrideProps(consolidatedLogGroupProps, { logGroupName }); } @@ -81,37 +81,40 @@ export function buildStateMachine(scope: Construct, stateMachineProps: sfn.State // Override the Cloudwatch permissions to make it more fine grained const newStateMachine = new sfn.StateMachine(scope, 'StateMachine', consolidatedStateMachineProps); - const role = newStateMachine.node.findChild('Role') as iam.Role; - const cfnDefaultPolicy = role.node.findChild('DefaultPolicy').node.defaultChild as iam.CfnPolicy; - - // Reduce the scope of actions for the existing DefaultPolicy - cfnDefaultPolicy.addPropertyOverride('PolicyDocument.Statement.0.Action', - [ - "logs:CreateLogDelivery", - 'logs:GetLogDelivery', - 'logs:UpdateLogDelivery', - 'logs:DeleteLogDelivery', - 'logs:ListLogDeliveries' - ]); - // Override Cfn Nag warning W12: IAM policy should not allow * resource - addCfnSuppressRules(cfnDefaultPolicy, [ - { - id: 'W12', - reason: `The 'LogDelivery' actions do not support resource-level authorizations` - } - ]); - - // Add a new policy with logging permissions for the given cloudwatch log group - newStateMachine.addToRolePolicy(new iam.PolicyStatement({ - actions: [ - 'logs:PutResourcePolicy', - 'logs:DescribeResourcePolicies', - 'logs:DescribeLogGroups' - ], - resources: [`arn:${cdk.Aws.PARTITION}:logs:${cdk.Aws.REGION}:${cdk.Aws.ACCOUNT_ID}:*`] - })); + // If the client did not pass a role we got the default role and will trim the privileges + if (!stateMachineProps.role) { + const role = newStateMachine.node.findChild('Role') as iam.Role; + const cfnDefaultPolicy = role.node.findChild('DefaultPolicy').node.defaultChild as iam.CfnPolicy; + + // Reduce the scope of actions for the existing DefaultPolicy + cfnDefaultPolicy.addPropertyOverride('PolicyDocument.Statement.0.Action', + [ + "logs:CreateLogDelivery", + 'logs:GetLogDelivery', + 'logs:UpdateLogDelivery', + 'logs:DeleteLogDelivery', + 'logs:ListLogDeliveries' + ]); + + // Override Cfn Nag warning W12: IAM policy should not allow * resource + addCfnSuppressRules(cfnDefaultPolicy, [ + { + id: 'W12', + reason: `The 'LogDelivery' actions do not support resource-level authorizations` + } + ]); + // Add a new policy with logging permissions for the given cloudwatch log group + newStateMachine.addToRolePolicy(new iam.PolicyStatement({ + actions: [ + 'logs:PutResourcePolicy', + 'logs:DescribeResourcePolicies', + 'logs:DescribeLogGroups' + ], + resources: [`arn:${cdk.Aws.PARTITION}:logs:${cdk.Aws.REGION}:${cdk.Aws.ACCOUNT_ID}:*`] + })); + } return { stateMachine: newStateMachine, logGroup }; } diff --git a/source/patterns/@aws-solutions-constructs/core/lib/utils.ts b/source/patterns/@aws-solutions-constructs/core/lib/utils.ts index f1a7ed046..2b13ad0ed 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/utils.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/utils.ts @@ -113,11 +113,13 @@ export function printWarning(message: string) { */ export function generateResourceName( parts: string[], - maxLength: number + maxLength: number, + randomize: boolean = false ): string { const hashLength = 12; + const randomizor: string = randomize ? (new Date()).getTime().toString() : ""; - const maxPartLength = Math.floor( (maxLength - hashLength) / parts.length); + const maxPartLength = Math.floor( (maxLength - hashLength - randomizor.length) / parts.length); const sha256 = crypto.createHash("sha256"); let finalName: string = ''; @@ -129,6 +131,7 @@ export function generateResourceName( const hash = sha256.digest("hex").slice(0, hashLength); finalName += hash; + finalName += randomizor; return finalName.toLowerCase(); } diff --git a/source/patterns/@aws-solutions-constructs/core/test/step-function-helper.test.ts b/source/patterns/@aws-solutions-constructs/core/test/step-function-helper.test.ts index 4b195bf09..9911c83c8 100644 --- a/source/patterns/@aws-solutions-constructs/core/test/step-function-helper.test.ts +++ b/source/patterns/@aws-solutions-constructs/core/test/step-function-helper.test.ts @@ -12,15 +12,14 @@ */ // Imports -import { Stack } from "aws-cdk-lib"; +import { Stack, Aws } from "aws-cdk-lib"; import * as defaults from '../'; import '@aws-cdk/assert/jest'; import * as sfn from 'aws-cdk-lib/aws-stepfunctions'; import { buildLogGroup } from '../lib/cloudwatch-log-group-helper'; +import * as iam from 'aws-cdk-lib/aws-iam'; +import { Template } from 'aws-cdk-lib/assertions'; -// -------------------------------------------------------------- -// Test deployment w/ custom properties -// -------------------------------------------------------------- test('Test deployment w/ custom properties', () => { // Stack const stack = new Stack(); @@ -33,7 +32,6 @@ test('Test deployment w/ custom properties', () => { }); // Assertion expect(buildStateMachineResponse.stateMachine).toBeDefined(); - expect(buildStateMachineResponse.stateMachine).toBeDefined(); expect(stack).toCountResources("AWS::Logs::LogGroup", 1); expect(stack).toHaveResource("AWS::StepFunctions::StateMachine", { @@ -41,9 +39,6 @@ test('Test deployment w/ custom properties', () => { }); }); -// -------------------------------------------------------------- -// Test deployment w/ logging enabled -// -------------------------------------------------------------- test('Test deployment w/ logging enabled', () => { // Stack const stack = new Stack(); @@ -83,9 +78,6 @@ test('Test deployment w/ logging enabled', () => { }); }); -// -------------------------------------------------------------- -// Check default Cloudwatch permissions -// -------------------------------------------------------------- test('Check default Cloudwatch permissions', () => { // Stack const stack = new Stack(); @@ -146,9 +138,6 @@ test('Check default Cloudwatch permissions', () => { }); }); -// -------------------------------------------------------------- -// Check CW Alarms -// -------------------------------------------------------------- test('Count State Machine CW Alarms', () => { // Stack const stack = new Stack(); @@ -163,4 +152,75 @@ test('Count State Machine CW Alarms', () => { expect(buildStateMachineResponse.stateMachine).toBeDefined(); expect(cwList.length).toEqual(3); -}); \ No newline at end of file +}); + +test('Test deployment with custom role', () => { + const descriptionText = 'Custom role for State Machine'; + + // Stack + const stack = new Stack(); + // Step function definition + const startState = new sfn.Pass(stack, 'StartState'); + + const customRole = new iam.Role(stack, 'custom-role', { + assumedBy: new iam.ServicePrincipal('states.amazonaws.com'), + description: descriptionText, + inlinePolicies: { + InvokePolicy: new iam.PolicyDocument({ + statements: [new iam.PolicyStatement({ + resources: [`arn:${Aws.PARTITION}:s3:${Aws.REGION}:${Aws.ACCOUNT_ID}:*`], + actions: ['s3:ListBucket'] + })] + }) + } + }); + + // Build state machine + const buildStateMachineResponse = defaults.buildStateMachine(stack, { + definition: startState, + role: customRole + }); + + // Assertion + expect(stack).toCountResources("AWS::IAM::Role", 1); + expect(buildStateMachineResponse.stateMachine).toBeDefined(); + + expect(stack).toHaveResource("AWS::IAM::Role", { + Description: descriptionText + }); +}); + +test('Confirm format of name', () => { + // Stack + const stack = new Stack(); + // Step function definition + const startState = new sfn.Pass(stack, 'StartState'); + // Build state machine + const buildStateMachineResponse = defaults.buildStateMachine(stack, { + stateMachineName: 'myStateMachine', + definition: startState, + }); + // Assertion + expect(buildStateMachineResponse.stateMachine).toBeDefined(); + + expect(stack).toHaveResource("AWS::StepFunctions::StateMachine", { + StateMachineName: "myStateMachine" + }); + + // Perform some fancy stuff to examine the specifics of the LogGroupName + const expectedPrefix = '/aws/vendedlogs/states/constructs/'; + const lengthOfDatetimeSuffix = 13; + + const LogGroup = Template.fromStack(stack).findResources("AWS::Logs::LogGroup"); + const logName = LogGroup.StateMachineLogGroup15B91BCB.Properties.LogGroupName; + const suffix = logName.slice(-lengthOfDatetimeSuffix); + + // Look for the expected Prefix and the 13 digit time suffix + expect(logName.slice(0, expectedPrefix.length)).toEqual(expectedPrefix); + expect(IsWholeNumber(suffix)).not.toBe(false); +}); + +function IsWholeNumber(target: string): boolean { + const numberPattern = /[0-9]{13}/; + return target.match(numberPattern) !== null; +} diff --git a/source/patterns/@aws-solutions-constructs/core/test/utils.test.ts b/source/patterns/@aws-solutions-constructs/core/test/utils.test.ts index 5ced4402d..72de0c7eb 100644 --- a/source/patterns/@aws-solutions-constructs/core/test/utils.test.ts +++ b/source/patterns/@aws-solutions-constructs/core/test/utils.test.ts @@ -20,10 +20,7 @@ import * as cdk from 'aws-cdk-lib'; const parts = [ 'firstportionislong', 'secondsection']; const nonAlphaParts = [ 'part-one', 'part-two']; -// -------------------------------------------------------------- -// Test with a truncated part -// -------------------------------------------------------------- -test('Test with a truncated part', () => { +test('Test generateResourceName with a truncated part', () => { const result = defaults.generateResourceName(parts, 38); expect(result).toContain(parts[1]); @@ -32,10 +29,7 @@ test('Test with a truncated part', () => { }); -// -------------------------------------------------------------- -// Test with no truncated parts -// -------------------------------------------------------------- -test('Test with no truncated parts', () => { +test('Test generateResourceName with no truncated parts', () => { const result = defaults.generateResourceName(parts, 100); expect(result).toContain(parts[1]); @@ -43,18 +37,33 @@ test('Test with no truncated parts', () => { expect(result.length).toEqual(parts[0].length + parts[1].length + 12); }); -// -------------------------------------------------------------- -// Test with non Aphanumeric -// -------------------------------------------------------------- -test('Test with non Aphanumeric', () => { +test('Test generateResourceName with non Aphanumeric', () => { const result = defaults.generateResourceName(nonAlphaParts, 100); expect(result).toContain('partoneparttwo'); }); -// -------------------------------------------------------------- -// Test generateIntegStackName -// -------------------------------------------------------------- +test('Test generateResourceName with randomized extension', () => { + const resultOne = defaults.generateResourceName(parts, 512, true); + const startTime = (new Date()).getTime(); + + // We need to ensure the time value appended changes between callls + let currTime = startTime; + while (currTime === startTime) { + currTime = (new Date()).getTime(); + } + + const resultTwo = defaults.generateResourceName(parts, 512, true); + + expect(resultOne).toContain(parts[1]); + expect(resultOne).toContain(parts[0]); + expect(resultTwo).toContain(parts[1]); + expect(resultTwo).toContain(parts[0]); + expect(resultOne).not.toEqual(resultTwo); + expect(resultOne.slice(0, -13)).toEqual(resultTwo.slice(0, -13)); + +}); + test('Test generateIntegStackName', () => { const result = defaults.generateIntegStackName('integ.apigateway-dynamodb-CRUD.js'); expect(result).toContain('apigateway-dynamodb-CRUD'); From d07fbf7e18442ab4170050180ff4bc723b9d444d Mon Sep 17 00:00:00 2001 From: biffgaut <78155736+biffgaut@users.noreply.github.com> Date: Fri, 17 Mar 2023 16:14:51 -0400 Subject: [PATCH 3/6] Update package.json --- source/tools/cdk-integ-tools/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/tools/cdk-integ-tools/package.json b/source/tools/cdk-integ-tools/package.json index d014a2abe..9eeb6fa34 100644 --- a/source/tools/cdk-integ-tools/package.json +++ b/source/tools/cdk-integ-tools/package.json @@ -1,7 +1,7 @@ { "name": "cdk-integ-tools", "private": true, - "version": "2.33.0", + "version": "0.0.0", "description": "Package with integration test scripts for CDK packages", "main": "index.js", "repository": { From e63c8657e58997db0cfd24b7c99ac3be3bb8779a Mon Sep 17 00:00:00 2001 From: AWS Solutions Constructs Automation Date: Sat, 18 Mar 2023 13:59:48 +0000 Subject: [PATCH 4/6] chore(release): 2.34.0 --- CHANGELOG.md | 7 +++++++ source/lerna.json | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f484c2553..c22b73506 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## [2.34.0](https://github.com/awslabs/aws-solutions-constructs/compare/v2.33.0...v2.34.0) (2023-03-18) + + +### Bug Fixes + +* **StepFunctions:** Address LogGroup behavior problems ([#922](https://github.com/awslabs/aws-solutions-constructs/issues/922)) ([84e581c](https://github.com/awslabs/aws-solutions-constructs/commit/84e581cad10f59daf827fb6e8f8101e1ec6b11f3)) + ## [2.33.0](https://github.com/awslabs/aws-solutions-constructs/compare/v2.32.0...v2.33.0) (2023-03-03) Build on CDK v2.67.0 diff --git a/source/lerna.json b/source/lerna.json index 313e5f787..b30d182a0 100644 --- a/source/lerna.json +++ b/source/lerna.json @@ -6,5 +6,5 @@ "./patterns/@aws-solutions-constructs/*" ], "rejectCycles": "true", - "version": "2.33.0" + "version": "2.34.0" } From e0385536181eaf6864fe3774756ed25b2e9a7bf6 Mon Sep 17 00:00:00 2001 From: biffgaut Date: Sat, 18 Mar 2023 10:07:43 -0400 Subject: [PATCH 5/6] chore(release-prep): Updated CHANGELOG.md and align-version.js --- CHANGELOG.md | 1 + deployment/v2/align-version.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c22b73506..8a433614f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ All notable changes to this project will be documented in this file. See [standa ## [2.34.0](https://github.com/awslabs/aws-solutions-constructs/compare/v2.33.0...v2.34.0) (2023-03-18) +Built on CDK v2.68.0 ### Bug Fixes diff --git a/deployment/v2/align-version.js b/deployment/v2/align-version.js index 017d868a9..2c30e4b4a 100755 --- a/deployment/v2/align-version.js +++ b/deployment/v2/align-version.js @@ -10,7 +10,7 @@ const findVersion = process.argv[2]; const replaceVersion = process.argv[3]; // these versions need to be sourced from a config file -const awsCdkLibVersion = '2.68.0'; +const awsCdkLibVersion = '2.69.0'; const constructsVersion = '10.0.0'; const MODULE_EXEMPTIONS = new Set([ '@aws-cdk/cloudformation-diff', From 452b2f65f0ee49dab618090960d945b5df51d6a9 Mon Sep 17 00:00:00 2001 From: biffgaut Date: Sat, 18 Mar 2023 10:12:32 -0400 Subject: [PATCH 6/6] chore(release-prep): align-version.js --- deployment/v2/align-version.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment/v2/align-version.js b/deployment/v2/align-version.js index 2c30e4b4a..017d868a9 100755 --- a/deployment/v2/align-version.js +++ b/deployment/v2/align-version.js @@ -10,7 +10,7 @@ const findVersion = process.argv[2]; const replaceVersion = process.argv[3]; // these versions need to be sourced from a config file -const awsCdkLibVersion = '2.69.0'; +const awsCdkLibVersion = '2.68.0'; const constructsVersion = '10.0.0'; const MODULE_EXEMPTIONS = new Set([ '@aws-cdk/cloudformation-diff',