• Stars
    star
    211
  • Rank 186,867 (Top 4 %)
  • Language
    Scala
  • License
    BSD 3-Clause "New...
  • Created over 9 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A type-safe Scala DSL for generating CloudFormation templates

CloudFormation Template Generator

Build Status Coverage Status

Scala DSL to create AWS CloudFormation (CFN) templates. The library allows for easier creation of the AWS CloudFormation JSON by writing Scala code to describe the AWS resources. Lets say we have a handful of CFN templates we want to maintain, and all of those templates use the same AMI. Instead of copying that information into all the templates, lets create an AMI component instead, and then load it into the actual templates.

Why not just write JSON? Because, who in their right mind would want to write all AWS resources in JSON?

Documentation

See the intro blog post.

This library was previously hosted on BinTray, however, with the sunsetting of this service, it is now hosted on Maven Central. You no longer need to add a resolver to pull it in.

The library was previously published under the com.monsanto.arch group ID. With Bayer's acquisition of Monsanto long ago completed, we have renamed the group ID to com.bayer starting with version v3.10.3. Note that the actual Java/SBT packages themselves still use com.monsanto, as that's a more significant breaking change. Only the group ID in SBT/Maven has changed.

libraryDependencies ++= Seq (
  "com.bayer" %% "cloud-formation-template-generator" % "3.10.3"
).map(_.force())

to your build.sbt.

See the Scaladoc for detailed documentation and examples.

See the Change Log for information on new, changed, and deprecated featured.

Note: we are no longer using the git-flow develop/master branch paradigm. Please just branch off master and submit your PRs against it.

Components

Create a Template instance of resources and check out VPCWriter to help write it to a file.

To use the fancier parts of the routing DSL, be sure to import TransportProtocol._.

Misc Features

NEW since the blog post, say you have a topology with subnets across multiple AZ's and you want to specify an autoscaling group that spans them, using our fancy Builders methods. Well this is cross-cutting, so its not strictly nested, so you can use an evil evil var, or now you can use our Template.lookupResource[R <: Resource[R]](name: String) method on previous template parts to extract resources by name. Note this will produce a generation-time error if you lookup something that does not exist or has the wrong type (unfortunately not a generation-time compiler error as most of our other features):

describe("Template Lookup") {
  it("Should lookup resources with the correct type") {

    val expected = `AWS::EC2::VPC`(
      name = "TestVPC",
      CidrBlock = CidrBlock(0,0,0,0,0),
      Tags = Seq.empty[AmazonTag]
    )
    val template = Template.fromResource(expected)

    assert(expected === template.lookupResource[`AWS::EC2::VPC`]("TestVPC"))
}

Currently supported AWS resource types

  • AWS::ApiGateway::Account
  • AWS::ApiGateway::ApiKey
  • AWS::ApiGateway::Authorizer
  • AWS::ApiGateway::BasePathMapping
  • AWS::ApiGateway::ClientCertificate
  • AWS::ApiGateway::Deployment
  • AWS::ApiGateway::Method
  • AWS::ApiGateway::Model
  • AWS::ApiGateway::Resource
  • AWS::ApiGateway::RestApi
  • AWS::ApiGateway::Stage
  • AWS::ApiGateway::UsagePlan
  • AWS::ApiGateway::UsagePlanKey
  • AWS::ApplicationAutoScaling::ScalableTarget
  • AWS::ApplicationAutoScaling::ScalingPolicy
  • AWS::AutoScaling::AutoScalingGroup
  • AWS::AutoScaling::LaunchConfiguration
  • AWS::AutoScaling::ScalingPolicy
  • AWS::Batch::ComputeEnvironment
  • AWS::Batch::JobDefinition
  • AWS::Batch::JobQueue
  • AWS::CloudFormation::CustomResource
  • AWS::CloudFormation::Stack
  • AWS::CloudFormation::WaitCondition
  • AWS::CloudFormation::WaitConditionHandle
  • AWS::CloudFront::Distribution
  • AWS::CloudTrail::Trail
  • AWS::CloudWatch::Alarm::ComparisonOperator
  • AWS::CloudWatch::Alarm::Dimension
  • AWS::CloudWatch::Alarm::Namespace
  • AWS::CloudWatch::Alarm::Statistic
  • AWS::CloudWatch::Alarm::Unit
  • AWS::CloudWatch::Alarm
  • AWS::CodeBuild::Project
  • AWS::CodeCommit::Repository
  • AWS::CodePipeline::CustomActionType
  • AWS::CodePipeline::Pipeline
  • AWS::DataPipeline::Pipeline
  • AWS::DynamoDB::Table
  • AWS::EC2::CustomerGateway
  • AWS::EC2::EIP
  • AWS::EC2::EIPAssociation
  • AWS::EC2::Instance
  • AWS::EC2::InternetGateway
  • AWS::EC2::KeyPair::KeyName
  • AWS::EC2::NatGateway
  • AWS::EC2::NetworkAcl
  • AWS::EC2::NetworkAclEntry
  • AWS::EC2::Route
  • AWS::EC2::RouteTable
  • AWS::EC2::SecurityGroup
  • AWS::EC2::SecurityGroupEgress
  • AWS::EC2::SecurityGroupIngress
  • AWS::EC2::Subnet
  • AWS::EC2::SubnetNetworkAclAssociation
  • AWS::EC2::SubnetRouteTableAssociation
  • AWS::EC2::VPC
  • AWS::EC2::VPCEndpoint
  • AWS::EC2::VPCGatewayAttachment
  • AWS::EC2::VPCPeeringConnection
  • AWS::EC2::VPNConnection
  • AWS::EC2::VPNConnectionRoute
  • AWS::EC2::VPNGateway
  • AWS::EC2::Volume
  • AWS::EC2::VolumeAttachment
  • AWS::ECR::Repository
  • AWS::ECS::Cluster
  • AWS::ECS::Service
  • AWS::ECS::TaskDefinition
  • AWS::EFS::FileSystem
  • AWS::EFS::MountTarget
  • AWS::EKS::Cluster
  • AWS::EMR::Cluster
  • AWS::EMR::Step
  • AWS::ElastiCache::CacheCluster
  • AWS::ElastiCache::SubnetGroup
  • AWS::ElasticBeanstalk::Application
  • AWS::ElasticBeanstalk::ApplicationVersion
  • AWS::ElasticBeanstalk::ConfigurationTemplate
  • AWS::ElasticBeanstalk::Environment
  • AWS::ElasticLoadBalancing::LoadBalancer
  • AWS::ElasticLoadBalancingV2::Listener
  • AWS::ElasticLoadBalancingV2::ListenerRule
  • AWS::ElasticLoadBalancingV2::LoadBalancer
  • AWS::ElasticLoadBalancingV2::TargetGroup
  • AWS::Elasticsearch::Domain
  • AWS::Events::Rule
  • AWS::IAM::AccessKey
  • AWS::IAM::Group
  • AWS::IAM::InstanceProfile
  • AWS::IAM::ManagedPolicy
  • AWS::IAM::Policy
  • AWS::IAM::Role
  • AWS::IAM::User
  • AWS::KMS::Alias
  • AWS::KMS::Key
  • AWS::Kinesis::Stream
  • AWS::KinesisFirehose::DeliveryStream
  • AWS::Lambda::Alias
  • AWS::Lambda::EventSourceMapping
  • AWS::Lambda::Function
  • AWS::Lambda::Permission
  • AWS::Lambda::Version
  • AWS::Logs::Destination
  • AWS::Logs::LogGroup
  • AWS::Logs::LogStream
  • AWS::Logs::MetricFilter
  • AWS::Logs::SubscriptionFilter
  • AWS::RDS::DBInstance::Engine
  • AWS::RDS::DBInstance::LicenseModel
  • AWS::RDS::DBInstance::StorageType
  • AWS::RDS::DBInstance
  • AWS::RDS::DBParameterGroup
  • AWS::RDS::DBSecurityGroup
  • AWS::RDS::DBSubnetGroup
  • AWS::Redshift::Cluster
  • AWS::Redshift::ClusterParameterGroup (along with helper RedshiftClusterParameter type)
  • AWS::Redshift::ClusterSecurityGroup
  • AWS::Redshift::ClusterSecurityGroupIngress
  • AWS::Redshift::ClusterSubnetGroup
  • AWS::Route53::HostedZone
  • AWS::Route53::RecordSet
  • AWS::S3::Bucket
  • AWS::S3::BucketPolicy
  • AWS::SNS::Subscription
  • AWS::SNS::Topic
  • AWS::SNS::TopicPolicy
  • AWS::SQS::Queue
  • AWS::SQS::QueuePolicy
  • AWS::SSM::Association
  • AWS::SSM::Document
  • AWS::SSM::Parameter
  • AWS::SecretsManager::ResourcePolicy
  • AWS::SecretsManager::RotationSchedule
  • AWS::SecretsManager::Secret
  • AWS::SecretsManager::SecretTargetAttachment

Custom types

This project packages certain useful custom CloudFormation types. These are Lambda backed types that perform tasks that CloudFormation does not natively support. In order to use them, you must upload the Lambda function to your account and region. The code for these functions is found in this repo under assets/custom-types.

Remote Route 53 entries

A given domain (or hosted zone, more specifically) must be managed out of a single AWS account. This poses problems if you want to create resources under that domain in templates that will run out of other accounts. A CloudFormation template can only work in one given account. However, with Cloud Formation's custom type functionality, we use custom code to assume a role in the account that owns the hosted zone. This requires some setup steps for each hosted zone and each account. For instructions, please see: https://github.com/bayer-group/cloudformation-template-generator/blob/master/assets/custom-types/remote-route53/README.md for more.

Working with Cloudformation Concatenating

In the CloudFormation DSL, there is support for concatenating strings, parameters, and function calls together to build strings. This can get really ugly as they are chained together. There is a string interpolator to make this easier.

Update 11/17/2016: While we are not deprecating this functionality at this time, CFTG now supports Fn::Sub, a native way to do something very similar. It can replace both Fn::Join and many uses of Fn::GetAtt. Read more here.

Releasing

Make sure the changes for the release are included in CHANGELOG.md.

This project uses the sbt release plugin. After the changes you want to release are committed on the master branch, you simple need to run two commands to publish the library and its documentation.

sbt release
sbt ghpagesPushSite

After publishing, create a new release under Github releases, copying the portion of the change log for this release from CHANGELOG.md.

More Repositories

1

etcd-aws-cluster

A container to assist in managing a etcd2 cluster from an Amazon auto scaling group
Shell
202
star
2

paquo

PAthological QUpath Obsession - QuPath and Python conversations
Python
100
star
3

tiffslide

TiffSlide - cloud native openslide-python replacement based on tifffile
Python
79
star
4

ol-kit

Easy to use, open source React/Openlayers geospatial component toolkit.
JavaScript
73
star
5

goldengate-kafka-adapter

An adapter for Oracle GoldenGate to push change capture data directly to an Apache Kafka cluster
Java
54
star
6

stax

AWS CloudFormation stack manager
Shell
49
star
7

column-resizer

Adds resizable columns to tables
JavaScript
45
star
8

stoop

Monadic Scala API for CouchDB
Scala
44
star
9

COLID-Documentation

The documentation repository is part of the Corporate Linked Data Catalog - short: COLID - application.
HTML
43
star
10

xsmiles

Visualize atom and non-atom attributions and SMILES strings
TypeScript
41
star
11

kamon-prometheus

A Kamon backend to support Prometheus
HTML
38
star
12

cellenium

Cellenium is a FAIR and scalable interactive visual analytics app for scRNA-Seq data (single-cell RNA sequencing).
Jupyter Notebook
26
star
13

cf-metrics

Shell
22
star
14

sas2r

Clinical trial data analytic recipes in R for SAS users
R
21
star
15

velocity-dashboard

React dashboard component
JavaScript
19
star
16

spray-kamon-metrics

Better Kamon metrics for Spray services
HTML
19
star
17

aws2scala

An idiomatic Scala wrapper of the AWS SDK with both asynchronous and streaming clients.
Scala
19
star
18

BayerCLAW

BayerCLAW workflow orchestration system for AWS
Python
18
star
19

pado

PAthological Data Obsession - cloud native digital pathology datasets
Python
17
star
20

mwundo

GeoJSON object, spray-json formats, and basic Geo/Geometry
Scala
17
star
21

eqgat

Research repository for the proposed equivariant graph attention network that operates on large biomolecules proposed by Le et al. (2022)
Python
17
star
22

docker-min-jessie

Minimally sized Debian Jessie build
17
star
23

COLID-Setup

The setup repository is part of the Corporate Linked Data Catalog - short: COLID - application. It helps setting up a local environment based on Docker Compose.
Shell
15
star
24

pybalance

A library for minimizing the effects of confounding covariates
Jupyter Notebook
13
star
25

solvmate

Python
12
star
26

xsmiles-jupyterlab

A JupyterLab plugin implementing the XSMILES visualization
TypeScript
11
star
27

cf-users

Application to manage users and privileges in Cloud Foundry.
CoffeeScript
9
star
28

mocka

Mocka is a mocking and stubbing package written for the Go programming language.
Go
9
star
29

COLID-Data-Marketplace-Frontend

The Data Marketplace frontend repository is part of the Corporate Linked Data Catalog - short: COLID - application. Users can search for registered resources in COLID. It provides a search bar, aggregation filters and search result displaying including term highlighting.
TypeScript
9
star
30

mlr-xai-selfies

Python
8
star
31

go-workshop

Structured hands-on workshop for learning Go
Go
8
star
32

GeospatialSwift

Geospatial swift framework for GeoJson with geohashing, calculations, and much more
Swift
8
star
33

text-to-sql-epi-ehr-naacl2024

Code for Retrieval augmented text-to-SQL generation for epidemiological question answering using electronic health records
Python
8
star
34

giae

Implementation of the Paper "Unsupervised Learning of Group Invariant and Equivariant Representations" presented at NeurIPS 2022.
Jupyter Notebook
7
star
35

chinese-restaurant-process

Highly optimized Scala implementation of Chinese Restaurant Process based non-parametric Bayesian clustering
Scala
7
star
36

CPMolGAN

HTML
6
star
37

xtars-naacl2022

Zero/few-shot learning for classification with very large label sets and long-tailed distribution of labels in data points
Python
6
star
38

COLID-Editor-Frontend

The editor frontend repository is part of the Corporate Linked Data Catalog - short: COLID - application. It offers user an metadata based user interface to register resources in COLID.
TypeScript
6
star
39

BIC-BReasy

R
6
star
40

MOCCA

Python
6
star
41

Parrot

Parrot is a compile-time Mock Generator for Swift - written completely in Swift. It's geared towards use in Xcode and works for any kind of swift project (e.g. server side, iOS, or command line tools). The mock structure is modeled off of the sinon.js APIs
Swift
6
star
42

simple-spray

Simple Spray Application Demo
Scala
5
star
43

COLID-AppData-Service

The appdata service repository is part of the Corporate Linked Data Catalog - short: COLID - application. It maintains the user data and application settings.
C#
5
star
44

Github-Enterprise-Org-Explorer

CoffeeScript
5
star
45

react-color-a11y

React higher-order component to automatically enforce color accessibility
TypeScript
5
star
46

geostyler-geoserver-sld-parser

GeoStyler-Geoserver-Style-Parser implementation for SLD
TypeScript
5
star
47

passport-ping-oauth2

Ping OAuth 2.0 authentication strategy for Passport.
JavaScript
5
star
48

COLID-Reporting-Service

The reporting service repository is part of the Corporate Linked Data Catalog - short: COLID - application. It offers an API for statistics of registered resources.
C#
5
star
49

xBCF

Predicting BCF values with explanations
Python
5
star
50

COLID-Search-Service

The search service repository is part of the Corporate Linked Data Catalog - short: COLID - application. It makes the data findable and provides indexing and search functionalities based on Elasticsearch.
C#
5
star
51

COLID-Indexing-Crawler-Service

The Indexing Crawler Service (ICS) repository is part of the Corporate Linked Data Catalog - short: COLID - application. It is responsible to extract data from a RDF storage system, transform and enrich the data and finally to send it via a message queue to the DMP Webservice for indexing.
C#
5
star
52

pavo

PAthological Visualization Obsession - visualization playground for pado datasets
Python
5
star
53

prom-cf-sd

Go
4
star
54

GeospatialKit

Geospatial iOS framework for GeoJson with mapping, imaging, and everything from GeospatialSwift
Swift
4
star
55

glass-key

This is a common library which supports Play and Spray communicating as clients and resources for OAuth2.
Scala
4
star
56

open-nucleotides

Deep Learning Models Recognizing Genomic Regulatory Code
Python
4
star
57

fRegGAN

Python
4
star
58

atomic-spinner

Customizable React loading spinner that looks like an atom
TypeScript
4
star
59

express-client-validator

An express middleware to validate route clients
CoffeeScript
4
star
60

COLID-Scheduler-Service

The scheduler service repository is part of the Corporate Linked Data Catalog - short: COLID - application. It sets up recurring jobs for user notifications and analytics.
C#
4
star
61

COLID-Registration-Service

The registration service repository is part of the Corporate Linked Data Catalog - short: COLID - application. It is the central microservice to register resources in the triplestore.
C#
4
star
62

mitochondrial-tox

Supporting information from "Predicting the Mitochondrial Toxicity of Small Molecules: Insights From Mechanistic Assays and Cell Painting Data" by Marina Garcia de Lomana, Paula Andrea Marin Zapata, and Floriane Montanari
Jupyter Notebook
4
star
63

logstash-configs

Logstash config files
3
star
64

BIC-DetectoR

R
3
star
65

python-concentriq

Python
3
star
66

r-cytoscape.js

An HTMLWidgets package for CytoscapeJS which can be used to produce standalone figure or for embedding in Shiny applications.
JavaScript
3
star
67

xtbf

Python
2
star
68

Newick2Network

A Python tool to convert Newick trees to Cytoscape compatible networks
Python
2
star
69

passport-gigya-oauth2

Gigya OAuth 2.0 authentication strategy for Passport.
JavaScript
2
star
70

algebraic-datatypes

Blog companion code
Scala
2
star
71

TimberSwift

A message forwarding framework for sending logs, analytics, performance, network activity, and other messages to the Parent Application
Swift
2
star
72

cdst

cdst
Jupyter Notebook
2
star
73

cf-portal

JavaScript
2
star
74

BIC-AdEPro

R
2
star
75

scenarion

A scenario testing package that helps reveal learned relationships between features and the variables they're meant to predict. Use: 1) Build your classification/regression model using SciKit-Learn, keras, or otherwise, 2) pass your model over to Scenarion for scenario testing and visualization of results.
Jupyter Notebook
2
star
76

KGE-Frontend

TypeScript
1
star
77

WaterBase

R
1
star
78

torch_cddd

Python
1
star
79

VCG-resampling

preparation for moving open source submission https://github.com/bayer-int/bayer-open-source-submissions/issues/31
1
star
80

httpbin

A simple docker container running httpbin
1
star
81

fleet-client

A Scala client for the fleet API
Scala
1
star
82

standards

Standards for contributing to MonsantoCo open source projects
1
star
83

PISA-T

Python
1
star
84

MOCCA-frontend

Python
1
star
85

BadranEtAl2015

Analysis scripts for Badran et al 2015
R
1
star
86

terraform-aws-autoken

🔒 GitHub Action for short lived credentials to access resources in CI/CD
TypeScript
1
star
87

GCDPrjct

R
1
star
88

BIC-subscreen

R
1
star
89

BIC-megaplots

R
1
star