Skip to content

Instantly share code, notes, and snippets.

//Lookup the zone based on domain name
const zone = route53.HostedZone.fromLookup(this, 'baseZone', {
domainName: 'url2qr.me'
});
//Add the Subdomain to Route53
const cName = new route53.CnameRecord(this, 'test.baseZone', {
zone: zone,
recordName: 'example',
domainName: publicAssets.bucketWebsiteDomainName
});
import * as cdk from '@aws-cdk/core';
import * as s3 from '@aws-cdk/aws-s3';
import * as s3Deployment from '@aws-cdk/aws-s3-deployment';
import * as route53 from '@aws-cdk/aws-route53';
export class AwsCdkS3Stack extends cdk.Stack {
constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {
super(scope, id, props);
// Create the public S3 bucket
#!/usr/bin/env node
import 'source-map-support/register';
import * as cdk from '@aws-cdk/core';
import { AwsCdkS3Stack } from '../lib/aws-cdk-s3-stack';
const app = new cdk.App();
new AwsCdkS3Stack(app, 'AwsCdkS3Stack', {
env: {
account: process.env.CDK_DEFAULT_ACCOUNT,
region: process.env.CDK_DEFAULT_REGION
// Static Code into Bucket.
const deployment = new s3Deployment.BucketDeployment(
this,
'deployStaticWebsite',
{
sources: [s3Deployment.Source.asset('./program/static')],
destinationBucket: publicAssets,
}
);
# Update packages and install needed compilation dependencies
sudo yum update -y
sudo yum install autoconf bison gcc gcc-c++ libcurl-devel libxml2-devel -y
# Compile OpenSSL v1.0.1 from source, as Amazon Linux uses a newer version than the Lambda Execution Environment, which
# would otherwise produce an incompatible binary.
curl -sL http://www.openssl.org/source/openssl-1.0.1k.tar.gz | tar -xvz
cd openssl-1.0.1k
./config && make && sudo make install
cd ~
<?php
function index($event) {
$invokedBy = $event['user'];
$output = " world!, function invoked by " . $invokedBy;
return('Hello' . $output);
}
sudo yum install -y https://corretto.aws/downloads/latest/amazon-corretto-8-x64-linux-jdk.rpm
wget https://services.gradle.org/distributions/gradle-6.5-bin.zip -P /tmp
sudo unzip -d /opt/gradle /tmp/gradle-6.5-bin.zip
export GRADLE_HOME=/opt/gradle/gradle-6.5
export PATH=${GRADLE_HOME}/bin:${PATH}
cat >> ~/.bash_profile <<TXT
component {
this.name="cfmlServerless";
this.applicationTimeout = CreateTimeSpan(10, 0, 0, 0); //10 days
this.sessionManagement=false;
this.clientManagement=false;
this.setClientCookies=false;
// Yes yes, shoudl not embed in code but for PoC it's fine.
this.datasources = {
<cfquery name="q" result="r">
select *
from customer
</cfquery>
<cfdump var="#q#"/>
<cfdump var="#r.EXECUTIONTIME#"/>