diff --git a/packages/@aws-cdk/aws-ec2/lib/instance-types.ts b/packages/@aws-cdk/aws-ec2/lib/instance-types.ts index 018291783ef94..65d7f60c5836c 100644 --- a/packages/@aws-cdk/aws-ec2/lib/instance-types.ts +++ b/packages/@aws-cdk/aws-ec2/lib/instance-types.ts @@ -486,6 +486,16 @@ export enum InstanceClass { */ G5 = 'g5', + /** + * Graphics-optimized instances powered by AWS Graviton2 Processors and NVIDIA T4G Tensor Core GPUs, 5th generation + */ + GRAPHICS5_GRAVITON2 = 'g5g', + + /** + * Graphics-optimized instances powered by AWS Graviton2 Processors and NVIDIA T4G Tensor Core GPUs, 5th generation + */ + G5G = 'g5g', + /** * Parallel-processing optimized instances, 2nd generation */ @@ -546,6 +556,16 @@ export enum InstanceClass { */ M6I = 'm6i', + /** + * Standard instances based on 3rd Gen AMD EPYC processors, 6th generation. + */ + STANDARD6_AMD = 'm6a', + + /** + * Standard instances based on 3rd Gen AMD EPYC processors, 6th generation. + */ + M6A = 'm6a', + /** * Standard instances, 6th generation with Graviton2 processors and local NVME drive */ @@ -585,6 +605,16 @@ export enum InstanceClass { * Macintosh instances built on Apple Mac mini computers, 1st generation with Intel procesors */ MAC1 = 'mac1', + + /** + * Multi-stream video transcoding instances for resolutions up to 4K UHD, 1st generation + */ + VIDEO_TRANSCODING1 = 'vt1', + + /** + * Multi-stream video transcoding instances for resolutions up to 4K UHD, 1st generation + */ + VT1 = 'vt1', } /** diff --git a/packages/@aws-cdk/aws-ec2/test/instance.test.ts b/packages/@aws-cdk/aws-ec2/test/instance.test.ts index 632a1f7b7e10f..a53092b6a41d4 100644 --- a/packages/@aws-cdk/aws-ec2/test/instance.test.ts +++ b/packages/@aws-cdk/aws-ec2/test/instance.test.ts @@ -122,7 +122,7 @@ describe('instance', () => { test('instance architecture is correctly discerned for arm instances', () => { // GIVEN const sampleInstanceClasses = [ - 'a1', 't4g', 'c6g', 'c6gd', 'c6gn', 'm6g', 'm6gd', 'r6g', 'r6gd', // current Graviton-based instance classes + 'a1', 't4g', 'c6g', 'c6gd', 'c6gn', 'm6g', 'm6gd', 'r6g', 'r6gd', 'g5g', // current Graviton-based instance classes 'a13', 't11g', 'y10ng', 'z11ngd', // theoretical future Graviton-based instance classes ]; diff --git a/tools/@aws-cdk/generate-examples/lib/assemblies.ts b/tools/@aws-cdk/generate-examples/lib/assemblies.ts index 5efa530849ea2..94a1c0d1f652a 100644 --- a/tools/@aws-cdk/generate-examples/lib/assemblies.ts +++ b/tools/@aws-cdk/generate-examples/lib/assemblies.ts @@ -2,6 +2,7 @@ import * as path from 'path'; import * as spec from '@jsii/spec'; import * as fs from 'fs-extra'; import { TypeScriptSnippet } from 'jsii-rosetta'; +import { FIXTURE_NAME } from './generate-missing-examples'; /** * Replaces the file where the original assembly file *should* be found with a new assembly file. @@ -15,6 +16,18 @@ export async function replaceAssembly(assembly: spec.Assembly, directory: string }); } +export function addFixtureToRosetta(directory: string, fileName: string, fixture: string) { + const rosettaPath = path.join(directory, 'rosetta'); + if (!fs.existsSync(rosettaPath)) { + fs.mkdirSync(rosettaPath); + } + const filePath = path.join(rosettaPath, fileName); + if (fs.existsSync(filePath)) { + return; + } + fs.writeFileSync(filePath, fixture); +} + /** * Replaces the old fingerprint with '***********'. * @@ -35,6 +48,15 @@ export function insertExample(example: TypeScriptSnippet, type: spec.Type): void if (type.docs) { type.docs.example = example.visibleSource; } else { - type.docs = { example: example.visibleSource }; + type.docs = { + example: example.visibleSource, + }; + } + if (type.docs.custom) { + type.docs.custom.exampleMetadata = `fixture=${FIXTURE_NAME}`; + } else { + type.docs.custom = { + exampleMetadata: `fixture=${FIXTURE_NAME}`, + }; } } diff --git a/tools/@aws-cdk/generate-examples/lib/generate-missing-examples.ts b/tools/@aws-cdk/generate-examples/lib/generate-missing-examples.ts index d11db83e4cf79..d08a44cc8dd6d 100644 --- a/tools/@aws-cdk/generate-examples/lib/generate-missing-examples.ts +++ b/tools/@aws-cdk/generate-examples/lib/generate-missing-examples.ts @@ -4,7 +4,7 @@ import { Assembly, ClassType, InterfaceType, TypeSystem } from 'jsii-reflect'; // This import should come from @jsii/spec. Replace when that is possible. import { LanguageTablet, RosettaTranslator, SnippetLocation, SnippetParameters, TypeScriptSnippet, typeScriptSnippetFromCompleteSource } from 'jsii-rosetta'; -import { insertExample, replaceAssembly } from './assemblies'; +import { insertExample, replaceAssembly, addFixtureToRosetta } from './assemblies'; import { generateAssignmentStatement } from './generate'; const COMMENT_WARNING = [ @@ -12,6 +12,8 @@ const COMMENT_WARNING = [ '// The values are placeholders you should change.', ]; +export const FIXTURE_NAME = '_generated'; + export interface GenerateExamplesOptions { readonly cacheFromTablet?: string; readonly appendToTablet?: string; @@ -31,7 +33,7 @@ export async function generateMissingExamples(assemblyLocations: string[], optio return { assemblyLocation, assembly: await typesystem.load(assemblyLocation, { validate: false }) }; })); - const snippets = loadedAssemblies.flatMap(({ assembly }) => { + const snippets = loadedAssemblies.flatMap(({ assembly, assemblyLocation }) => { // Classes and structs const documentableTypes: Array = []; for (const m of [assembly, ...assembly.allSubmodules]) { @@ -39,6 +41,14 @@ export async function generateMissingExamples(assemblyLocations: string[], optio documentableTypes.push(...m.interfaces.filter(c => !c.docs.example && c.datatype)); } + // add fixture to assembly's rosetta folder if it doesn't exist yet + const fixture = generateFixture(assembly); + addFixtureToRosetta( + assemblyLocation, + `${FIXTURE_NAME}.ts-fixture`, + fixture, + ); + console.log(`${assembly.name}: ${documentableTypes.length} classes to document`); if (documentableTypes.length === 0) { return []; } @@ -73,6 +83,7 @@ export async function generateMissingExamples(assemblyLocations: string[], optio true, { [SnippetParameters.$COMPILATION_DIRECTORY]: options.directory ?? process.cwd(), + [SnippetParameters.$PROJECT_DIRECTORY]: assemblyLocation, }); insertExample(tsSnippet, classType.spec); @@ -153,4 +164,15 @@ function correctConstructImport(assembly: Assembly) { } return 'import { Construct } from "constructs";'; -} \ No newline at end of file +} + +function generateFixture(assembly: Assembly): string { + return [ + correctConstructImport(assembly), + 'class MyConstruct extends Construct {', + 'constructor(scope: Construct, id: string) {', + 'super(scope, id);', + '/// here', + '} }', + ].join('\n').trimLeft(); +}