This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// We create the dataset which reads the parquet files in the 2021 bucket prefix | |
const cfnDataset = new CfnDataset(this, 'Dataset', { | |
name: 'cost-and-usage-report-dataset', | |
input: { | |
s3InputDefinition: { | |
bucket: `cost-and-usage-report-dataset-2021-12-12`, | |
key: `2021/<[^/]+>.parquet`, | |
}, | |
}, | |
format: 'PARQUET', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// First we create forecast dataset with datafrequency of 1 | |
// We use a timeseries AutoML, the target column is costs | |
const forecastDataset = new AwsCustomResource(this, `forecastDataset`, { | |
onUpdate: { | |
service: 'ForecastService', | |
action: 'createDataset', | |
parameters: { | |
Domain: 'CUSTOM', | |
DatasetName: 'amazonForecastDataset', | |
DataFrequency: 'D', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "RegionRestriction", | |
"Effect": "Deny", | |
"NotAction": [ | |
"apigateway:*", | |
"amplify:*", | |
"amplifybackend:*", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.handler = async (event, context, callback) => { | |
const request = event.Records[0].cf.request; | |
const headers = request.headers; | |
const user = 'YOUR_USERNAME_HERE'; | |
const pass = 'YOUR_PASSWORD_HERE'; | |
const basicAuthentication = 'Basic ' + new Buffer(user + ':' + pass).toString('base64'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import json | |
import boto3 | |
class QueueMessageSender: | |
def __init__(self) -> None: | |
self.s3_client = boto3.client("s3") | |
self.sqs_client = boto3.client("sqs") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from __future__ import print_function | |
import boto3 | |
print('Loading function') | |
#set region | |
REGION = 'us-west-2' | |
#set the SNS topic ARN you want to alert on | |
SNS_TOPIC_ARN = 'arn:aws:sns:REGION:ACCOUNT_ID:TOPIC_NAME' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Comment": "A description of my state machine", | |
"StartAt": "RaiseJiraTicket", | |
"States": { | |
"RaiseJiraTicket": { | |
"Type": "Task", | |
"Parameters": { | |
"DocumentName": "AWS-CreateJiraIssue", | |
"Parameters": { | |
"IssueSummary": [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"widgets": [ | |
{ | |
"height": 15, | |
"width": 24, | |
"y": 21, | |
"x": 0, | |
"type": "explorer", | |
"properties": { | |
"metrics": [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"widgets": [ | |
{ | |
"height": 15, | |
"width": 24, | |
"y": 22, | |
"x": 0, | |
"type": "explorer", | |
"properties": { | |
"metrics": [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"start": "-PT3H", | |
"widgets": [ | |
{ | |
"height": 15, | |
"width": 24, | |
"y": 22, | |
"x": 0, | |
"type": "explorer", | |
"properties": { |