Skip to content

Instantly share code, notes, and snippets.

View fabiopaiva's full-sized avatar

Fábio Paiva fabiopaiva

  • Skyworkz
  • Amsterdam
View GitHub Profile
@fabiopaiva
fabiopaiva / app.ts
Created January 27, 2023 14:20
Reproduce error TooMany requests when managing several API Gateway resources with Cloudformation using CDK
View app.ts
#!/usr/bin/env node
import 'source-map-support/register';
import * as cdk from 'aws-cdk-lib';
import { DebugNightlyBuildStack, DebugNightlyBuildStackWithDependency, DebugNightlyBuildWithNestedStacks, DebugNightlyBuildWithNestedStacksWithDependency } from '../lib/debug-stack';
const app = new cdk.App();
new DebugNightlyBuildStack(app, 'DebugNightlyBuildStack'); // this one crashes on delete
new DebugNightlyBuildWithNestedStacks(app, "DebugNightlyBuildWithNestedStacks"); // this one crashes on delete
new DebugNightlyBuildStackWithDependency(app, "DebugNightlyBuildStackWithDependency"); // this one works
new DebugNightlyBuildWithNestedStacksWithDependency(app, "DebugNightlyBuildWithNestedStacksWithDependency"); // this one works
@fabiopaiva
fabiopaiva / README.md
Created July 20, 2021 09:02
Configure AWS SES Domain Identity and DKIM with CDK
View README.md

Configure AWS SES Domain Identity and DKIM with CDK

Some AWS resources are not availble via Cloudformation but can be managed via AWS API. One example is SES Domain Identity and Domain DKIM configuration.

It's easy to make API Calls using CDK. Check out the example below

@fabiopaiva
fabiopaiva / app.py
Last active December 20, 2021 10:34
CDK stack creating a Terraform s3 backend service
View app.py
from aws_cdk import core as cdk
from terraform_backend_stack import TerraformBackendStack
app = cdk.App()
TerraformBackendStack(
app, "TerraformBackendStack", description="Terraform S3 backend configuration"
)
@fabiopaiva
fabiopaiva / index.js
Created May 20, 2016 02:53
Best Javascript Password Generator Ever
View index.js
var pass = Math.random().toString(36).slice(-8);
console.log(pass);
@fabiopaiva
fabiopaiva / composer.json
Created December 31, 2015 21:15
ZF2 + SMTP + Gmail
View composer.json
{
"require": {
"zendframework/zend-mail": "^2.5"
}
}
@fabiopaiva
fabiopaiva / OauthScopes.php
Last active September 11, 2015 18:01
Apigility + Doctrine + ManyToMany
View OauthScopes.php
<?php
namespace MyNamespace\V1\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* OauthScopes
*
* @ORM\Table(name="oauth_scopes")
@fabiopaiva
fabiopaiva / composer.json
Created August 31, 2015 13:03
Crypt/Decrypt a string or text usign zend/crypt
View composer.json
{
"require": {
"zendframework/zend-crypt":"dev-master"
}
}
@fabiopaiva
fabiopaiva / Module.php
Created August 25, 2015 19:50
Apigility Add Role to access_tokens table
View Module.php
<?php
/**
* @license http://opensource.org/licenses/BSD-3-Clause BSD-3-Clause
* @copyright Copyright (c) 2014 Zend Technologies USA Inc. (http://www.zend.com)
*/
namespace Application;
use Zend\Mvc\ModuleRouteListener;
use Zend\Mvc\MvcEvent;
@fabiopaiva
fabiopaiva / UsuarioResource.php
Created August 11, 2015 17:47
Check scope on apigility authenticated resource
View UsuarioResource.php
<?php
namespace API\V1\Rest\Usuario;
use ZF\Apigility\Doctrine\Server\Resource\DoctrineResource;
use Oauth2;
use ZF\ApiProblem\ApiProblem;
use ZF\Rest\ResourceEvent;
class UsuarioResource extends DoctrineResource
@fabiopaiva
fabiopaiva / IndexController.php
Created August 6, 2015 19:19
ZF2 wsdl Soap 1.1
View IndexController.php
<?php
namespace Application\Controller;
use Zend\Mvc\Controller\AbstractActionController;
use Zend\View\Model\JsonModel;
use Zend\Soap\Client;
use Zend\Config\Reader\Xml;
class IndexController extends AbstractActionController