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
AWSTemplateFormatVersion: "2010-09-09" | |
Description: Share S3 as data location to Lake Formation main account | |
Parameters: | |
DataS3Bucket: | |
Description: Name of your data S3 bucket | |
Type: String | |
Resources: | |
DataLocationBucketPolicy: | |
Type: AWS::S3::BucketPolicy | |
Properties: |
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
Parameters: | |
PrerenderToken: | |
Type: String | |
Resources: | |
WebBucket: | |
Type: "AWS::S3::Bucket" | |
Properties: | |
AccessControl: PublicRead | |
WebsiteConfiguration: | |
ErrorDocument: index.html |
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
#!/bin/bash | |
echo "start spot termination check" | |
meta_url=http://169.254.169.254/latest/meta-data | |
if curl -s $meta_url/spot/termination-time | grep -q .*T.*Z; then | |
target_group=${tgARN}; | |
role_arn='${role}' | |
keyId=`curl -s $meta_url/iam/security-credentials/$role_arn | python -c "import sys, json; obj = json.load(sys.stdin); print(obj['AccessKeyId'])"` | |
secretKey=`curl -s $meta_url/iam/security-credentials/$role_arn | python -c "import sys, json; obj = json.load(sys.stdin); print(obj['SecretAccessKey'])"` | |
token=`curl -s $meta_url/iam/security-credentials/$role_arn | python -c "import sys, json; obj = json.load(sys.stdin); print(obj['Token'])"` | |
export AWS_ACCESS_KEY_ID=$keyId |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<style type="text/css"> | |
body { | |
background-color: #333; | |
font: 60px 'Helvetica, Arial, Ubuntu, sans-serif'; | |
color: #111; | |
} | |
h1 { |
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
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<artifactId>StaticContent</artifactId> | |
<packaging>jar</packaging> | |
<name>StaticContent</name> | |
<version>${version.properties}</version> | |
<url>http://maven.apache.org</url> | |
<build> | |
<plugins> |
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
def patiently(&block) | |
cycles = 0 | |
begin | |
yield | |
rescue => e | |
cycles += 1 | |
sleep 0.1 | |
if cycles < 10 | |
retry | |
else |