Commit graph

69 commits

Author SHA1 Message Date
joeduffy
9c1ea1f161 Fix some poor hygiene
A few linty things crept in; this addresses them.
2017-04-08 07:44:02 -07:00
joeduffy
f0c1100ad6 Add basic web server example in Python 2017-04-03 17:22:37 -07:00
joeduffy
35f46dcdf7 Rename the infosec analyzer to contoso/infosec 2017-03-23 10:38:53 -07:00
joeduffy
2bda2d5b2d Tidy up the webserver example to match slides 2017-03-21 11:02:20 -07:00
joeduffy
98119f917e Rename ACMECorp security analyzer to InfoSec
This changes the example security analyzer from acmecorp/security
to just infosec, to reinforce that we will have certain analyzers
"out of the box" (infosec, cost, etc.)
2017-03-21 10:57:36 -07:00
joeduffy
aee7f0ab92 Make a few minor renames in the webserver example 2017-03-16 09:17:52 -07:00
joeduffy
963df58912 Make a few nice modifications to the webserver example
* Rename the sample from ec2instance to webserver.

* Factor out the AMI map stuff into the AWS library, rather than the sample.

* Strongly type the instance type parameter using the aws.ec2.InstanceType union.

* Add a new webserver-comp example that demonstrates a bit of the ability to do
  encapsulation, componentization, and multi-instantiation.
2017-03-15 19:55:56 -07:00
joeduffy
95f59273c8 Update copyright notices from 2016 to 2017 2017-03-14 19:26:14 -07:00
joeduffy
9e9f38014e Tidy up the ec2instance sample a bit more
And also just use HTTP port 80 to mirror the corresponding AWS docs example.
2017-03-14 04:43:37 -07:00
joeduffy
774ed45ccc Add an example cpuwatch package
This change includes a simple cpuwatch package, as a demonstration of
how easy it can be to add CPU-level monitoring to an existing stack.

It contains a single API, enableAlarm, that takes an instance and
CPU % threshold; if the CPU ever exceeds that threshold for a sustained
period of time (3 consecutive minutes), an email will be generated.

To use this, first simply install the package as usual, e.g.

    $ coco pack get cpuwatch

From there, you will need to configure the email address to send to:

    $ coco env config <env> cpuwatch:config:emailAddress joe@pulumi.com

And finally, add an import plus call to enableAlarm for all instances:

    import * as cpuwatch from "cpuwatch";
    ..
    let instance = new aws.ec2.Instance(...);
    cpuwatch.enableAlarm(instance, 90); // email if >90% CPU utilization.

As part of this, I've added the typing projections for the AWS SNS topic
and CloudWatch alarm resource types (but no providers just yet).
2017-03-13 12:26:33 -07:00
joeduffy
30171c9752 Remove port 80 access from the sample 2017-03-13 10:36:37 -07:00
joeduffy
56ffba23c6 Tidy up the sample code 2017-03-13 10:35:40 -07:00
joeduffy
8b8c1931f7 Add a simple ACMECorp security analyzer
This adds a simple ACMECorp security analyzer example.  It doesn't
actually do anything other than reject any AWS EC2 instance, claiming
it is vulnerable.  Eventually we should do something smart.
2017-03-11 10:09:11 -08:00
joeduffy
384e347115 No more nuts! 2017-03-10 13:27:19 -08:00
joeduffy
cfd06083f5 Add a basic Riffmart sample
This checks in part of the Riffmart sample.

warning: this is a work-in-progress, and is incomplete.
2017-03-10 09:49:20 -08:00
joeduffy
86dc13ed5b More term rotations
This changes a few naming things:

* Rename "husk" to "environment" (`coco env` for short).

* Rename NutPack/NutIL to CocoPack/CocoIL.

* Rename the primary Nut.yaml/json project file to Coconut.yaml/json.

* Rename the compiled Nutpack.yaml/json file to Cocopack.yaml/json.

* Rename the package asset directory from nutpack/ to .coconut/.
2017-03-06 14:32:39 +00:00
joeduffy
800f3dd388 Eliminate superfluous copy of ec2instance 2017-03-06 13:04:25 +00:00
joeduffy
954fd9ae78 Use real configuration in ec2instance example
This change eliminates the hard-coded region from the ec2instance
example, and instead uses the new `aws.config.region` configuration
variable.  This makes the code more amenable to multi-instancing.
2017-02-28 16:14:18 -08:00
joeduffy
977b16b2cc Add basic targeting capability
This change partially implements pulumi/coconut#94, by adding the
ability to name targets during creation and reuse those names during
deletion and update.  This simplifies the management of deployment
records, checkpoints, and snapshots.

I've opted to call these things "husks" (perhaps going overboard with
joy after our recent renaming).  The basic idea is that for any
executable Nut that will be deployed, you have a nutpack/ directory
whose layout looks roughly as follows:

    nutpack/
        bin/
            Nutpack.json
            ... any other compiled artifacts ...
        husks/
            ... one snapshot per husk ...

For example, if we had a stage and prod husk, we would have:

    nutpack/
        bin/...
        husks/
            prod.json
            stage.json

In the prod.json and stage.json files, we'd have the most recent
deployment record for that environment.  These would presumably get
checked in and versioned along with the overall Nut, so that we
can use Git history for rollbacks, etc.

The create, update, and delete commands look in the right place for
these files automatically, so you don't need to manually supply them.
2017-02-25 09:24:52 -08:00
joeduffy
32379da4f5 Fix a few lingering issues from rename 2017-02-25 07:51:29 -08:00
joeduffy
fbb56ab5df Coconut! 2017-02-25 07:25:33 -08:00
joeduffy
14e3f19437 Implement name property in AWS provider/library 2017-02-24 15:41:56 -08:00
joeduffy
271eaefb5c Fix ec2instance CIDR property 2017-02-23 15:04:07 -08:00
joeduffy
39d2fd4e96 Change mu.Bucket to mu.x.Bucket in Thumbnaile 2017-02-19 09:26:25 -08:00
joeduffy
2e8b04f2a7 Get the minimal AWS sample compiling/verifying/evaluating 2017-02-11 13:33:11 -08:00
joeduffy
0b299f0ae5 Update ec2instance so that it compiles/verifies/evals 2017-02-10 09:10:13 -08:00
joeduffy
c821634761 Restructure the examples
This restructures the examples directory a bit, into three buckets:

* basic/: simplistic examples, like hello world and whatnot.

* conversions/: actual conversions from existing samples (with the source cited).

* scenarios/: more complex examples that demonstrate various features of the system.
2017-02-09 16:07:45 -08:00
joeduffy
e8f54f3f4d Add a minimal MuJS blueprint example 2017-02-09 13:36:18 -08:00
joeduffy
a0de263930 Add a tsconfig to the Thumbnailer example 2017-02-03 12:14:40 -08:00
joeduffy
7854e0d393 Merge branch 'master' of github.com:marapongo/mu 2017-02-03 12:09:56 -08:00
joeduffy
03b065015f Add a missing } 2017-02-03 12:09:48 -08:00
Joe Duffy
dbf86736e1 Move ec2instance example underneath aws/
I just introduced the examples/aws/ directory yesterday to hold some
of our basic AWS examples, as I expect us to start accumulating more
of them.  So this just moves ec2instance underneath that directory.
We should probably think about further reorganizing these (e.g., into
demos/, scenarios/, etc.), ass we accumulate more examples.
2017-02-03 05:38:06 -08:00
Luke Hoban
464bd4fe28 Simple EC2 instance example 2017-02-02 22:03:12 -08:00
joeduffy
e953c68074 Add a minimal AWS VPC blueprint to the examples 2017-02-02 10:53:35 -08:00
joeduffy
d1986910b9 Check in the thumbnailer example from our docs 2017-01-28 11:33:15 -08:00
joeduffy
5374a2e3fa Add a example web crawler Mu blueprint
This adds an example web crawler blueprinted, derived from the AOSA
book's asynchronous I/O coroutines example.
2017-01-12 14:59:18 -08:00
joeduffy
6a23300d21 Reformat example; use "new()" in place of "resources" 2016-12-16 11:15:33 -08:00
joeduffy
284cec204d Experiment with intersection types
This change experiments with using intersection types to cut down
on some of the boilerplate -- and make reuse easier -- in the
service definitions.
2016-12-16 10:04:46 -08:00
joeduffy
ed1eebe7e5 Clean up imports 2016-12-15 19:42:48 -08:00
joeduffy
2e941bbc57 Make an initial attempt at a better factoring
This splits the overall example rack service into many sub-services.
This leads to a much cleaner factoring of the code.  Note that there are
some missing properties -- it's hard to eyeball this without a real compiler.
But the essence of the example is pretty spot on.
2016-12-15 19:40:34 -08:00
joeduffy
68a3d27a73 Use "prop: value" instead of "prop = value"
I personally prefer this syntax.  It is more "declarative" and, particularly
because we support true assignments, I feel like it's more representative of
what's going on.  It's easier to scan for real imperative assignments.  This
approach also eliminates a single horizontal character per assignment.
2016-12-15 17:57:36 -08:00
joeduffy
14471c0ac7 Experiment with different syntax for resource creation
In this change, ":= new" declares a new resource.

In addition, we change arrays to be Go-like, in that zero-initialized
ones can be appended to safely, such that declaring a new instance is
done merely by stating "var arr: T[]".
2016-12-15 17:50:10 -08:00
joeduffy
47e1125f3b Use arrays to cut down on boilerplate
This is all hand-waving, of course, however it's helping with the language design.
2016-12-15 16:58:21 -08:00
joeduffy
5e652c3dd3 Check in the Xovnoc conversion example 2016-12-15 16:40:49 -08:00
joeduffy
46e89084bf Add a hypothetical Echo example 2016-12-14 15:13:17 -08:00
joeduffy
ffae234af0 Add a Mu.yaml to the MongoDB/Twilio example 2016-11-23 16:28:00 -08:00
joeduffy
d55acad652 Add a workspace file to our demo
This just sets the default cloud provider to AWS.
2016-11-22 09:50:53 -08:00
joeduffy
7f712243f7 Demonstrate hypothetical mu/app type in the demo 2016-11-22 08:58:06 -08:00
joeduffy
efe69a2e2c Explicitly declare the demo's dependencies 2016-11-18 16:52:51 -08:00
joeduffy
74ebf36dd0 Update conversion modules to the latest 2016-11-17 05:26:32 -08:00