Slide 28
Slide 28 text
監視
const synthetics = require('Synthetics');
const log = require('SyntheticsLogger');
const syntheticsConfiguration = synthetics.getConfiguration();
const flowBuilderBlueprint = async function () {
const url = process.env.URL;
syntheticsConfiguration.setConfig({
includeRequestHeaders: true,
includeResponseHeaders: true,
restrictedHeaders: [],
restrictedUrlParameters: [],
})
let page = await synthetics.getPage()
// Navigate to the initial url
await synthetics.executeStep('navigateToUrl', async function (timeoutInMillis = 30000) {
await page.goto(url, { waitUntil: ['load', 'networkidle0'], timeout: timeoutInMillis });
});
// Execute customer steps
const userid = 'dummy@classmethod';
await synthetics.executeStep('input', async function () {
await page.type("[type='userid']", userid);
});
await synthetics.executeStep('input', async function () {
await page.type("[type='password']", cmppassword);
});
await synthetics.executeStep('click', async function () {
await page.waitForSelector("[type='submit']", { timeout: 30000 });
await page.click("[type='submit']");
});
await synthetics.executeStep('verifyText', async function () {
await page.waitForXPath("//h1[contains(text(), 'はじめに')]", { timeout: 30000 });
});
};
exports.handler = async () => {
return await flowBuilderBlueprint();
}
監視 28
CloudWatch Syntheticsでログインページを伴うサイトの死活監視
Synthetics GUIワークフロービルダーで
ログインページの認証からCCGのコンテンツまで確認