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 python3 | |
| import argparse | |
| from decimal import Decimal, InvalidOperation | |
| from collections import defaultdict | |
| from typing import Dict, Tuple, Optional, List | |
| import pyarrow.dataset as ds | |
| DEFAULT_COST_CANDIDATES = [ |
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 python3 | |
| import argparse | |
| import csv | |
| from decimal import Decimal, InvalidOperation | |
| from collections import defaultdict | |
| from typing import Dict, Tuple, Iterable, Optional, List | |
| DEFAULT_COST_CANDIDATES = [ | |
| "lineItem/NetUnblendedCost", |
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
| provider "aws" { | |
| profile = "default" | |
| region = "us-east-1" | |
| } | |
| data "aws_region" "current" {} | |
| resource "aws_s3_bucket" "cur" { | |
| bucket = "cur-test-buckeet-ru98hr8" | |
| force_destroy = true |
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
| from datetime import datetime | |
| import json | |
| import pytz | |
| def return_day(timestamp: str, local_timezone: str): | |
| local_tz = pytz.timezone(local_timezone) | |
| dt = datetime.strptime(timestamp, "%Y/%m/%d %H:%M:%S") | |
| dt_utc = pytz.utc.localize(dt) | |
| adjusted_day = dt_utc.astimezone(local_tz) |
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
| functions-framework==3.* | |
| flask | |
| google-cloud-storage | |
| pillow |
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 functions_framework | |
| from flask import Request, Response | |
| from google.cloud import storage | |
| from PIL import Image | |
| import io | |
| import mimetypes | |
| # Set your bucket name here | |
| BUCKET_NAME = 'my-resize-bucket-poc' |
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
| TLD | renewal price until April 8th | Renewal price starting April 8th | Price difference in USD | price difference in % | |
|---|---|---|---|---|---|
| com | $13.00 | $14.00 | $1.00 | 7.69% | |
| net | $11.00 | $15.00 | $4.00 | 36.36% | |
| org | $12.00 | $14.00 | $2.00 | 16.67% | |
| furniture | $47.00 | $114.00 | $67.00 | 142.55% | |
| creditcard | $141.00 | $179.00 | $38.00 | 26.95% | |
| reviews | $22.00 | $57.00 | $35.00 | 159.09% | |
| careers | $35.00 | $66.00 | $31.00 | 88.57% | |
| fm | $92.00 | $121.00 | $29.00 | 31.52% |
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
| { | |
| "AWSTemplateFormatVersion": "2010-09-09", | |
| "Resources": { | |
| "ExternalAssumeRole": { | |
| "Type": "AWS::IAM::Role", | |
| "Properties": { | |
| "RoleName": "DoiT-Billing-Access", | |
| "AssumeRolePolicyDocument": { | |
| "Version": "2012-10-17", | |
| "Statement": [ |
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/local/bin/python3 | |
| import argparse | |
| import botocore.exceptions | |
| import socket | |
| import random | |
| import shlex | |
| import boto3 | |
| import json | |
| import os |
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
| # assume role to the new account | |
| import boto3 | |
| sts_client = boto3.client('sts') | |
| assume_account_id = '0123456789012' | |
| assume_role_name = 'role_name' | |
| role_session_name = 'check_cost_explorer_script' | |
| assumed_role_object = sts_client.assume_role( | |
| RoleArn=f'arn:aws:iam::{assume_account_id}:role/{assume_role_name}', | |
| RoleSessionName=role_session_name | |
| ) |
NewerOlder