diff --git a/packages/aws-cdk-lib/aws-bedrock/lib/foundation-model.ts b/packages/aws-cdk-lib/aws-bedrock/lib/foundation-model.ts index 8180802c30ca1..bfabc3dfea97f 100644 --- a/packages/aws-cdk-lib/aws-bedrock/lib/foundation-model.ts +++ b/packages/aws-cdk-lib/aws-bedrock/lib/foundation-model.ts @@ -41,6 +41,9 @@ export class FoundationModelIdentifier { /** Base model "amazon.titan-embed-text-v2:0". */ public static readonly AMAZON_TITAN_EMBED_TEXT_V2_0 = new FoundationModelIdentifier('amazon.titan-embed-text-v2:0'); + /** Base model "amazon.titan-embed-text-v2:0:8k". */ + public static readonly AMAZON_TITAN_EMBED_TEXT_V2_0_8K = new FoundationModelIdentifier('amazon.titan-embed-text-v2:0:8k'); + /** Base model "amazon.titan-image-generator-v1". */ public static readonly AMAZON_TITAN_IMAGE_GENERATOR_G1_V1 = new FoundationModelIdentifier('amazon.titan-image-generator-v1'); @@ -65,12 +68,18 @@ export class FoundationModelIdentifier { /** Base model "ai21.j2-ultra-v1". */ public static readonly AI21_LABS_JURASSIC_2_ULTRA_V1 = new FoundationModelIdentifier('ai21.j2-ultra-v1'); + /** Base model "ai21.j2-ultra-v1:0:8k". */ + public static readonly AI21_LABS_JURASSIC_2_ULTRA_V1_0_8K = new FoundationModelIdentifier('ai21.j2-ultra-v1:0:8k'); + /** Base model "ai21.j2-grande-instruct". */ public static readonly AI21_J2_GRANDE_INSTRUCT = new FoundationModelIdentifier('ai21.j2-grande-instruct'); /** Base model "ai21.j2-jumbo-instruct". */ public static readonly AI21_J2_JUMBO_INSTRUCT = new FoundationModelIdentifier('ai21.j2-jumbo-instruct'); + /** Base model "ai21.jamba-instruct-v1:0". */ + public static readonly AI21_J2_JAMBA_INSTRUCT_V1_0 = new FoundationModelIdentifier('ai21.jamba-instruct-v1:0'); + /** * Base model "anthropic.claude-v1". * @deprecated use latest version of the model @@ -138,7 +147,7 @@ export class FoundationModelIdentifier { public static readonly COHERE_COMMAND_LIGHT_TEXT_V14_7_4K = new FoundationModelIdentifier('cohere.command-light-text-v14:7:4k'); /** Base model "cohere.command-r-v1:0". */ - public static readonly COHERE_COMMAND_R_V1 = new FoundationModelIdentifier('ccohere.command-r-v1:0'); + public static readonly COHERE_COMMAND_R_V1 = new FoundationModelIdentifier('cohere.command-r-v1:0'); /** Base model "cohere.command-r-v1:0". */ public static readonly COHERE_COMMAND_R_PLUS_V1 = new FoundationModelIdentifier('cohere.command-r-plus-v1:0'); @@ -146,9 +155,15 @@ export class FoundationModelIdentifier { /** Base model "cohere.embed-english-v3". */ public static readonly COHERE_EMBED_ENGLISH_V3 = new FoundationModelIdentifier('cohere.embed-english-v3'); + /** Base model "cohere.embed-english-v3:0:512". */ + public static readonly COHERE_EMBED_ENGLISH_V3_0_512 = new FoundationModelIdentifier('cohere.embed-english-v3:0:512'); + /** Base model "cohere.embed-multilingual-v3". */ public static readonly COHERE_EMBED_MULTILINGUAL_V3 = new FoundationModelIdentifier('cohere.embed-multilingual-v3'); + /** Base model "cohere.embed-multilingual-v3:0:512". */ + public static readonly COHERE_EMBED_MULTILINGUAL_V3_0_512 = new FoundationModelIdentifier('cohere.embed-multilingual-v3:0:512'); + /** Base model "meta.llama2-13b-v1". */ public static readonly META_LLAMA_2_13B_V1 = new FoundationModelIdentifier('meta.llama2-13b-v1'); @@ -188,6 +203,9 @@ export class FoundationModelIdentifier { /** Base model "mistral.mistral-large-2402-v1:0". */ public static readonly MISTRAL_LARGE_V0_1 = new FoundationModelIdentifier('mistral.mistral-large-2402-v1:0'); + /** Base model "mistral.mistral-small-2402-v1:0". */ + public static readonly MISTRAL_SMALL_V0_1 = new FoundationModelIdentifier('mistral.mistral-small-2402-v1:0'); + /** * Base model "stability.stable-diffusion-xl". * @deprecated use latest version of the model diff --git a/packages/aws-cdk-lib/aws-ssm/README.md b/packages/aws-cdk-lib/aws-ssm/README.md index e70e424f0573b..0f678c449c756 100644 --- a/packages/aws-cdk-lib/aws-ssm/README.md +++ b/packages/aws-cdk-lib/aws-ssm/README.md @@ -1,6 +1,5 @@ # AWS Systems Manager Construct Library - This module is part of the [AWS Cloud Development Kit](https://github.com/aws/aws-cdk) project. ## Using existing SSM Parameters in your CDK app @@ -143,3 +142,32 @@ When specifying an `allowedPattern`, the values provided as string literals are validated against the pattern and an exception is raised if a value provided does not comply. +## Using Tokens in parameter name + +When using [CDK Tokens](https://docs.aws.amazon.com/cdk/v2/guide/tokens.html) in parameter name, +you need to explicitly set the `simpleName` property. Setting `simpleName` to an incorrect boolean +value may result in unexpected behaviours, such as having duplicate '/' in the parameter ARN +or missing a '/' in the parameter ARN. + +`simpleName` is used to indicates whether the parameter name is a simple name. A parameter name +without any '/' is considered a simple name, thus you should set `simpleName` to `true`. +If the parameter name includes '/', set `simpleName` to `false`. + +```ts +import * as lambda from 'aws-cdk-lib/aws-lambda'; + +const simpleParameter = new ssm.StringParameter(this, 'StringParameter', { + // the parameter name doesn't contain any '/' + parameterName: 'parameter', + stringValue: 'SOME_VALUE', + simpleName: true, // set `simpleName` to true +}); + +declare const func: lambda.IFunction; +const nonSimpleParameter = new ssm.StringParameter(this, 'StringParameter', { + // the parameter name contains '/' + parameterName: `/${func.functionName}/my/app/param`, + stringValue: 'SOME_VALUE', + simpleName: false, // set `simpleName` to false +}); +``` diff --git a/packages/aws-cdk-lib/aws-ssm/lib/parameter.ts b/packages/aws-cdk-lib/aws-ssm/lib/parameter.ts index 1972b605665fc..f4087515bc724 100644 --- a/packages/aws-cdk-lib/aws-ssm/lib/parameter.ts +++ b/packages/aws-cdk-lib/aws-ssm/lib/parameter.ts @@ -99,8 +99,10 @@ export interface ParameterOptions { readonly parameterName?: string; /** - * Indicates if the parameter name is a simple name (i.e. does not include "/" - * separators). + * Indicates whether the parameter name is a simple name. A parameter name + * without any "/" is considered a simple name. If the parameter name includes + * "/", setting simpleName to true might cause unintended issues such + * as duplicate "/" in the resulting ARN. * * This is required only if `parameterName` is a token, which means we * are unable to detect if the name is simple or "path-like" for the purpose @@ -337,8 +339,10 @@ export interface CommonStringParameterAttributes { readonly parameterName: string; /** - * Indicates if the parameter name is a simple name (i.e. does not include "/" - * separators). + * Indicates whether the parameter name is a simple name. A parameter name + * without any "/" is considered a simple name. If the parameter name includes + * "/", setting simpleName to true might cause unintended issues such + * as duplicate "/" in the resulting ARN. * * This is required only if `parameterName` is a token, which means we * are unable to detect if the name is simple or "path-like" for the purpose