-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RUM AppMonitor L2 Construct #400
Comments
@madeline-k will be API bar raiser for this one. |
Thank you, @madeline-k. |
Hello, @WinterYukky. I have some feedback and questions about the proposed design here.
I will take a look at the PR you opened as well, it's possible you've already addressed these questions there. |
Also, if you haven't seen it yet, here's a link to the design guidelines: https://github.com/aws/aws-cdk/blob/master/docs/DESIGN_GUIDELINES.md. These should be helpful in both the design and execution phases. |
Thanks for your review.
Yes, I strongly agree with your suggestion. [edited 2022/03/24] error log
|
OK, I merge and fixed description of code snippet. |
Method calls are still required, but I have tried to make it possible to retrieve code snippets as s3-deployment.Source. |
I was looking for this! Thank you! |
We'd love to see this. Any update? |
whats the status here? I am refactoring something and would have been the time to remove a double deploy step from my cdn stack. #sadface |
Any update? |
For anyone looking for just the app monitor id and not the other benefits proposed for the L2 construct: You can now get the app monitor ID from attrid. CDK doco of the property
|
Closing this ticket. We believe the functionality is beneficial, but does not intersect with the core framework and should be vended and maintained separately. |
Description
I am delighted to be able to create a RUM Monitor with CloudFormation.
However, RUM AppMonitor L1 Construct doesn't provide code snippet and AppMonitorID, so
to embed client code user must access management console or run AWS CLI for get AppMonitorID after created RUM AppMonitor by RUM AppMonitor L1 Construct. This is a bit far from full automation, so I propose an L2 construct that can solve these problems..
Overview
Define AppMonitor
Define
AppMonitor
to your stack:Authorizer
To use CloudWatch RUM, your application must have authorization.
You have three options to set up authorization:
The identity pool will contain an unauthenticated identity. This allows the CloudWatch RUM web client to send data to CloudWatch RUM without authenticating the user of the application.
The Amazon Cognito identity pool has an attached IAM role. The Amazon Cognito unauthenticated identity allows the web client to assume the IAM role that is authorized to send data to CloudWatch RUM.
Creates a new Amazon Cognito identity pool
By default, AppMonitor creates a new Amazon Cognito identity pool.
This is the simplest option to set up, and if you choose this no further setup steps are required. You must have administrative permissions to use this option. For more information, see IAM policies to use CloudWatch RUM.
Use an existing Amazon Cognito identity pool
If you want to use an existing Amazon Cognito identity pool,
you need to pass the
identityPool
and therole
that associated with your identity pool.Use Third-party provider
If you want to use third-party authenticator, you can only pass a
role
that associated with your identity pool.Add the following to your application to have it pass the credentials from your provider to CloudWatch RUM. Insert the line so that it runs after a user has signed in to your application and the application has received the credentials to use to access AWS.
For more information, see Amazon Amazon CloudWatch User Guide for to use Third-party provider.
Code Snippet
AppMonitor generates code snippet as you would create them on the management console, except that there are no
<script>
tags.The reason there is no
<script>
tag in the code snippet is that it is intended to be loaded as a regular JavaScript file from your HTML document.This allows you to seamlessly embed RUM into your application without having to rewrite your HTML document when deploying.
The code snippet is integrated with aws-s3-deployment,
so you can deploy directly to any S3 bucket using BucketDeployment.
An example of deploying a static website and code snippet to S3 is shown below.
Your website must load the code snippet with the object key (default:
rum.js
).If you want to use another name for will generates code snippet, then you can pass the
objectKey
toaddCodeSnippet
argument.RUM web client configuration
If you want to use RUM web client configuration (e.g pageIdFormat), you can pass options to
addCodeSnippet
argument.Class Diagram
Implementation
RUM AppMonitor L1 Construct doesn't provide an AppMonitorID so we need to use custom resource for rum:GetAppMonitor. And generate code snippet also needs custom resource because to avoid XSS.
Roles
Workflow
status/proposed
)status/review
)api-approved
applied to pull request)status/final-comments-period
)status/approved
)status/planning
)status/implementing
)status/done
)The text was updated successfully, but these errors were encountered: