Commit graph

910 commits

Author SHA1 Message Date
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 d23d3a5f87 Add the instance maps to the AWS library
For now, this makes the demo nicer; eventually, we probably want
to consider factoring this out into a separate "awsutils" package.
2017-03-15 19:54:29 -07:00
joeduffy 5d14430121 Don't count replacement steps unless explicitly requested 2017-03-15 16:56:23 -07:00
joeduffy 015730e9a9 Fix a bogus unchanged lookup
We need to look for the "old" resource, not the "new" one, when verifying
an assertion that a dependency that is seemingly unchanged actually is.
2017-03-15 16:46:07 -07:00
joeduffy 432105d627 Add an enum union type for AWS instance types 2017-03-15 16:12:24 -07:00
joeduffy e091bde692 Add a plan command; move env destroy to just destroy
This change adds a `coco plan` command which is simply a shortcut
to the more verbose `coco deploy --dry-run`.  This will make demos
flow nicer and elevates planning, an important activity, to a more
prominent position.  The `--dry-run` (aka `-n`) flag is still there.

This change also renames `coco env destroy` to just `coco destroy`.
This is consistent with deploy and plan being at the top-level.  We
now use `coco env` purely for evironment management commands (init,
config, rm, etc).
2017-03-15 15:40:06 -07:00
joeduffy 913201fc51 Add optional formatting to the diag.Message API 2017-03-15 12:16:56 -07:00
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