Skip to content

Commit

Permalink
add rum
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeshay committed Jul 18, 2024
1 parent dcf3dd1 commit f6b49f1
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 5 deletions.
10 changes: 9 additions & 1 deletion apps/docs/astro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,19 @@ export default defineConfig({
social: {
github: "https://github.com/lukeshay/astro-aws",
},
head: [
{
tag: "script",
attrs: {
src: "/load-cwr.js",
},
},
],
tagline: "AWS CDK constructs for Astro",
title: "Astro AWS",
plugins: [starlightLinksValidator()],
}),
],
output: "static",
site: `https://astro-aws.org/`,
site: "https://www.astro-aws.org/",
})
2 changes: 2 additions & 0 deletions apps/docs/public/cwr.js

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions apps/docs/public/load-cwr.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
;(function (n, i, v, r, s, c, x, z) {
x = window.AwsRumClient = { q: [], n: n, i: i, v: v, r: r, c: c }
window[n] = function (c, p) {
x.q.push({ c: c, p: p })
}
z = document.createElement("script")
z.async = true
z.src = s
document.head.insertBefore(z, document.head.getElementsByTagName("script")[0])
})(
"cwr",
"fbe0adac-0c2a-4780-9bc3-73e032005599",
"1.0.0",
"us-east-1",
"/cwr.js",
{
sessionSampleRate: 1,
identityPoolId: "us-east-1:a32bcdfa-cf9b-4010-9a9d-790b5d92f52a",
endpoint: "https://dataplane.rum.us-east-1.amazonaws.com",
telemetries: ["performance", "errors", "http"],
allowCookies: true,
enableXRay: true,
},
)
2 changes: 1 addition & 1 deletion apps/infra/src/lib/stacks/website-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class WebsiteStack extends Stack {
securityHeadersBehavior: {
contentSecurityPolicy: {
contentSecurityPolicy:
"default-src 'self'; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline'; upgrade-insecure-requests",
"default-src 'self'; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline'; connect-src 'self' cognito-identity.us-east-1.amazonaws.com dataplane.rum.us-east-1.amazonaws.com; upgrade-insecure-requests",
override: true,
},
},
Expand Down
7 changes: 4 additions & 3 deletions apps/infra/support/cross-region-certificate/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { randomUUID } from "node:crypto"

import {
ACMClient,
DeleteCertificateCommand,
DescribeCertificateCommand,
RequestCertificateCommand,
} from "@aws-sdk/client-acm"
Expand Down Expand Up @@ -37,15 +38,15 @@ const onEvent = async (event) => {
}
}

/*await client.send(
await client.send(
new DeleteCertificateCommand({
CertificateArn: event.PhysicalResourceId,
}),
)*/
)

return {
Data: {},
PhysicalResourceId: randomUUID(),
PhysicalResourceId: event.PhysicalResourceId,
}
}

Expand Down

0 comments on commit f6b49f1

Please sign in to comment.