Commit graph

900 commits

Author SHA1 Message Date
joeduffy
fe1a32c086 Eliminate "fatal" from basic error messages
The word "fatal" makes it look like Coconut did something wrong, when in fact,
these messages are used to convey mis-usage of the command/argument/etc.
2017-03-15 12:16:17 -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
ed307ed00e Fix a bunch of typos
A bunch of types crept in.  Thanks @sonerterek!
2017-03-13 10:51:21 -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
90d3d4dd80 Only queue up analyzers if !delete 2017-03-13 07:07:50 -07:00
joeduffy
bd7b33e714 Fix a typo 2017-03-13 07:00:54 -07:00
joeduffy
80d19d4f0b Use the object mapper to reduce provider boilerplate
This changes the object mapper infrastructure to offer more fine-grained
reporting of errors, and control over verification, during the mapping from
an untyped payload to a typed one.  As a result, we can eliminate a bit of
the explicit unmarshaling goo in the AWS providers (but not all of it; I'm
sure there is more we can, and should, be doing here...)
2017-03-12 14:13:44 -07:00
joeduffy
4e1d0d05b0 Fix a typo in the docs 2017-03-11 10:53:58 -08:00
joeduffy
5dc252053a Fix a slight diffing formatting bug 2017-03-11 10:43:42 -08: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
705880cb7f Add the ability to specify analyzers
This change adds the ability to specify analyzers in two ways:

1) By listing them in the project file, for example:

        analyzers:
            - acmecorp/security
            - acmecorp/gitflow

2) By explicitly listing them on the CLI, as a "one off":

        $ coco deploy <env> \
            --analyzer=acmecorp/security \
            --analyzer=acmecorp/gitflow

This closes out pulumi/coconut#119.
2017-03-11 10:07:34 -08:00
joeduffy
b4b4d26844 Add pkg/util/rpcutil to cut down on some plugin boilerplate
This change eliminates some of the boilerplate required to create a
new plugin; mostly this is gRPC-related code.
2017-03-11 09:23:09 -08:00
joeduffy
c36bb75653 Simplify the library README 2017-03-11 09:01:33 -08:00
joeduffy
45064d6299 Add basic analyzer support
This change introduces the basic requirements for analyzers, as per
pulumi/coconut#119.  In particular, an analyzer can implement either,
or both, of the RPC methods, Analyze and AnalyzeResource.  The former
is meant to check an overall deployment (e.g., to ensure it has been
signed off on) and the latter is to check individual resources (e.g.,
to ensure properties of them are correct, such as checking style,
security, etc. rules).  These run simultaneous to overall checking.

Analyzers are loaded as plugins just like providers are.  The difference
is mainly in their naming ("analyzer-" prefix, rather than "resource-"),
and the RPC methods that they support.

This isn't 100% functional since we need a way to specify at the CLI
that a particular analyzer should be run, in addition to a way of
recording which analyzers certain projects should use in their manifests.
2017-03-10 23:49:17 -08:00
joeduffy
78407a7477 Check AMI validity
This change checks that the AMI referenced in an instance provisioning
is valid.  If not, the deployment is rejected before even trying.  This
is part of pulumi/coconut#115.
2017-03-10 22:34:25 -08:00
joeduffy
bbd76996fa Add a shout-out to pulumi/coconut#54 2017-03-10 22:15:58 -08:00
joeduffy
efd8065e97 Add some warnings to out-of-date docs 2017-03-10 22:03:50 -08:00
joeduffy
3b730211d6 Revamp the packages design document 2017-03-10 21:57:33 -08:00
joeduffy
374bcbe4d4 Tidy up the graphs design note 2017-03-10 21:13:08 -08:00
joeduffy
758ec2976b Fix a typo 2017-03-10 20:49:59 -08:00
joeduffy
807d355d5a Rename plugin prefix from coco-ressrv to coco-resource 2017-03-10 20:48:09 -08:00
joeduffy
6530eda346 Update the resources document 2017-03-10 20:45:23 -08:00
joeduffy
75ad4b4160 Overhaul the deps document 2017-03-10 20:19:05 -08:00
joeduffy
f674d24ac7 Fix a src/dst mixup 2017-03-10 20:00:11 -08:00
joeduffy
4ca8ac9b8d Add a missing ` 2017-03-10 19:57:59 -08:00
joeduffy
6924e71861 Add more sample code 2017-03-10 19:36:45 -08:00
joeduffy
8670fd42a6 Merge branch 'master' of github.com:pulumi/coconut 2017-03-10 14:47:49 -08:00
joeduffy
8233357d5b Tidy up the formats document 2017-03-10 14:43:34 -08:00
Eric Rudder
f32430cabd slight wording changes and WS edit 2017-03-10 13:50:55 -08:00
joeduffy
384e347115 No more nuts! 2017-03-10 13:27:19 -08:00
joeduffy
361eb62e7b Move coco env deploy to the top-level, coco deploy
Deployments are central to the entire system; although technically
a deployment is indeed associated with an environment, the deployment
is the focus, not the environment, so it makes sense to put the
deployment command at the top-level.

Before, you'd say:

    $ coco env deploy production

And now, you will say:

    $ coco deploy production
2017-03-10 13:17:55 -08:00
joeduffy
9bf279ceae Overhaul the overview document
This change brings the overview doc up to date with respect to the
changes we've made recently.
2017-03-10 13:14:32 -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
e3e62e55b2 Fix install scripts to use coco pack verify 2017-03-10 09:37:16 -08:00
joeduffy
08c1b10e75 Fix some CocoJS runtime issues
This change fixes up a handful of CocoJS runtime issues preventing
it from compiling; we aren't using much of this yet, but I hope to
resurrect it soon (so more legal ECMAScript code can run).
2017-03-10 09:35:52 -08:00
joeduffy
e2c68daae5 Fix named import references
This change fixes named import references of the style

    import {foo} from "bar";
    ...foo...;

Previously, we incorrectly assumed all naked variables of the sort
referred to members inside of the current module.  Instead, we can
just refer to the existing logic that will use the bound symbol to
resolve the fully resolved module reference.
2017-03-09 16:23:42 +00:00
joeduffy
15ffa4141f Rename CocoJS's Nut* test files to Coconut* 2017-03-09 16:21:46 +00:00
joeduffy
7e68e47e9d Implement NonNullExpressions in CocoJS
This is there for static typechecking, and so we can safely erase it.
2017-03-09 16:02:54 +00:00
joeduffy
783f9534c8 Add the ability to specify and env config during eval
This adds the --config-env flag which can be used to apply configuration
before performing evaluation of a package.
2017-03-09 15:52:50 +00:00
joeduffy
cbf5407a53 Print results only if non-nil, during eval 2017-03-09 15:45:24 +00:00
joeduffy
bfee271087 Rename the coco nut command to coco pack 2017-03-09 15:43:28 +00:00
joeduffy
9f524e4c8c Organize all package management commands
This change organizes all package management commands underneath
the top-level subcommand `nut`; so, for example:

    $ nut get ...
    $ nut eval ...
    and so on
2017-03-08 11:41:13 +00:00
joeduffy
3b3b56a836 Properly reap child processes
This change reaps child plugin processes before exiting.  It also hardens
some of the exit paths to avoid os.Exiting from the middle of a callstack.
2017-03-07 13:47:42 +00:00
joeduffy
d94f9d4768 Implement a very basic env config command
This change implements a very basic `coco env config` command, that
lets you read, set, or unset configuration values for an environment.

For a single environment, these four usage styles are supported:

    # query all values in a given environment <env>:
    $ coco env config <env>

    # query a single value with key <key> in a given environment <env>:
    $ coco env config <env> <key>

    # set a single value with key <key> and value <value> in <env>:
    $ coco env config <env> <key> <value>

    # unset a single value with key <key> in the environment <env>:
    $ coco env config <env> <key> --unset

This is a vast subset of pulumi/coconut#113.
2017-03-06 15:07:24 +00: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
5318d5af57 Merge branch 'master' of github.com:pulumi/coconut 2017-03-06 14:20:34 +00:00
joeduffy
800f3dd388 Eliminate superfluous copy of ec2instance 2017-03-06 13:04:25 +00:00