Skip to content

Instantly share code, notes, and snippets.

View wcheek's full-sized avatar

Wesley Cheek wcheek

  • Satake Japan
  • Hiroshima, Japan
View GitHub Profile
@wcheek
wcheek / docker-compose.yml
Last active November 30, 2021 02:39
Run local Glue environment with docker compose
version: '3.8'
services:
glue:
image: amazon/aws-glue-libs:glue_libs_1.0.0_image_01
build:
context: .
stdin_open: true # docker run -i
tty: true # docker run -t
ports:
- 8888:8888
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
import json
import boto3
import zipfile
import urllib as urllib2
import io
import os
import time
@wcheek
wcheek / README.md
Last active April 13, 2022 03:55
pymodbus context manager - manage TCP connection

A simple context manager to manage the connection to a TCP Modbus slave using pymodbus.

@wcheek
wcheek / attached_EFS.py
Created April 22, 2022 08:04
AWS CDK EC2 instance with EFS attached
self.file_system.connections.allow_default_port_from(self.ec2_instance)
self.ec2_instance.user_data.add_commands(
"yum check-update -y",
"yum upgrade -y",
"yum install -y amazon-efs-utils",
"yum install -y nfs-utils",
"file_system_id_1=" + self.file_system.file_system_id,
"efs_mount_point_1=/mnt/efs/fs1",
'mkdir -p "${efs_mount_point_1}"',
import React from "react";
import { Amplify } from "aws-amplify";
import {
AmplifyProvider,
Authenticator,
Button,
Flex,
Image,
Text,
View,
@wcheek
wcheek / App.vue
Created June 21, 2022 00:27
Authentication using AWS Amplify auth, loading external script
<script setup>
import { onMounted } from "vue";
import { Authenticator } from "@aws-amplify/ui-vue";
import "@aws-amplify/ui-vue/styles.css";
onMounted(() => {
const lex = document.createElement("script");
lex.src = "https://d2hzdehb4i1g7i.cloudfront.net/lex-web-ui-loader.min.js";
lex.onload = async function () {
const loaderOpts = {
baseUrl: "https://d2hzdehb4i1g7i.cloudfront.net/",
@wcheek
wcheek / website_deploy.py
Last active October 19, 2022 07:23
CDK Pipelines aws_codepipeline Website Deployment
from aws_cdk import Stack, aws_s3
from aws_cdk import aws_secretsmanager as secretsmanager
from aws_cdk.aws_codebuild import (
BuildEnvironment,
ComputeType,
LinuxBuildImage,
PipelineProject,
)
from aws_cdk.aws_codepipeline import Artifact, Pipeline
from aws_cdk.aws_codepipeline_actions import (
@wcheek
wcheek / Bucket_deployment.py
Last active October 21, 2022 01:30
Trying to bundle web app locally.
s3_deploy.BucketDeployment(
scope=self,
id="websiteDeploy",
sources=[
s3_deploy.Source.asset(
path="website",
bundling=BundlingOptions(
command=[
"bash",
"-c",
@wcheek
wcheek / aws_cdk_pipeline_setup.py
Created September 27, 2023 03:00
AWS CDK Python with NodeJS Dependencies
from aws_cdk importpipelines
# This pipeline deploys a cdk stack
pipeline = pipelines.CodePipeline(
scope=self,
id="Pipeline",
code_build_defaults=code_build,
synth=pipelines.ShellStep(
id="Synth",
input=pipelines.CodePipelineSource.git_hub(
repo_string="MYREPO",