Skip to content

Commit

Permalink
Merge branch 'main' into pipes-targets-cwl
Browse files Browse the repository at this point in the history
  • Loading branch information
msambol authored Jun 27, 2024
2 parents 47642c0 + 0247013 commit 5f762a3
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 6 deletions.
20 changes: 19 additions & 1 deletion packages/aws-cdk-lib/aws-bedrock/lib/foundation-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand All @@ -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
Expand Down Expand Up @@ -138,17 +147,23 @@ 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');

/** 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');

Expand Down Expand Up @@ -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
Expand Down
30 changes: 29 additions & 1 deletion packages/aws-cdk-lib/aws-ssm/README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
});
```
12 changes: 8 additions & 4 deletions packages/aws-cdk-lib/aws-ssm/lib/parameter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 5f762a3

Please sign in to comment.