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' | |
Parameters: | |
ResourceRegion: | |
Type: String | |
Description: The region where the resource to be allowed is deployed | |
Default: eu-west-1 | |
ResourceVpcId: | |
Type: String | |
Description: The VPC ID where the resource to be allowed is deployed | |
Conditions: |
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
const url = 'https://REGION-HOST_PROJECT_ID.cloudfunctions.net/FUNCTION_NAME'; | |
const targetAudience = url; | |
const {GoogleAuth} = require('google-auth-library'); | |
const auth = new GoogleAuth(); | |
async function request() { | |
const client = await auth.getIdTokenClient(targetAudience); | |
const res = await client.request({url}); | |
console.info(res.data); | |
} | |
request().catch(err => { |
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
/** | |
* This lambda function creates the necessary security group for Cloudfront | |
*/ | |
const Region = '${ResourceRegion}'; //Hardcoded on Cloudformation template | |
const VpcId = '${ResourceVpcId}'; //Hardcoded on Cloudformation template | |
const AWS = require('aws-sdk'); | |
const GroupName = 'Cloudfront-SecurityGroup'; | |
const topicArn = 'arn:aws:sns:us-east-1:806199016981:AmazonIpSpaceChanged'; |
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' | |
Parameters: | |
ResourceRegion: | |
Type: String | |
Description: The region where the resource to be allowed is deployed | |
Default: eu-west-1 | |
ResourceVpcId: | |
Type: String | |
Description: The VPC ID where the resource to be allowed is deployed | |
Conditions: |
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
$(function ($) { | |
var scanInterval = 2000; | |
if(typeof window.performance.getEntriesByType === 'undefined') return; | |
var alreadyLoggedResources = {}; | |
var logHttpResource = function(resourceName) { | |
if(alreadyLoggedResources.hasOwnProperty(resourceName)) { | |
return; |
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", | |
"Parameters": { | |
"DomainName": { | |
"Description": "Domain name you want to redirect (without www)", | |
"Type": "String" | |
}, | |
"HostedZoneId": { | |
"Type": "AWS::Route53::HostedZone::Id", | |
"Description": "Route53 Hosted Zone Id that your domain is served in" |
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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"cloudformation:*", | |
"s3:*", | |
"lambda:*", | |
"execute-api:*", |
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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"cloudformation:*", | |
"s3:*", | |
"lambda:*", | |
"execute-api:*", |
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
@GET | |
@Path("/helloworld/{id}") | |
public Response indexEndpoint(@PathParam int id) { | |
return Response.status(200).entity("Hello world: " + id).build(); | |
} |
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
<?php | |
public function onBootstrap(EventInterface $e){ | |
$em = $e->getApplication()->getEventManager(); | |
$em->attach(MvcEvent::EVENT_ROUTE, array( | |
$this, | |
'detachNotFoundStrategy' | |
) , 1); | |
} |
NewerOlder