This file contains 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 sys | |
from awsglue.utils import getResolvedOptions | |
from pyspark.context import SparkContext | |
from awsglue.context import GlueContext | |
from awsglue.dynamicframe import DynamicFrame | |
from awsglue.job import Job | |
from pyspark.sql.functions import udf | |
from pyspark.sql.types import StringType | |
glueContext = GlueContext(SparkContext.getOrCreate()) |
This file contains 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 sys | |
from awsglue.utils import getResolvedOptions | |
from pyspark.context import SparkContext | |
from awsglue.context import GlueContext | |
from awsglue.dynamicframe import DynamicFrame | |
from awsglue.job import Job | |
from pyspark.sql.functions import udf | |
from pyspark.sql.types import StringType | |
glueContext = GlueContext(SparkContext.getOrCreate()) |
This file contains 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
var aws = require('aws-sdk'); | |
var config = new aws.ConfigService(); | |
var ec2 = new aws.EC2(); | |
// This is where it's determined whether the resource is compliant or not. | |
// In this example, we look at the tenancy of the EC2 instance and determine whether it matches | |
// the "DesiredTenancy" parameter that is passed to the rule. If the tenancy is not of the DesiredTenancy type, the | |
// instance is marked non-compliant. Otherwise, it is marked complaint. | |
// Helper function used to validate input |
This file contains 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) => { | |
console.log(event); | |
}; |
This file contains 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
var AWS = require('aws-sdk'); | |
// Set the region | |
/* | |
* CHANGE THIS TO YOUR REGION | |
*/ | |
AWS.config.update({region: 'us-east-2'}); | |
// Create S3 service object | |
let s3 = new AWS.S3(); |
This file contains 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
// JavaScript | |
// Load the AWS SDK | |
const aws = require('aws-sdk'); | |
// Construct the AWS S3 Object | |
const s3 = new aws.S3(); | |
// Define variable for the destination bucket | |
var destBucket = "<central logging bucket name>"; |
This file contains 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
// JavaScript Code | |
var connected = false; | |
var doorOpen = false; | |
var timer = false; | |
// assume these are real things - NOT REAL! :) | |
var door = new DoggyDoor(); | |
var collar = new CollarListener(); | |
var app = { |