diff --git a/packages/@aws-cdk/aws-rum-alpha/.eslintrc.js b/packages/@aws-cdk/aws-rum-alpha/.eslintrc.js new file mode 100644 index 0000000000000..c045813e19b83 --- /dev/null +++ b/packages/@aws-cdk/aws-rum-alpha/.eslintrc.js @@ -0,0 +1,3 @@ +const baseConfig = require('@aws-cdk/cdk-build-tools/config/eslintrc'); +baseConfig.parserOptions.project = __dirname + '/tsconfig.json'; +module.exports = baseConfig; \ No newline at end of file diff --git a/packages/@aws-cdk/aws-rum-alpha/.gitignore b/packages/@aws-cdk/aws-rum-alpha/.gitignore new file mode 100644 index 0000000000000..9a7f7f5e62122 --- /dev/null +++ b/packages/@aws-cdk/aws-rum-alpha/.gitignore @@ -0,0 +1,28 @@ +*.js +*.js.map +*.d.ts +tsconfig.json +node_modules +*.generated.ts +dist +.jsii + +.LAST_BUILD +.nyc_output +coverage +.nycrc +.LAST_PACKAGE +*.snk +nyc.config.js +!.eslintrc.js +!jest.config.js + +# Include .jsiirc.json if it exists +!.jsiirc.json + +# Include .npmignore if it exists +!.npmignore + +# Exclude typescript source for javascript packages +exclude-typescript +junit.xml \ No newline at end of file diff --git a/packages/@aws-cdk/aws-rum-alpha/.npmignore b/packages/@aws-cdk/aws-rum-alpha/.npmignore new file mode 100644 index 0000000000000..120152e2da43f --- /dev/null +++ b/packages/@aws-cdk/aws-rum-alpha/.npmignore @@ -0,0 +1,109 @@ +# Don't include original .ts files when publishing +*.ts +!*.d.ts + +# Include .jsiirc.json if it exists +!.jsiirc.json + +# Include .npmignore if it exists +!.npmignore + +# Exclude typescript source for javascript packages +exclude-typescript + +# The basics +*.orig +.*.swp +.*.swo +*~ +*.tmp +*.bak + +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Coverage directory used by tools like istanbul +coverage + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# Typescript v1 declaration files +typings/ + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env + +# parcel-bundler cache (https://parceljs.org/) +.cache +.parcel-cache + +# next.js build output +.next + +# nuxt.js build output +.nuxt + +# vuepress build output +.vuepress/dist + +# Serverless directories +.serverless + +# CDK Context & Staging files +.cdk.staging/ +cdk.out/ +**/cdk.out +dist +.LAST_PACKAGE +*.tsbuildinfo +test/ +tsconfig.json +!.jsii +.LAST_BUILD +*.snk +junit.xml +!*.js +!*.lit.ts +.eslintrc.js \ No newline at end of file diff --git a/packages/@aws-cdk/aws-rum-alpha/LICENSE b/packages/@aws-cdk/aws-rum-alpha/LICENSE new file mode 100644 index 0000000000000..5ccf0c6780bab --- /dev/null +++ b/packages/@aws-cdk/aws-rum-alpha/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-2025 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/packages/@aws-cdk/aws-rum-alpha/NOTICE b/packages/@aws-cdk/aws-rum-alpha/NOTICE new file mode 100644 index 0000000000000..382da4e136d29 --- /dev/null +++ b/packages/@aws-cdk/aws-rum-alpha/NOTICE @@ -0,0 +1,2 @@ +AWS Cloud Development Kit (AWS CDK) +Copyright 2018-2025 Amazon.com, Inc. or its affiliates. All Rights Reserved. \ No newline at end of file diff --git a/packages/@aws-cdk/aws-rum-alpha/README.md b/packages/@aws-cdk/aws-rum-alpha/README.md new file mode 100644 index 0000000000000..323d2a3405ef5 --- /dev/null +++ b/packages/@aws-cdk/aws-rum-alpha/README.md @@ -0,0 +1,60 @@ +# Amazon CloudWatch RUM Construct Library + + +--- + +![cdk-constructs: Experimental](https://img.shields.io/badge/cdk--constructs-experimental-important.svg?style=for-the-badge) + +> The APIs of higher level constructs in this module are experimental and under active development. +> They are subject to non-backward compatible changes or removal in any future version. These are +> not subject to the [Semantic Versioning](https://semver.org/) model and breaking changes will be +> announced in the release notes. This means that while you may use them, you may need to update +> your source code when upgrading to a newer version of this package. + +--- + + + +Amazon CloudWatch RUM is a real-user monitoring service that collects client-side data about your web application performance from actual user sessions in real time. The data that RUM collects includes page load times, client-side errors, and user behavior. + +## App Monitor + +Create a RUM app monitor to start collecting real user monitoring data: + +```ts +new rum.AppMonitor(this, 'MyAppMonitor', { + appMonitorName: 'my-web-app', + domain: 'example.com', +}); +``` + +Configure the app monitor with additional options: + +```ts +new rum.AppMonitor(this, 'MyAppMonitor', { + appMonitorName: 'my-web-app', + domain: 'example.com', + cwLogEnabled: true, + appMonitorConfiguration: { + allowCookies: true, + enableXRay: true, + sessionSampleRate: 0.5, + }, + customEvents: { enabled: true }, +}); +``` + +## CloudWatch Logs Integration + +When CloudWatch Logs is enabled, you can access the log group for further processing: + +```ts +const appMonitor = new rum.AppMonitor(this, 'MyAppMonitor', { + appMonitorName: 'my-web-app', + domain: 'example.com', + cwLogEnabled: true, +}); + +// Access the log group +const logGroup = appMonitor.logGroup; +``` diff --git a/packages/@aws-cdk/aws-rum-alpha/jest.config.js b/packages/@aws-cdk/aws-rum-alpha/jest.config.js new file mode 100644 index 0000000000000..9a7e1a9cb0b61 --- /dev/null +++ b/packages/@aws-cdk/aws-rum-alpha/jest.config.js @@ -0,0 +1,2 @@ +const baseConfig = require('@aws-cdk/cdk-build-tools/config/jest.config'); +module.exports = baseConfig; \ No newline at end of file diff --git a/packages/@aws-cdk/aws-rum-alpha/lib/app-monitor.ts b/packages/@aws-cdk/aws-rum-alpha/lib/app-monitor.ts new file mode 100644 index 0000000000000..ecd5e3868913f --- /dev/null +++ b/packages/@aws-cdk/aws-rum-alpha/lib/app-monitor.ts @@ -0,0 +1,322 @@ +import { IResource, Resource, Fn } from 'aws-cdk-lib'; +import * as logs from 'aws-cdk-lib/aws-logs'; +import * as rum from 'aws-cdk-lib/aws-rum'; +import { ValidationError } from 'aws-cdk-lib/core/lib/errors'; +import { Construct } from 'constructs'; + +/** + * Represents a RUM App Monitor + */ +export interface IAppMonitor extends IResource { + /** + * The ID of the app monitor + * @attribute + */ + readonly appMonitorId: string; + + /** + * The name of the app monitor + * @attribute + */ + readonly appMonitorName: string; + + /** + * The CloudWatch log group for this RUM app monitor. + * + * Only available when `cwLogEnabled` is set to `true`. + * Returns `undefined` when `cwLogEnabled` is `false`. + */ + readonly logGroup?: logs.ILogGroup; +} + +/** + * Custom events configuration for RUM App Monitor + */ +export interface CustomEventsConfig { + /** + * Whether custom events are enabled + * + * @default false + */ + readonly enabled?: boolean; +} + +/** + * JavaScript source maps configuration + */ +export interface JavaScriptSourceMapsConfig { + /** + * Whether JavaScript source maps are enabled + */ + readonly enabled: boolean; + + /** + * The S3 URI of the bucket or folder that stores the source map files + * Required if enabled is true + * + * @default - No S3 URI provided + */ + readonly s3Uri?: string; +} + +/** + * Deobfuscation configuration for RUM App Monitor + */ +export interface DeobfuscationConfig { + /** + * JavaScript source maps configuration + * + * @default - No JavaScript source maps configuration + */ + readonly javaScriptSourceMaps?: JavaScriptSourceMapsConfig; +} + +/** + * App Monitor configuration for RUM + */ +export interface AppMonitorConfiguration { + /** + * Whether to allow cookies for tracking user sessions + * + * @default false + */ + readonly allowCookies?: boolean; + + /** + * Whether to enable X-Ray tracing + * + * @default false + */ + readonly enableXRay?: boolean; + + /** + * Portion of user sessions to sample for data collection + * Range: 0 to 1 inclusive + * + * @default 0.1 + */ + readonly sessionSampleRate?: number; +} + +/** + * Properties for defining a RUM App Monitor + */ +export interface AppMonitorProps { + /** + * A name for the app monitor. + * This parameter is required. + */ + readonly appMonitorName: string; + + /** + * The top-level internet domain name for which your application has administrative authority. + * Either this parameter or domainList is required. + */ + readonly domain: string; + + /** + * Data collected by RUM is kept by RUM for 30 days and then deleted. + * This parameter specifies whether RUM sends a copy of this telemetry data + * to Amazon CloudWatch Logs in your account. + * + * @default false + */ + readonly cwLogEnabled?: boolean; + + /** + * Configuration data for the app monitor. + * + * @default - No configuration + */ + readonly appMonitorConfiguration?: AppMonitorConfiguration; + + /** + * Custom events configuration for the app monitor. + * + * @default - Custom events are disabled + */ + readonly customEvents?: CustomEventsConfig; + + /** + * Deobfuscation configuration for stack trace processing. + * + * @default - No deobfuscation configuration + */ + readonly deobfuscationConfiguration?: DeobfuscationConfig; +} + +/** + * Attributes for importing an existing RUM App Monitor + */ +export interface AppMonitorAttributes { + /** + * The ID of the app monitor + */ + readonly appMonitorId: string; + + /** + * The name of the app monitor + */ + readonly appMonitorName: string; + + /** + * Whether CloudWatch logs are enabled for this app monitor + * + * @default false + */ + readonly cwLogEnabled?: boolean; +} + +/** + * A RUM App Monitor + * + * @resource AWS::RUM::AppMonitor + */ +export class AppMonitor extends Resource implements IAppMonitor { + /** + * Import an existing RUM App Monitor + */ + public static fromAppMonitorAttributes(scope: Construct, id: string, attrs: AppMonitorAttributes): IAppMonitor { + class Import extends Resource implements IAppMonitor { + public readonly appMonitorId = attrs.appMonitorId; + public readonly appMonitorName = attrs.appMonitorName; + private readonly cwLogEnabled = attrs.cwLogEnabled ?? false; + + private _logGroup?: logs.ILogGroup; + + public get logGroup(): logs.ILogGroup | undefined { + if (!this.cwLogEnabled) { + return undefined; + } + + if (!this._logGroup) { + const logGroupName = Fn.sub('RUMService_${Name}${Id}', { + Name: this.appMonitorName, + Id: Fn.select(0, Fn.split('-', this.appMonitorId)), + }); + + this._logGroup = logs.LogGroup.fromLogGroupName( + this, + 'LogGroup', + logGroupName, + ); + } + + return this._logGroup; + } + } + + return new Import(scope, id); + } + + /** + * The ID of the app monitor + * @attribute + */ + public readonly appMonitorId: string; + + /** + * The name of the app monitor + * @attribute + */ + public readonly appMonitorName: string; + + /** + * The underlying CfnAppMonitor resource + */ + private readonly appMonitor: rum.CfnAppMonitor; + + /** + * Cached log group instance for lazy evaluation + */ + private _logGroup?: logs.ILogGroup; + + constructor(scope: Construct, id: string, props: AppMonitorProps) { + super(scope, id); + + this.appMonitor = new rum.CfnAppMonitor(this, 'Resource', { + name: props.appMonitorName, + domain: props.domain, + cwLogEnabled: props.cwLogEnabled, + appMonitorConfiguration: props.appMonitorConfiguration ? + this.renderAppMonitorConfiguration(props.appMonitorConfiguration) : undefined, + customEvents: props.customEvents ? this.renderCustomEvents(props.customEvents) : undefined, + deobfuscationConfiguration: props.deobfuscationConfiguration ? + this.renderDeobfuscationConfiguration(props.deobfuscationConfiguration) : undefined, + }); + + this.appMonitorId = this.appMonitor.attrId; + this.appMonitorName = props.appMonitorName ?? this.appMonitor.name!; + } + + /** + * Convert L2 AppMonitorConfiguration to L1 property + */ + private renderAppMonitorConfiguration(config: AppMonitorConfiguration): rum.CfnAppMonitor.AppMonitorConfigurationProperty { + return { + allowCookies: config.allowCookies, + enableXRay: config.enableXRay, + sessionSampleRate: config.sessionSampleRate, + }; + } + + /** + * Convert L2 CustomEventsConfig to L1 property + */ + private renderCustomEvents(config: CustomEventsConfig): rum.CfnAppMonitor.CustomEventsProperty { + return { + status: config.enabled === true ? 'ENABLED' : 'DISABLED', + }; + } + + /** + * Convert L2 DeobfuscationConfig to L1 property + */ + private renderDeobfuscationConfiguration(config: DeobfuscationConfig): rum.CfnAppMonitor.DeobfuscationConfigurationProperty { + return { + javaScriptSourceMaps: config.javaScriptSourceMaps ? this.renderJavaScriptSourceMaps(config.javaScriptSourceMaps) : undefined, + }; + } + + /** + * Convert L2 JavaScriptSourceMapsConfig to L1 property + */ + private renderJavaScriptSourceMaps(config: JavaScriptSourceMapsConfig): rum.CfnAppMonitor.JavaScriptSourceMapsProperty { + if (config.enabled && !config.s3Uri) { + throw new ValidationError('s3Uri is required when JavaScript source maps are enabled', this); + } + + return { + status: config.enabled ? 'ENABLED' : 'DISABLED', + ...(config.s3Uri && { s3Uri: config.s3Uri }), + }; + } + + /** + * The CloudWatch log group for this RUM app monitor. + * + * Only available when `cwLogEnabled` is set to `true`. + * Returns `undefined` when `cwLogEnabled` is `false`. + */ + public get logGroup(): logs.ILogGroup | undefined { + if (!this.appMonitor.cwLogEnabled) { + return undefined; + } + + // Cache the log group instance (lazy evaluation) + if (!this._logGroup) { + const logGroupName = Fn.sub('RUMService_${Name}${Id}', { + Name: this.appMonitorName, + Id: Fn.select(0, Fn.split('-', this.appMonitorId)), + }); + + this._logGroup = logs.LogGroup.fromLogGroupName( + this, + 'LogGroup', + logGroupName, + ); + } + + return this._logGroup; + } +} diff --git a/packages/@aws-cdk/aws-rum-alpha/lib/index.ts b/packages/@aws-cdk/aws-rum-alpha/lib/index.ts new file mode 100644 index 0000000000000..2dd87ac760358 --- /dev/null +++ b/packages/@aws-cdk/aws-rum-alpha/lib/index.ts @@ -0,0 +1 @@ +export * from './app-monitor'; diff --git a/packages/@aws-cdk/aws-rum-alpha/package.json b/packages/@aws-cdk/aws-rum-alpha/package.json new file mode 100644 index 0000000000000..73b60bdad6191 --- /dev/null +++ b/packages/@aws-cdk/aws-rum-alpha/package.json @@ -0,0 +1,111 @@ +{ + "name": "@aws-cdk/aws-rum-alpha", + "version": "0.0.0", + "private": false, + "description": "The CDK Construct Library for AWS::RUM", + "main": "lib/index.js", + "types": "lib/index.d.ts", + "jsii": { + "outdir": "dist", + "targets": { + "dotnet": { + "namespace": "Amazon.CDK.AWS.RUM.Alpha", + "packageId": "Amazon.CDK.AWS.RUM.Alpha", + "iconUrl": "https://raw.githubusercontent.com/aws/aws-cdk/main/logo/default-256-dark.png" + }, + "java": { + "package": "software.amazon.awscdk.services.rum.alpha", + "maven": { + "groupId": "software.amazon.awscdk", + "artifactId": "rum-alpha" + } + }, + "python": { + "distName": "aws-cdk.aws-rum-alpha", + "module": "aws_cdk.aws_rum_alpha", + "classifiers": [ + "Framework :: AWS CDK", + "Framework :: AWS CDK :: 2" + ] + }, + "go": { + "moduleName": "github.com/aws/aws-cdk-go", + "packageName": "awscdkrumalpha" + } + }, + "projectReferences": true, + "metadata": { + "jsii": { + "rosetta": { + "strict": true + } + } + } + }, + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-cdk.git", + "directory": "packages/@aws-cdk/aws-rum-alpha" + }, + "homepage": "https://github.com/aws/aws-cdk", + "scripts": { + "build": "cdk-build", + "integ": "integ-runner --unstable=toolkit-lib-engine --language javascript", + "lint": "cdk-lint", + "package": "cdk-package", + "awslint": "cdk-awslint", + "pkglint": "pkglint -f", + "test": "cdk-test", + "watch": "cdk-watch", + "build+test": "yarn build && yarn test", + "build+test+package": "yarn build+test && yarn package", + "compat": "cdk-compat", + "rosetta:extract": "yarn --silent jsii-rosetta extract", + "build+extract": "yarn build && yarn rosetta:extract", + "build+test+extract": "yarn build+test && yarn rosetta:extract" + }, + "keywords": [ + "aws", + "cdk", + "constructs", + "AWS::RUM", + "aws-rum" + ], + "author": { + "name": "Amazon Web Services", + "url": "https://aws.amazon.com", + "organization": true + }, + "license": "Apache-2.0", + "devDependencies": { + "@aws-cdk/cdk-build-tools": "0.0.0", + "@aws-cdk/integ-runner": "^2.190.0", + "@aws-cdk/pkglint": "0.0.0", + "@types/jest": "^29.5.14", + "aws-cdk-lib": "0.0.0", + "@aws-cdk/integ-tests-alpha": "0.0.0", + "constructs": "^10.0.0" + }, + "dependencies": {}, + "peerDependencies": { + "aws-cdk-lib": "^0.0.0", + "constructs": "^10.0.0" + }, + "engines": { + "node": ">= 18.0.0" + }, + "stability": "experimental", + "maturity": "experimental", + "awscdkio": { + "announce": false + }, + "publishConfig": { + "tag": "latest" + }, + "pkglint": { + "exclude": [ + "naming/package-matches-directory", + "assert/assert-dependency" + ] + } +} diff --git a/packages/@aws-cdk/aws-rum-alpha/rosetta/default.ts-fixture b/packages/@aws-cdk/aws-rum-alpha/rosetta/default.ts-fixture new file mode 100644 index 0000000000000..1feeeaa1bd9e7 --- /dev/null +++ b/packages/@aws-cdk/aws-rum-alpha/rosetta/default.ts-fixture @@ -0,0 +1,11 @@ +// Fixture with packages imported, but nothing else +import { Stack } from 'aws-cdk-lib'; +import { Construct } from 'constructs'; +import * as rum from '@aws-cdk/aws-rum-alpha'; + +class Fixture extends Stack { + constructor(scope: Construct, id: string) { + super(scope, id); + /// here + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-rum-alpha/test/app-monitor.test.ts b/packages/@aws-cdk/aws-rum-alpha/test/app-monitor.test.ts new file mode 100644 index 0000000000000..c68525183e0fa --- /dev/null +++ b/packages/@aws-cdk/aws-rum-alpha/test/app-monitor.test.ts @@ -0,0 +1,259 @@ +import { Stack } from 'aws-cdk-lib'; +import { Template } from 'aws-cdk-lib/assertions'; +import * as lambda from 'aws-cdk-lib/aws-lambda'; +import * as logs from 'aws-cdk-lib/aws-logs'; +import { LambdaDestination } from 'aws-cdk-lib/aws-logs-destinations'; +import { AppMonitor } from '../lib'; + +describe('AWS RUM Alpha', () => { + let stack: Stack; + + beforeEach(() => { + stack = new Stack(); + }); + + describe('AppMonitor L2 Construct', () => { + describe('basic functionality', () => { + test('creates app monitor with minimal configuration', () => { + // WHEN + new AppMonitor(stack, 'TestAppMonitor', { + appMonitorName: 'test-app', + domain: 'example.com', + }); + + // THEN + Template.fromStack(stack).hasResourceProperties('AWS::RUM::AppMonitor', { + Name: 'test-app', + Domain: 'example.com', + }); + }); + + test('creates app monitor with CloudWatch logs enabled', () => { + // WHEN + new AppMonitor(stack, 'TestAppMonitor', { + appMonitorName: 'test-app', + domain: 'example.com', + cwLogEnabled: true, + }); + + // THEN + Template.fromStack(stack).hasResourceProperties('AWS::RUM::AppMonitor', { + Name: 'test-app', + Domain: 'example.com', + CwLogEnabled: true, + }); + }); + + test('exposes app monitor attributes', () => { + // WHEN + const appMonitor = new AppMonitor(stack, 'TestAppMonitor', { + appMonitorName: 'test-app', + domain: 'example.com', + }); + + // THEN + expect(appMonitor.appMonitorName).toBe('test-app'); + expect(appMonitor.appMonitorId).toBeDefined(); + }); + + test('creates app monitor with L2 configuration properties', () => { + // WHEN + new AppMonitor(stack, 'TestAppMonitor', { + appMonitorName: 'test-app', + domain: 'example.com', + appMonitorConfiguration: { + allowCookies: true, + enableXRay: true, + sessionSampleRate: 0.5, + }, + customEvents: { + enabled: true, + }, + deobfuscationConfiguration: { + javaScriptSourceMaps: { + enabled: true, + s3Uri: 's3://my-bucket/source-maps/', + }, + }, + }); + + // THEN + Template.fromStack(stack).hasResourceProperties('AWS::RUM::AppMonitor', { + Name: 'test-app', + Domain: 'example.com', + AppMonitorConfiguration: { + AllowCookies: true, + EnableXRay: true, + SessionSampleRate: 0.5, + }, + CustomEvents: { + Status: 'ENABLED', + }, + DeobfuscationConfiguration: { + JavaScriptSourceMaps: { + Status: 'ENABLED', + S3Uri: 's3://my-bucket/source-maps/', + }, + }, + }); + }); + + test('throws error when JavaScript source maps enabled without s3Uri', () => { + // WHEN/THEN + expect(() => { + new AppMonitor(stack, 'TestAppMonitor', { + appMonitorName: 'test-app', + domain: 'example.com', + deobfuscationConfiguration: { + javaScriptSourceMaps: { + enabled: true, + // s3Uri is missing + }, + }, + }); + }).toThrow('s3Uri is required when JavaScript source maps are enabled'); + }); + }); + + describe('logGroup property', () => { + test('returns log group when cwLogEnabled is true', () => { + // GIVEN + const appMonitor = new AppMonitor(stack, 'TestAppMonitor', { + appMonitorName: 'test-app', + domain: 'example.com', + cwLogEnabled: true, + }); + + // WHEN + const logGroup = appMonitor.logGroup; + + // THEN + expect(logGroup).toBeDefined(); + expect(logGroup!.logGroupName).toBeDefined(); + }); + + test('returns undefined when cwLogEnabled is false', () => { + // GIVEN + const appMonitor = new AppMonitor(stack, 'TestAppMonitor', { + appMonitorName: 'test-app', + domain: 'example.com', + cwLogEnabled: false, + }); + + // WHEN + const logGroup = appMonitor.logGroup; + + // THEN + expect(logGroup).toBeUndefined(); + }); + + test('returns undefined when cwLogEnabled is not set (defaults to false)', () => { + // GIVEN + const appMonitor = new AppMonitor(stack, 'TestAppMonitor', { + appMonitorName: 'test-app', + domain: 'example.com', + }); + + // WHEN + const logGroup = appMonitor.logGroup; + + // THEN + expect(logGroup).toBeUndefined(); + }); + + test('caches log group instance (lazy evaluation)', () => { + // GIVEN + const appMonitor = new AppMonitor(stack, 'TestAppMonitor', { + appMonitorName: 'test-app', + domain: 'example.com', + cwLogEnabled: true, + }); + + // WHEN + const logGroup1 = appMonitor.logGroup; + const logGroup2 = appMonitor.logGroup; + + // THEN + expect(logGroup1).toBe(logGroup2); // Same instance + }); + + test('works with Lambda subscription filter', () => { + // GIVEN + const appMonitor = new AppMonitor(stack, 'TestAppMonitor', { + appMonitorName: 'test-app', + domain: 'example.com', + cwLogEnabled: true, + }); + + const fn = new lambda.Function(stack, 'TestFunction', { + runtime: lambda.Runtime.NODEJS_LATEST, + handler: 'index.handler', + code: lambda.Code.fromInline('exports.handler = async () => {};'), + }); + + // WHEN + new logs.SubscriptionFilter(stack, 'TestSubscription', { + logGroup: appMonitor.logGroup!, + destination: new LambdaDestination(fn), + filterPattern: logs.FilterPattern.allEvents(), + }); + + // THEN - Just verify the subscription filter was created with the correct log group pattern + const template = Template.fromStack(stack); + template.resourceCountIs('AWS::Logs::SubscriptionFilter', 1); + + // Verify the log group name follows the expected pattern + const subscriptionFilters = template.findResources('AWS::Logs::SubscriptionFilter'); + const subscriptionFilter = Object.values(subscriptionFilters)[0]; + expect(subscriptionFilter.Properties.LogGroupName['Fn::Sub'][0]).toBe('RUMService_${Name}${Id}'); + expect(subscriptionFilter.Properties.LogGroupName['Fn::Sub'][1].Name).toBe('test-app'); + }); + }); + + describe('fromAppMonitorAttributes', () => { + test('imports existing app monitor', () => { + // WHEN + const imported = AppMonitor.fromAppMonitorAttributes(stack, 'ImportedAppMonitor', { + appMonitorId: 'existing-id', + appMonitorName: 'existing-app', + cwLogEnabled: true, + }); + + // THEN + expect(imported.appMonitorId).toBe('existing-id'); + expect(imported.appMonitorName).toBe('existing-app'); + }); + + test('imported app monitor logGroup works when cwLogEnabled is true', () => { + // GIVEN + const imported = AppMonitor.fromAppMonitorAttributes(stack, 'ImportedAppMonitor', { + appMonitorId: 'existing-id', + appMonitorName: 'existing-app', + cwLogEnabled: true, + }); + + // WHEN + const logGroup = imported.logGroup; + + // THEN + expect(logGroup).toBeDefined(); + expect(logGroup!.logGroupName).toBeDefined(); + }); + + test('imported app monitor returns undefined when cwLogEnabled is false', () => { + // GIVEN + const imported = AppMonitor.fromAppMonitorAttributes(stack, 'ImportedAppMonitor', { + appMonitorId: 'existing-id', + appMonitorName: 'existing-app', + cwLogEnabled: false, + }); + + // WHEN + const logGroup = imported.logGroup; + + // THEN + expect(logGroup).toBeUndefined(); + }); + }); + }); +}); diff --git a/packages/@aws-cdk/aws-rum-alpha/test/integ.app-monitor.js.snapshot/RumAlphaAppMonitorIntegrationTestDefaultTestDeployAssert9A9D0FD9.assets.json b/packages/@aws-cdk/aws-rum-alpha/test/integ.app-monitor.js.snapshot/RumAlphaAppMonitorIntegrationTestDefaultTestDeployAssert9A9D0FD9.assets.json new file mode 100644 index 0000000000000..324b021d75238 --- /dev/null +++ b/packages/@aws-cdk/aws-rum-alpha/test/integ.app-monitor.js.snapshot/RumAlphaAppMonitorIntegrationTestDefaultTestDeployAssert9A9D0FD9.assets.json @@ -0,0 +1,20 @@ +{ + "version": "48.0.0", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "displayName": "RumAlphaAppMonitorIntegrationTestDefaultTestDeployAssert9A9D0FD9 Template", + "source": { + "path": "RumAlphaAppMonitorIntegrationTestDefaultTestDeployAssert9A9D0FD9.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region-d8d86b35": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-rum-alpha/test/integ.app-monitor.js.snapshot/RumAlphaAppMonitorIntegrationTestDefaultTestDeployAssert9A9D0FD9.template.json b/packages/@aws-cdk/aws-rum-alpha/test/integ.app-monitor.js.snapshot/RumAlphaAppMonitorIntegrationTestDefaultTestDeployAssert9A9D0FD9.template.json new file mode 100644 index 0000000000000..ad9d0fb73d1dd --- /dev/null +++ b/packages/@aws-cdk/aws-rum-alpha/test/integ.app-monitor.js.snapshot/RumAlphaAppMonitorIntegrationTestDefaultTestDeployAssert9A9D0FD9.template.json @@ -0,0 +1,36 @@ +{ + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-rum-alpha/test/integ.app-monitor.js.snapshot/RumAlphaAppMonitorIntegrationTestStack.assets.json b/packages/@aws-cdk/aws-rum-alpha/test/integ.app-monitor.js.snapshot/RumAlphaAppMonitorIntegrationTestStack.assets.json new file mode 100644 index 0000000000000..f9270b31dcfbe --- /dev/null +++ b/packages/@aws-cdk/aws-rum-alpha/test/integ.app-monitor.js.snapshot/RumAlphaAppMonitorIntegrationTestStack.assets.json @@ -0,0 +1,20 @@ +{ + "version": "48.0.0", + "files": { + "83fa456da44c75db2f1fd5e683621fa8fb39e969ffd021e5c2629623776b2a24": { + "displayName": "RumAlphaAppMonitorIntegrationTestStack Template", + "source": { + "path": "RumAlphaAppMonitorIntegrationTestStack.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region-daba3e0e": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "83fa456da44c75db2f1fd5e683621fa8fb39e969ffd021e5c2629623776b2a24.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-rum-alpha/test/integ.app-monitor.js.snapshot/RumAlphaAppMonitorIntegrationTestStack.template.json b/packages/@aws-cdk/aws-rum-alpha/test/integ.app-monitor.js.snapshot/RumAlphaAppMonitorIntegrationTestStack.template.json new file mode 100644 index 0000000000000..a816b738b93ff --- /dev/null +++ b/packages/@aws-cdk/aws-rum-alpha/test/integ.app-monitor.js.snapshot/RumAlphaAppMonitorIntegrationTestStack.template.json @@ -0,0 +1,123 @@ +{ + "Resources": { + "BasicAppMonitor7000DDB2": { + "Type": "AWS::RUM::AppMonitor", + "Properties": { + "Domain": "example.com", + "Name": "basic-alpha-integ-test-app" + } + }, + "AppMonitorWithLogs5573DCD9": { + "Type": "AWS::RUM::AppMonitor", + "Properties": { + "CwLogEnabled": true, + "Domain": "example.com", + "Name": "alpha-integ-test-app-with-logs" + } + }, + "ConfiguredAppMonitor49808BA1": { + "Type": "AWS::RUM::AppMonitor", + "Properties": { + "AppMonitorConfiguration": { + "AllowCookies": true, + "EnableXRay": true, + "SessionSampleRate": 0.3 + }, + "CustomEvents": { + "Status": "ENABLED" + }, + "Domain": "example.com", + "Name": "configured-alpha-integ-test-app" + } + } + }, + "Outputs": { + "BasicAppMonitorId": { + "Value": { + "Fn::GetAtt": [ + "BasicAppMonitor7000DDB2", + "Id" + ] + } + }, + "BasicAppMonitorName": { + "Value": "basic-alpha-integ-test-app" + }, + "AppMonitorWithLogsId": { + "Value": { + "Fn::GetAtt": [ + "AppMonitorWithLogs5573DCD9", + "Id" + ] + } + }, + "ConfiguredAppMonitorId": { + "Value": { + "Fn::GetAtt": [ + "ConfiguredAppMonitor49808BA1", + "Id" + ] + } + }, + "LogGroupName": { + "Value": { + "Fn::Sub": [ + "RUMService_${Name}${Id}", + { + "Name": "alpha-integ-test-app-with-logs", + "Id": { + "Fn::Select": [ + 0, + { + "Fn::Split": [ + "-", + { + "Fn::GetAtt": [ + "AppMonitorWithLogs5573DCD9", + "Id" + ] + } + ] + } + ] + } + } + ] + } + } + }, + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-rum-alpha/test/integ.app-monitor.js.snapshot/cdk.out b/packages/@aws-cdk/aws-rum-alpha/test/integ.app-monitor.js.snapshot/cdk.out new file mode 100644 index 0000000000000..523a9aac37cbf --- /dev/null +++ b/packages/@aws-cdk/aws-rum-alpha/test/integ.app-monitor.js.snapshot/cdk.out @@ -0,0 +1 @@ +{"version":"48.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-rum-alpha/test/integ.app-monitor.js.snapshot/integ.json b/packages/@aws-cdk/aws-rum-alpha/test/integ.app-monitor.js.snapshot/integ.json new file mode 100644 index 0000000000000..4a5e4461776b2 --- /dev/null +++ b/packages/@aws-cdk/aws-rum-alpha/test/integ.app-monitor.js.snapshot/integ.json @@ -0,0 +1,13 @@ +{ + "version": "48.0.0", + "testCases": { + "RumAlphaAppMonitorIntegrationTest/DefaultTest": { + "stacks": [ + "RumAlphaAppMonitorIntegrationTestStack" + ], + "assertionStack": "RumAlphaAppMonitorIntegrationTest/DefaultTest/DeployAssert", + "assertionStackName": "RumAlphaAppMonitorIntegrationTestDefaultTestDeployAssert9A9D0FD9" + } + }, + "minimumCliVersion": "2.1023.0" +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-rum-alpha/test/integ.app-monitor.js.snapshot/manifest.json b/packages/@aws-cdk/aws-rum-alpha/test/integ.app-monitor.js.snapshot/manifest.json new file mode 100644 index 0000000000000..7c04831e893e5 --- /dev/null +++ b/packages/@aws-cdk/aws-rum-alpha/test/integ.app-monitor.js.snapshot/manifest.json @@ -0,0 +1,630 @@ +{ + "version": "48.0.0", + "artifacts": { + "RumAlphaAppMonitorIntegrationTestStack.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "RumAlphaAppMonitorIntegrationTestStack.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "RumAlphaAppMonitorIntegrationTestStack": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "RumAlphaAppMonitorIntegrationTestStack.template.json", + "terminationProtection": false, + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/83fa456da44c75db2f1fd5e683621fa8fb39e969ffd021e5c2629623776b2a24.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "RumAlphaAppMonitorIntegrationTestStack.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "RumAlphaAppMonitorIntegrationTestStack.assets" + ], + "metadata": { + "/RumAlphaAppMonitorIntegrationTestStack/BasicAppMonitor/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "BasicAppMonitor7000DDB2" + } + ], + "/RumAlphaAppMonitorIntegrationTestStack/AppMonitorWithLogs/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "AppMonitorWithLogs5573DCD9" + } + ], + "/RumAlphaAppMonitorIntegrationTestStack/ConfiguredAppMonitor/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ConfiguredAppMonitor49808BA1" + } + ], + "/RumAlphaAppMonitorIntegrationTestStack/BasicAppMonitorId": [ + { + "type": "aws:cdk:logicalId", + "data": "BasicAppMonitorId" + } + ], + "/RumAlphaAppMonitorIntegrationTestStack/BasicAppMonitorName": [ + { + "type": "aws:cdk:logicalId", + "data": "BasicAppMonitorName" + } + ], + "/RumAlphaAppMonitorIntegrationTestStack/AppMonitorWithLogsId": [ + { + "type": "aws:cdk:logicalId", + "data": "AppMonitorWithLogsId" + } + ], + "/RumAlphaAppMonitorIntegrationTestStack/ConfiguredAppMonitorId": [ + { + "type": "aws:cdk:logicalId", + "data": "ConfiguredAppMonitorId" + } + ], + "/RumAlphaAppMonitorIntegrationTestStack/LogGroupName": [ + { + "type": "aws:cdk:logicalId", + "data": "LogGroupName" + } + ], + "/RumAlphaAppMonitorIntegrationTestStack/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/RumAlphaAppMonitorIntegrationTestStack/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "RumAlphaAppMonitorIntegrationTestStack" + }, + "RumAlphaAppMonitorIntegrationTestDefaultTestDeployAssert9A9D0FD9.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "RumAlphaAppMonitorIntegrationTestDefaultTestDeployAssert9A9D0FD9.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "RumAlphaAppMonitorIntegrationTestDefaultTestDeployAssert9A9D0FD9": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "RumAlphaAppMonitorIntegrationTestDefaultTestDeployAssert9A9D0FD9.template.json", + "terminationProtection": false, + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "RumAlphaAppMonitorIntegrationTestDefaultTestDeployAssert9A9D0FD9.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "RumAlphaAppMonitorIntegrationTestDefaultTestDeployAssert9A9D0FD9.assets" + ], + "metadata": { + "/RumAlphaAppMonitorIntegrationTest/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/RumAlphaAppMonitorIntegrationTest/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "RumAlphaAppMonitorIntegrationTest/DefaultTest/DeployAssert" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } + }, + "aws-cdk-lib/feature-flag-report": { + "type": "cdk:feature-flag-report", + "properties": { + "module": "aws-cdk-lib", + "flags": { + "@aws-cdk/aws-signer:signingProfileNamePassedToCfn": { + "recommendedValue": true, + "explanation": "Pass signingProfileName to CfnSigningProfile" + }, + "@aws-cdk/core:newStyleStackSynthesis": { + "recommendedValue": true, + "explanation": "Switch to new stack synthesis method which enables CI/CD", + "unconfiguredBehavesLike": { + "v2": true + } + }, + "@aws-cdk/core:stackRelativeExports": { + "recommendedValue": true, + "explanation": "Name exports based on the construct paths relative to the stack, rather than the global construct path", + "unconfiguredBehavesLike": { + "v2": true + } + }, + "@aws-cdk/aws-rds:lowercaseDbIdentifier": { + "recommendedValue": true, + "explanation": "Force lowercasing of RDS Cluster names in CDK", + "unconfiguredBehavesLike": { + "v2": true + } + }, + "@aws-cdk/aws-apigateway:usagePlanKeyOrderInsensitiveId": { + "recommendedValue": true, + "explanation": "Allow adding/removing multiple UsagePlanKeys independently", + "unconfiguredBehavesLike": { + "v2": true + } + }, + "@aws-cdk/aws-lambda:recognizeVersionProps": { + "recommendedValue": true, + "explanation": "Enable this feature flag to opt in to the updated logical id calculation for Lambda Version created using the `fn.currentVersion`.", + "unconfiguredBehavesLike": { + "v2": true + } + }, + "@aws-cdk/aws-lambda:recognizeLayerVersion": { + "userValue": true, + "recommendedValue": true, + "explanation": "Enable this feature flag to opt in to the updated logical id calculation for Lambda Version created using the `fn.currentVersion`." + }, + "@aws-cdk/aws-cloudfront:defaultSecurityPolicyTLSv1.2_2021": { + "recommendedValue": true, + "explanation": "Enable this feature flag to have cloudfront distributions use the security policy TLSv1.2_2021 by default.", + "unconfiguredBehavesLike": { + "v2": true + } + }, + "@aws-cdk/core:checkSecretUsage": { + "userValue": true, + "recommendedValue": true, + "explanation": "Enable this flag to make it impossible to accidentally use SecretValues in unsafe locations" + }, + "@aws-cdk/core:target-partitions": { + "recommendedValue": [ + "aws", + "aws-cn" + ], + "explanation": "What regions to include in lookup tables of environment agnostic stacks" + }, + "@aws-cdk-containers/ecs-service-extensions:enableDefaultLogDriver": { + "userValue": true, + "recommendedValue": true, + "explanation": "ECS extensions will automatically add an `awslogs` driver if no logging is specified" + }, + "@aws-cdk/aws-ec2:uniqueImdsv2TemplateName": { + "userValue": true, + "recommendedValue": true, + "explanation": "Enable this feature flag to have Launch Templates generated by the `InstanceRequireImdsv2Aspect` use unique names." + }, + "@aws-cdk/aws-ecs:arnFormatIncludesClusterName": { + "userValue": true, + "recommendedValue": true, + "explanation": "ARN format used by ECS. In the new ARN format, the cluster name is part of the resource ID." + }, + "@aws-cdk/aws-iam:minimizePolicies": { + "userValue": true, + "recommendedValue": true, + "explanation": "Minimize IAM policies by combining Statements" + }, + "@aws-cdk/core:validateSnapshotRemovalPolicy": { + "userValue": true, + "recommendedValue": true, + "explanation": "Error on snapshot removal policies on resources that do not support it." + }, + "@aws-cdk/aws-codepipeline:crossAccountKeyAliasStackSafeResourceName": { + "userValue": true, + "recommendedValue": true, + "explanation": "Generate key aliases that include the stack name" + }, + "@aws-cdk/aws-s3:createDefaultLoggingPolicy": { + "userValue": true, + "recommendedValue": true, + "explanation": "Enable this feature flag to create an S3 bucket policy by default in cases where an AWS service would automatically create the Policy if one does not exist." + }, + "@aws-cdk/aws-sns-subscriptions:restrictSqsDescryption": { + "userValue": true, + "recommendedValue": true, + "explanation": "Restrict KMS key policy for encrypted Queues a bit more" + }, + "@aws-cdk/aws-apigateway:disableCloudWatchRole": { + "userValue": true, + "recommendedValue": true, + "explanation": "Make default CloudWatch Role behavior safe for multiple API Gateways in one environment" + }, + "@aws-cdk/core:enablePartitionLiterals": { + "userValue": true, + "recommendedValue": true, + "explanation": "Make ARNs concrete if AWS partition is known" + }, + "@aws-cdk/aws-events:eventsTargetQueueSameAccount": { + "userValue": true, + "recommendedValue": true, + "explanation": "Event Rules may only push to encrypted SQS queues in the same account" + }, + "@aws-cdk/aws-ecs:disableExplicitDeploymentControllerForCircuitBreaker": { + "userValue": true, + "recommendedValue": true, + "explanation": "Avoid setting the \"ECS\" deployment controller when adding a circuit breaker" + }, + "@aws-cdk/aws-iam:importedRoleStackSafeDefaultPolicyName": { + "userValue": true, + "recommendedValue": true, + "explanation": "Enable this feature to by default create default policy names for imported roles that depend on the stack the role is in." + }, + "@aws-cdk/aws-s3:serverAccessLogsUseBucketPolicy": { + "userValue": true, + "recommendedValue": true, + "explanation": "Use S3 Bucket Policy instead of ACLs for Server Access Logging" + }, + "@aws-cdk/aws-route53-patters:useCertificate": { + "userValue": true, + "recommendedValue": true, + "explanation": "Use the official `Certificate` resource instead of `DnsValidatedCertificate`" + }, + "@aws-cdk/customresources:installLatestAwsSdkDefault": { + "userValue": false, + "recommendedValue": false, + "explanation": "Whether to install the latest SDK by default in AwsCustomResource" + }, + "@aws-cdk/aws-rds:databaseProxyUniqueResourceName": { + "userValue": true, + "recommendedValue": true, + "explanation": "Use unique resource name for Database Proxy" + }, + "@aws-cdk/aws-codedeploy:removeAlarmsFromDeploymentGroup": { + "userValue": true, + "recommendedValue": true, + "explanation": "Remove CloudWatch alarms from deployment group" + }, + "@aws-cdk/aws-apigateway:authorizerChangeDeploymentLogicalId": { + "userValue": true, + "recommendedValue": true, + "explanation": "Include authorizer configuration in the calculation of the API deployment logical ID." + }, + "@aws-cdk/aws-ec2:launchTemplateDefaultUserData": { + "userValue": true, + "recommendedValue": true, + "explanation": "Define user data for a launch template by default when a machine image is provided." + }, + "@aws-cdk/aws-secretsmanager:useAttachedSecretResourcePolicyForSecretTargetAttachments": { + "userValue": true, + "recommendedValue": true, + "explanation": "SecretTargetAttachments uses the ResourcePolicy of the attached Secret." + }, + "@aws-cdk/aws-redshift:columnId": { + "userValue": true, + "recommendedValue": true, + "explanation": "Whether to use an ID to track Redshift column changes" + }, + "@aws-cdk/aws-stepfunctions-tasks:enableEmrServicePolicyV2": { + "userValue": true, + "recommendedValue": true, + "explanation": "Enable AmazonEMRServicePolicy_v2 managed policies" + }, + "@aws-cdk/aws-ec2:restrictDefaultSecurityGroup": { + "userValue": true, + "recommendedValue": true, + "explanation": "Restrict access to the VPC default security group" + }, + "@aws-cdk/aws-apigateway:requestValidatorUniqueId": { + "userValue": true, + "recommendedValue": true, + "explanation": "Generate a unique id for each RequestValidator added to a method" + }, + "@aws-cdk/aws-kms:aliasNameRef": { + "userValue": true, + "recommendedValue": true, + "explanation": "KMS Alias name and keyArn will have implicit reference to KMS Key" + }, + "@aws-cdk/aws-kms:applyImportedAliasPermissionsToPrincipal": { + "userValue": true, + "recommendedValue": true, + "explanation": "Enable grant methods on Aliases imported by name to use kms:ResourceAliases condition" + }, + "@aws-cdk/aws-autoscaling:generateLaunchTemplateInsteadOfLaunchConfig": { + "userValue": true, + "recommendedValue": true, + "explanation": "Generate a launch template when creating an AutoScalingGroup" + }, + "@aws-cdk/core:includePrefixInUniqueNameGeneration": { + "userValue": true, + "recommendedValue": true, + "explanation": "Include the stack prefix in the stack name generation process" + }, + "@aws-cdk/aws-efs:denyAnonymousAccess": { + "userValue": true, + "recommendedValue": true, + "explanation": "EFS denies anonymous clients accesses" + }, + "@aws-cdk/aws-opensearchservice:enableOpensearchMultiAzWithStandby": { + "userValue": true, + "recommendedValue": true, + "explanation": "Enables support for Multi-AZ with Standby deployment for opensearch domains" + }, + "@aws-cdk/aws-lambda-nodejs:useLatestRuntimeVersion": { + "userValue": true, + "recommendedValue": true, + "explanation": "Enables aws-lambda-nodejs.Function to use the latest available NodeJs runtime as the default" + }, + "@aws-cdk/aws-efs:mountTargetOrderInsensitiveLogicalId": { + "userValue": true, + "recommendedValue": true, + "explanation": "When enabled, mount targets will have a stable logicalId that is linked to the associated subnet." + }, + "@aws-cdk/aws-rds:auroraClusterChangeScopeOfInstanceParameterGroupWithEachParameters": { + "userValue": true, + "recommendedValue": true, + "explanation": "When enabled, a scope of InstanceParameterGroup for AuroraClusterInstance with each parameters will change." + }, + "@aws-cdk/aws-appsync:useArnForSourceApiAssociationIdentifier": { + "userValue": true, + "recommendedValue": true, + "explanation": "When enabled, will always use the arn for identifiers for CfnSourceApiAssociation in the GraphqlApi construct rather than id." + }, + "@aws-cdk/aws-rds:preventRenderingDeprecatedCredentials": { + "userValue": true, + "recommendedValue": true, + "explanation": "When enabled, creating an RDS database cluster from a snapshot will only render credentials for snapshot credentials." + }, + "@aws-cdk/aws-codepipeline-actions:useNewDefaultBranchForCodeCommitSource": { + "userValue": true, + "recommendedValue": true, + "explanation": "When enabled, the CodeCommit source action is using the default branch name 'main'." + }, + "@aws-cdk/aws-cloudwatch-actions:changeLambdaPermissionLogicalIdForLambdaAction": { + "userValue": true, + "recommendedValue": true, + "explanation": "When enabled, the logical ID of a Lambda permission for a Lambda action includes an alarm ID." + }, + "@aws-cdk/aws-codepipeline:crossAccountKeysDefaultValueToFalse": { + "userValue": true, + "recommendedValue": true, + "explanation": "Enables Pipeline to set the default value for crossAccountKeys to false." + }, + "@aws-cdk/aws-codepipeline:defaultPipelineTypeToV2": { + "userValue": true, + "recommendedValue": true, + "explanation": "Enables Pipeline to set the default pipeline type to V2." + }, + "@aws-cdk/aws-kms:reduceCrossAccountRegionPolicyScope": { + "userValue": true, + "recommendedValue": true, + "explanation": "When enabled, IAM Policy created from KMS key grant will reduce the resource scope to this key only." + }, + "@aws-cdk/pipelines:reduceAssetRoleTrustScope": { + "recommendedValue": true, + "explanation": "Remove the root account principal from PipelineAssetsFileRole trust policy", + "unconfiguredBehavesLike": { + "v2": true + } + }, + "@aws-cdk/aws-eks:nodegroupNameAttribute": { + "userValue": true, + "recommendedValue": true, + "explanation": "When enabled, nodegroupName attribute of the provisioned EKS NodeGroup will not have the cluster name prefix." + }, + "@aws-cdk/aws-ec2:ebsDefaultGp3Volume": { + "userValue": true, + "recommendedValue": true, + "explanation": "When enabled, the default volume type of the EBS volume will be GP3" + }, + "@aws-cdk/aws-ecs:removeDefaultDeploymentAlarm": { + "userValue": true, + "recommendedValue": true, + "explanation": "When enabled, remove default deployment alarm settings" + }, + "@aws-cdk/custom-resources:logApiResponseDataPropertyTrueDefault": { + "userValue": false, + "recommendedValue": false, + "explanation": "When enabled, the custom resource used for `AwsCustomResource` will configure the `logApiResponseData` property as true by default" + }, + "@aws-cdk/aws-s3:keepNotificationInImportedBucket": { + "userValue": false, + "recommendedValue": false, + "explanation": "When enabled, Adding notifications to a bucket in the current stack will not remove notification from imported stack." + }, + "@aws-cdk/aws-stepfunctions-tasks:useNewS3UriParametersForBedrockInvokeModelTask": { + "recommendedValue": true, + "explanation": "When enabled, use new props for S3 URI field in task definition of state machine for bedrock invoke model.", + "unconfiguredBehavesLike": { + "v2": true + } + }, + "@aws-cdk/core:explicitStackTags": { + "userValue": true, + "recommendedValue": true, + "explanation": "When enabled, stack tags need to be assigned explicitly on a Stack." + }, + "@aws-cdk/aws-ecs:enableImdsBlockingDeprecatedFeature": { + "userValue": false, + "recommendedValue": false, + "explanation": "When set to true along with canContainersAccessInstanceRole=false in ECS cluster, new updated commands will be added to UserData to block container accessing IMDS. **Applicable to Linux only. IMPORTANT: See [details.](#aws-cdkaws-ecsenableImdsBlockingDeprecatedFeature)**" + }, + "@aws-cdk/aws-ecs:disableEcsImdsBlocking": { + "userValue": true, + "recommendedValue": true, + "explanation": "When set to true, CDK synth will throw exception if canContainersAccessInstanceRole is false. **IMPORTANT: See [details.](#aws-cdkaws-ecsdisableEcsImdsBlocking)**" + }, + "@aws-cdk/aws-ecs:reduceEc2FargateCloudWatchPermissions": { + "userValue": true, + "recommendedValue": true, + "explanation": "When enabled, we will only grant the necessary permissions when users specify cloudwatch log group through logConfiguration" + }, + "@aws-cdk/aws-dynamodb:resourcePolicyPerReplica": { + "userValue": true, + "recommendedValue": true, + "explanation": "When enabled will allow you to specify a resource policy per replica, and not copy the source table policy to all replicas" + }, + "@aws-cdk/aws-ec2:ec2SumTImeoutEnabled": { + "userValue": true, + "recommendedValue": true, + "explanation": "When enabled, initOptions.timeout and resourceSignalTimeout values will be summed together." + }, + "@aws-cdk/aws-appsync:appSyncGraphQLAPIScopeLambdaPermission": { + "userValue": true, + "recommendedValue": true, + "explanation": "When enabled, a Lambda authorizer Permission created when using GraphqlApi will be properly scoped with a SourceArn." + }, + "@aws-cdk/aws-rds:setCorrectValueForDatabaseInstanceReadReplicaInstanceResourceId": { + "userValue": true, + "recommendedValue": true, + "explanation": "When enabled, the value of property `instanceResourceId` in construct `DatabaseInstanceReadReplica` will be set to the correct value which is `DbiResourceId` instead of currently `DbInstanceArn`" + }, + "@aws-cdk/core:cfnIncludeRejectComplexResourceUpdateCreatePolicyIntrinsics": { + "userValue": true, + "recommendedValue": true, + "explanation": "When enabled, CFN templates added with `cfn-include` will error if the template contains Resource Update or Create policies with CFN Intrinsics that include non-primitive values." + }, + "@aws-cdk/aws-lambda-nodejs:sdkV3ExcludeSmithyPackages": { + "userValue": true, + "recommendedValue": true, + "explanation": "When enabled, both `@aws-sdk` and `@smithy` packages will be excluded from the Lambda Node.js 18.x runtime to prevent version mismatches in bundled applications." + }, + "@aws-cdk/aws-stepfunctions-tasks:fixRunEcsTaskPolicy": { + "userValue": true, + "recommendedValue": true, + "explanation": "When enabled, the resource of IAM Run Ecs policy generated by SFN EcsRunTask will reference the definition, instead of constructing ARN." + }, + "@aws-cdk/aws-ec2:bastionHostUseAmazonLinux2023ByDefault": { + "userValue": true, + "recommendedValue": true, + "explanation": "When enabled, the BastionHost construct will use the latest Amazon Linux 2023 AMI, instead of Amazon Linux 2." + }, + "@aws-cdk/core:aspectStabilization": { + "recommendedValue": true, + "explanation": "When enabled, a stabilization loop will be run when invoking Aspects during synthesis.", + "unconfiguredBehavesLike": { + "v2": true + } + }, + "@aws-cdk/aws-route53-targets:userPoolDomainNameMethodWithoutCustomResource": { + "userValue": true, + "recommendedValue": true, + "explanation": "When enabled, use a new method for DNS Name of user pool domain target without creating a custom resource." + }, + "@aws-cdk/aws-elasticloadbalancingV2:albDualstackWithoutPublicIpv4SecurityGroupRulesDefault": { + "userValue": true, + "recommendedValue": true, + "explanation": "When enabled, the default security group ingress rules will allow IPv6 ingress from anywhere" + }, + "@aws-cdk/aws-iam:oidcRejectUnauthorizedConnections": { + "userValue": true, + "recommendedValue": true, + "explanation": "When enabled, the default behaviour of OIDC provider will reject unauthorized connections" + }, + "@aws-cdk/core:enableAdditionalMetadataCollection": { + "userValue": true, + "recommendedValue": true, + "explanation": "When enabled, CDK will expand the scope of usage data collected to better inform CDK development and improve communication for security concerns and emerging issues." + }, + "@aws-cdk/aws-lambda:createNewPoliciesWithAddToRolePolicy": { + "userValue": false, + "recommendedValue": false, + "explanation": "[Deprecated] When enabled, Lambda will create new inline policies with AddToRolePolicy instead of adding to the Default Policy Statement" + }, + "@aws-cdk/aws-s3:setUniqueReplicationRoleName": { + "userValue": true, + "recommendedValue": true, + "explanation": "When enabled, CDK will automatically generate a unique role name that is used for s3 object replication." + }, + "@aws-cdk/pipelines:reduceStageRoleTrustScope": { + "recommendedValue": true, + "explanation": "Remove the root account principal from Stage addActions trust policy", + "unconfiguredBehavesLike": { + "v2": true + } + }, + "@aws-cdk/aws-events:requireEventBusPolicySid": { + "userValue": true, + "recommendedValue": true, + "explanation": "When enabled, grantPutEventsTo() will use resource policies with Statement IDs for service principals." + }, + "@aws-cdk/core:aspectPrioritiesMutating": { + "userValue": true, + "recommendedValue": true, + "explanation": "When set to true, Aspects added by the construct library on your behalf will be given a priority of MUTATING." + }, + "@aws-cdk/aws-dynamodb:retainTableReplica": { + "userValue": true, + "recommendedValue": true, + "explanation": "When enabled, table replica will be default to the removal policy of source table unless specified otherwise." + }, + "@aws-cdk/cognito:logUserPoolClientSecretValue": { + "recommendedValue": false, + "explanation": "When disabled, the value of the user pool client secret will not be logged in the custom resource lambda function logs." + }, + "@aws-cdk/pipelines:reduceCrossAccountActionRoleTrustScope": { + "recommendedValue": true, + "explanation": "When enabled, scopes down the trust policy for the cross-account action role", + "unconfiguredBehavesLike": { + "v2": true + } + }, + "@aws-cdk/aws-stepfunctions:useDistributedMapResultWriterV2": { + "userValue": true, + "recommendedValue": true, + "explanation": "When enabled, the resultWriterV2 property of DistributedMap will be used insted of resultWriter" + }, + "@aws-cdk/s3-notifications:addS3TrustKeyPolicyForSnsSubscriptions": { + "userValue": true, + "recommendedValue": true, + "explanation": "Add an S3 trust policy to a KMS key resource policy for SNS subscriptions." + }, + "@aws-cdk/aws-ec2:requirePrivateSubnetsForEgressOnlyInternetGateway": { + "userValue": true, + "recommendedValue": true, + "explanation": "When enabled, the EgressOnlyGateway resource is only created if private subnets are defined in the dual-stack VPC." + }, + "@aws-cdk/aws-ec2-alpha:useResourceIdForVpcV2Migration": { + "recommendedValue": false, + "explanation": "When enabled, use resource IDs for VPC V2 migration" + }, + "@aws-cdk/aws-s3:publicAccessBlockedByDefault": { + "userValue": true, + "recommendedValue": true, + "explanation": "When enabled, setting any combination of options for BlockPublicAccess will automatically set true for any options not defined." + }, + "@aws-cdk/aws-lambda:useCdkManagedLogGroup": { + "userValue": true, + "recommendedValue": true, + "explanation": "When enabled, CDK creates and manages loggroup for the lambda function" + } + } + } + } + }, + "minimumCliVersion": "2.1023.0" +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-rum-alpha/test/integ.app-monitor.js.snapshot/tree.json b/packages/@aws-cdk/aws-rum-alpha/test/integ.app-monitor.js.snapshot/tree.json new file mode 100644 index 0000000000000..bdd5305f1fe82 --- /dev/null +++ b/packages/@aws-cdk/aws-rum-alpha/test/integ.app-monitor.js.snapshot/tree.json @@ -0,0 +1 @@ +{"version":"tree-0.1","tree":{"id":"App","path":"","constructInfo":{"fqn":"aws-cdk-lib.App","version":"0.0.0"},"children":{"RumAlphaAppMonitorIntegrationTestStack":{"id":"RumAlphaAppMonitorIntegrationTestStack","path":"RumAlphaAppMonitorIntegrationTestStack","constructInfo":{"fqn":"aws-cdk-lib.Stack","version":"0.0.0"},"children":{"BasicAppMonitor":{"id":"BasicAppMonitor","path":"RumAlphaAppMonitorIntegrationTestStack/BasicAppMonitor","constructInfo":{"fqn":"@aws-cdk/aws-rum-alpha.AppMonitor","version":"0.0.0","metadata":[]},"children":{"Resource":{"id":"Resource","path":"RumAlphaAppMonitorIntegrationTestStack/BasicAppMonitor/Resource","constructInfo":{"fqn":"aws-cdk-lib.aws_rum.CfnAppMonitor","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::RUM::AppMonitor","aws:cdk:cloudformation:props":{"domain":"example.com","name":"basic-alpha-integ-test-app"}}}}},"AppMonitorWithLogs":{"id":"AppMonitorWithLogs","path":"RumAlphaAppMonitorIntegrationTestStack/AppMonitorWithLogs","constructInfo":{"fqn":"@aws-cdk/aws-rum-alpha.AppMonitor","version":"0.0.0","metadata":[]},"children":{"Resource":{"id":"Resource","path":"RumAlphaAppMonitorIntegrationTestStack/AppMonitorWithLogs/Resource","constructInfo":{"fqn":"aws-cdk-lib.aws_rum.CfnAppMonitor","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::RUM::AppMonitor","aws:cdk:cloudformation:props":{"cwLogEnabled":true,"domain":"example.com","name":"alpha-integ-test-app-with-logs"}}},"LogGroup":{"id":"LogGroup","path":"RumAlphaAppMonitorIntegrationTestStack/AppMonitorWithLogs/LogGroup","constructInfo":{"fqn":"aws-cdk-lib.Resource","version":"0.0.0","metadata":[]}}}},"ConfiguredAppMonitor":{"id":"ConfiguredAppMonitor","path":"RumAlphaAppMonitorIntegrationTestStack/ConfiguredAppMonitor","constructInfo":{"fqn":"@aws-cdk/aws-rum-alpha.AppMonitor","version":"0.0.0","metadata":[]},"children":{"Resource":{"id":"Resource","path":"RumAlphaAppMonitorIntegrationTestStack/ConfiguredAppMonitor/Resource","constructInfo":{"fqn":"aws-cdk-lib.aws_rum.CfnAppMonitor","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::RUM::AppMonitor","aws:cdk:cloudformation:props":{"appMonitorConfiguration":{"allowCookies":true,"enableXRay":true,"sessionSampleRate":0.3},"customEvents":{"status":"ENABLED"},"domain":"example.com","name":"configured-alpha-integ-test-app"}}}}},"BasicAppMonitorId":{"id":"BasicAppMonitorId","path":"RumAlphaAppMonitorIntegrationTestStack/BasicAppMonitorId","constructInfo":{"fqn":"aws-cdk-lib.CfnOutput","version":"0.0.0"}},"BasicAppMonitorName":{"id":"BasicAppMonitorName","path":"RumAlphaAppMonitorIntegrationTestStack/BasicAppMonitorName","constructInfo":{"fqn":"aws-cdk-lib.CfnOutput","version":"0.0.0"}},"AppMonitorWithLogsId":{"id":"AppMonitorWithLogsId","path":"RumAlphaAppMonitorIntegrationTestStack/AppMonitorWithLogsId","constructInfo":{"fqn":"aws-cdk-lib.CfnOutput","version":"0.0.0"}},"ConfiguredAppMonitorId":{"id":"ConfiguredAppMonitorId","path":"RumAlphaAppMonitorIntegrationTestStack/ConfiguredAppMonitorId","constructInfo":{"fqn":"aws-cdk-lib.CfnOutput","version":"0.0.0"}},"LogGroupName":{"id":"LogGroupName","path":"RumAlphaAppMonitorIntegrationTestStack/LogGroupName","constructInfo":{"fqn":"aws-cdk-lib.CfnOutput","version":"0.0.0"}},"BootstrapVersion":{"id":"BootstrapVersion","path":"RumAlphaAppMonitorIntegrationTestStack/BootstrapVersion","constructInfo":{"fqn":"aws-cdk-lib.CfnParameter","version":"0.0.0"}},"CheckBootstrapVersion":{"id":"CheckBootstrapVersion","path":"RumAlphaAppMonitorIntegrationTestStack/CheckBootstrapVersion","constructInfo":{"fqn":"aws-cdk-lib.CfnRule","version":"0.0.0"}}}},"RumAlphaAppMonitorIntegrationTest":{"id":"RumAlphaAppMonitorIntegrationTest","path":"RumAlphaAppMonitorIntegrationTest","constructInfo":{"fqn":"@aws-cdk/integ-tests-alpha.IntegTest","version":"0.0.0"},"children":{"DefaultTest":{"id":"DefaultTest","path":"RumAlphaAppMonitorIntegrationTest/DefaultTest","constructInfo":{"fqn":"@aws-cdk/integ-tests-alpha.IntegTestCase","version":"0.0.0"},"children":{"Default":{"id":"Default","path":"RumAlphaAppMonitorIntegrationTest/DefaultTest/Default","constructInfo":{"fqn":"constructs.Construct","version":"10.4.2"}},"DeployAssert":{"id":"DeployAssert","path":"RumAlphaAppMonitorIntegrationTest/DefaultTest/DeployAssert","constructInfo":{"fqn":"aws-cdk-lib.Stack","version":"0.0.0"},"children":{"BootstrapVersion":{"id":"BootstrapVersion","path":"RumAlphaAppMonitorIntegrationTest/DefaultTest/DeployAssert/BootstrapVersion","constructInfo":{"fqn":"aws-cdk-lib.CfnParameter","version":"0.0.0"}},"CheckBootstrapVersion":{"id":"CheckBootstrapVersion","path":"RumAlphaAppMonitorIntegrationTest/DefaultTest/DeployAssert/CheckBootstrapVersion","constructInfo":{"fqn":"aws-cdk-lib.CfnRule","version":"0.0.0"}}}}}}}},"Tree":{"id":"Tree","path":"Tree","constructInfo":{"fqn":"constructs.Construct","version":"10.4.2"}}}}} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-rum-alpha/test/integ.app-monitor.ts b/packages/@aws-cdk/aws-rum-alpha/test/integ.app-monitor.ts new file mode 100644 index 0000000000000..262c67e9b0c19 --- /dev/null +++ b/packages/@aws-cdk/aws-rum-alpha/test/integ.app-monitor.ts @@ -0,0 +1,64 @@ +import * as integ from '@aws-cdk/integ-tests-alpha'; +import * as cdk from 'aws-cdk-lib'; +import * as rum from '../lib'; + +const app = new cdk.App(); + +const stack = new cdk.Stack(app, 'RumAlphaAppMonitorIntegrationTestStack'); + +// Basic app monitor with minimal configuration +const basicAppMonitor = new rum.AppMonitor(stack, 'BasicAppMonitor', { + appMonitorName: 'basic-alpha-integ-test-app', + domain: 'example.com', +}); + +// App monitor with CloudWatch logs enabled +const appMonitorWithLogs = new rum.AppMonitor(stack, 'AppMonitorWithLogs', { + appMonitorName: 'alpha-integ-test-app-with-logs', + domain: 'example.com', + cwLogEnabled: true, +}); + +// App monitor with configuration +const configuredAppMonitor = new rum.AppMonitor(stack, 'ConfiguredAppMonitor', { + appMonitorName: 'configured-alpha-integ-test-app', + domain: 'example.com', + appMonitorConfiguration: { + allowCookies: true, + enableXRay: true, + sessionSampleRate: 0.3, + }, + customEvents: { + enabled: true, + }, +}); + +// Test log group access +const logGroup = appMonitorWithLogs.logGroup; + +// Outputs for verification +new cdk.CfnOutput(stack, 'BasicAppMonitorId', { + value: basicAppMonitor.appMonitorId, +}); + +new cdk.CfnOutput(stack, 'BasicAppMonitorName', { + value: basicAppMonitor.appMonitorName, +}); + +new cdk.CfnOutput(stack, 'AppMonitorWithLogsId', { + value: appMonitorWithLogs.appMonitorId, +}); + +new cdk.CfnOutput(stack, 'ConfiguredAppMonitorId', { + value: configuredAppMonitor.appMonitorId, +}); + +if (logGroup) { + new cdk.CfnOutput(stack, 'LogGroupName', { + value: logGroup.logGroupName, + }); +} + +new integ.IntegTest(app, 'RumAlphaAppMonitorIntegrationTest', { + testCases: [stack], +}); diff --git a/yarn.lock b/yarn.lock index 4d6679c6cb176..7adac8f7afad7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12358,16 +12358,7 @@ string-length@^4.0.1: char-regex "^1.0.2" strip-ansi "^6.0.0" -"string-width-cjs@npm:string-width@^4.2.0": - version "4.2.3" - resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - -string-width@^1.0.1, "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3, string-width@^5.0.1, string-width@^5.1.2: +"string-width-cjs@npm:string-width@^4.2.0", string-width@^1.0.1, "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3, string-width@^5.0.1, string-width@^5.1.2: version "4.2.3" resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -12436,7 +12427,7 @@ stringify-package@^1.0.1: resolved "https://registry.npmjs.org/stringify-package/-/stringify-package-1.0.1.tgz#e5aa3643e7f74d0f28628b72f3dad5cecfc3ba85" integrity sha512-sa4DUQsYciMP1xhKWGuFM04fB0LG/9DlluZoSVywUMRNvzid6XucHK0/90xGxRoHrAaROrcHK1aPKaijCtSrhg== -"strip-ansi-cjs@npm:strip-ansi@^6.0.1": +"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -12450,13 +12441,6 @@ strip-ansi@^3.0.1: dependencies: ansi-regex "^2.0.0" -strip-ansi@^6.0.0, strip-ansi@^6.0.1: - version "6.0.1" - resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - strip-ansi@^7.0.1: version "7.1.0" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45" @@ -13330,7 +13314,7 @@ workerpool@^6.5.1: resolved "https://registry.npmjs.org/workerpool/-/workerpool-6.5.1.tgz#060f73b39d0caf97c6db64da004cd01b4c099544" integrity sha512-Fs4dNYcsdpYSAfVxhnl1L5zTksjvOJxtC5hzMNl+1t9B8hTJTdKDyZ5ju7ztgPy+ft9tBFXoOlDNiOT9WUXZlA== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -13348,15 +13332,6 @@ wrap-ansi@^6.0.1, wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214"