pulumi/pkg/resource
joeduffy 26cf93f759 Implement get functions on all resources
This change implements the `get` function for resources.  Per pulumi/lumi#83,
this allows Lumi scripts to actually read from the target environment.

For example, we can now look up a SecurityGroup from its ARN:

    let group = aws.ec2.SecurityGroup.get(
        "arn:aws:ec2:us-west-2:153052954103:security-group:sg-02150d79");

The returned object is a fully functional resource object.  So, we can then
link it up with an EC2 instance, for example, in the usual ways:

    let instance = new aws.ec2.Instance(..., {
        securityGroups: [ group ],
    });

This didn't require any changes to the RPC or provider model, since we
already implement the Get function.

There are a few loose ends; two are short term:

    1) URNs are not rehydrated.
    2) Query is not yet implemented.

One is mid-term:

    3) We probably want a URN-based lookup function.  But we will likely
       wait until we tackle pulumi/lumi#109 before adding this.

And one is long term (and subtle):

    4) These amount to I/O and are not repeatable!  A change in the target
       environment may cause a script to generate a different plan
       intermittently.  Most likely we want to apply a different kind of
       deployment "policy" for such scripts.  These are inching towards the
       scripting model of pulumi/lumi#121, which is an entirely different
       beast than the repeatable immutable infrastructure deployments.

Finally, it is worth noting that with this, we have some of the fundamental
underpinnings required to finally tackle "inference" (pulumi/lumi#142).
2017-06-19 17:29:02 -07:00
..
deploy Implement get functions on all resources 2017-06-19 17:29:02 -07:00
environment More progress on pulumi/lumi#90 2017-06-13 07:10:13 -07:00
idl Make updates work in the face of output properties 2017-06-01 10:09:52 -07:00
plugin Merge branch 'master' into bforsyth927-gometalinter 2017-06-13 16:28:12 -07:00
asset.go A few tweaks to lint fixes 2017-06-13 16:47:55 -07:00
config.go Make more progress on the new deployment model 2017-06-13 07:10:13 -07:00
errors.go Simplify Check; make it tolerant of computed values 2017-06-16 13:34:11 -07:00
properties.go Make more progress on the new deployment model 2017-06-13 07:10:13 -07:00
properties_diff.go Make more progress on the new deployment model 2017-06-13 07:10:13 -07:00
properties_diff_test.go Fix pulumi/lumi#198 2017-06-06 16:42:14 -07:00
resource.go Overhaul resources, planning, and environments 2017-06-13 07:10:13 -07:00
resource_id.go Wire up APIs to lambdas using output properties 2017-06-15 16:01:00 -07:00
resource_id_test.go Print the current environment 2017-06-16 09:46:09 -07:00
resource_object.go Implement get functions on all resources 2017-06-19 17:29:02 -07:00
resource_state.go Make more progress on the new deployment model 2017-06-13 07:10:13 -07:00
urn.go Print the current environment 2017-06-16 09:46:09 -07:00
urn_test.go Print the current environment 2017-06-16 09:46:09 -07:00