Skip to content

Instantly share code, notes, and snippets.

@sakamaki-kazuyoshi
sakamaki-kazuyoshi / ALB-PublicWeb.yml
Created Jun 7, 2020
AWS WAF environment for logging to S3.
View ALB-PublicWeb.yml
AWSTemplateFormatVersion: '2010-09-09'
# ------------------------------------------------------------#
# Metadata
# ------------------------------------------------------------#
Metadata:
AWS::CloudFormation::Interface:
ParameterGroups:
- Label:
default: "Common Configuration(Resource prefix)"
Parameters:
@sakamaki-kazuyoshi
sakamaki-kazuyoshi / CodePipeline-S3toEC2.yml
Created May 30, 2020
CodePipeline to deploy from S3 to EC2.
View CodePipeline-S3toEC2.yml
AWSTemplateFormatVersion: '2010-09-09'
# ------------------------------------------------------------#
# Input Parameters
# ------------------------------------------------------------#
Parameters:
ProjectName:
Type: String
Default: 'test'
EC2KeyPair:
Type: AWS::EC2::KeyPair::KeyName
@sakamaki-kazuyoshi
sakamaki-kazuyoshi / CloudWatchLogsToS3.yml
Created May 5, 2020
Export Cloudwatch Logs data to S3 via Amazon Kinesis Data Firehose.
View CloudWatchLogsToS3.yml
AWSTemplateFormatVersion: '2010-09-09'
# ------------------------------------------------------------#
# Metadata
# ------------------------------------------------------------#
Metadata:
AWS::CloudFormation::Interface:
ParameterGroups:
- Label:
default: "Kinesis Data Firehose Configuration"
Parameters:
View AmazonAuroraTestEnvironment.yml
AWSTemplateFormatVersion: '2010-09-09'
Description: Amazon Aurora test environment
# ------------------------------------------------------------#
# Input Parameters
# ------------------------------------------------------------#
Metadata:
AWS::CloudFormation::Interface:
ParameterGroups:
- Label:
default: "Global Configuration"
@sakamaki-kazuyoshi
sakamaki-kazuyoshi / DescribeExportTask.py
Last active Sep 18, 2019
Export CloudWatch Logs with Step Functions
View DescribeExportTask.py
import boto3
import logging
logs_client = boto3.client('logs')
logger = logging.getLogger()
logger.setLevel(logging.INFO)
def lambda_handler(event, context):
task_id = event['iterator']['task_id']
@sakamaki-kazuyoshi
sakamaki-kazuyoshi / index.html
Last active Sep 3, 2019
CloudFront Access Logs Conversion
View index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<p>test</p>
View PublicAmazonLinux2.yml
AWSTemplateFormatVersion: '2010-09-09'
Parameters:
ProjectName:
Type: String
Default: 'test'
EC2KeyPair:
Type: AWS::EC2::KeyPair::KeyName
AccessSourceCIDR:
Description: CIDR accessing the Tableau Server
Type: String
View PublicWindows.yml
AWSTemplateFormatVersion: '2010-09-09'
Parameters:
projectName:
Type: String
eC2KeyPair:
Type: AWS::EC2::KeyPair::KeyName
Resources:
vpc:
Type: 'AWS::EC2::VPC'
Properties:
@sakamaki-kazuyoshi
sakamaki-kazuyoshi / Redshift.yml
Last active Jan 28, 2022
AWS再入門ブログリレー AWS Glue編
View Redshift.yml
AWSTemplateFormatVersion: '2010-09-09'
Parameters:
projectName:
Type: String
masterUsername:
Type: String
masterUserPassword:
NoEcho : true
Type: String
Resources:
View amazon-cloudwatch-agent.json
{
"logs": {
"logs_collected": {
"files": {
"collect_list": [
{
"file_path": "/var/log/messages",
"log_group_name": "/var/log/messages"
}
]