Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(decdk) prototype for declarative CDK (decdk) #1618

Merged
merged 47 commits into from
Feb 13, 2019
Merged

Commits on Jan 25, 2019

  1. We can now generate JSON schema

    Rico Huijbers committed Jan 25, 2019
    Configuration menu
    Copy the full SHA
    2b42350 View commit details
    Browse the repository at this point in the history

Commits on Jan 26, 2019

  1. We can hydrate a CdkFormation model now

    Rico Huijbers committed Jan 26, 2019
    Configuration menu
    Copy the full SHA
    275ae10 View commit details
    Browse the repository at this point in the history
  2. Add cdk.json

    Rico Huijbers committed Jan 26, 2019
    Configuration menu
    Copy the full SHA
    5d0141c View commit details
    Browse the repository at this point in the history

Commits on Jan 27, 2019

  1. self-contained

    turn decdk to a self-contained transformer which depends on all cdk
    libraries to simplify usage.
    
    theoretically we would have been able to split decdk and the dependency
    closure, but keeping them monolithic right now is easier to work with
    and takes care of some issues related to resolving modules
    in client packages (e.g. we need to resolve transitive modules and
    that's annoying).
    Elad Ben-Israel committed Jan 27, 2019
    Configuration menu
    Copy the full SHA
    1e1d6c2 View commit details
    Browse the repository at this point in the history
  2. schema generation improvements

    - support enums
    - inherit interface members
    - use normal jsii FQNs for package names to keep things simple
    Elad Ben-Israel committed Jan 27, 2019
    Configuration menu
    Copy the full SHA
    f7a10c5 View commit details
    Browse the repository at this point in the history
  3. expand serializable set by ignoring optional non-serializable props

    if an interface has non-serializable properties but they are
    optional, we can technically allow users to use the construct
    with the default value. this dramatically expands the set of
    available deconstructs.
    Elad Ben-Israel committed Jan 27, 2019
    Configuration menu
    Copy the full SHA
    2780f90 View commit details
    Browse the repository at this point in the history
  4. use type info during deserialization

    - performs type checking
    - allows deserializing enums
    - in the future will allow deserializing IBucket-like objects
    -
    Elad Ben-Israel committed Jan 27, 2019
    Configuration menu
    Copy the full SHA
    f201e9b View commit details
    Browse the repository at this point in the history
  5. support Fn::GetAtt for resources and constructs

    if we see an Fn::GetAtt, we replace it with a synth-time lazy value
    which will resolve according to what is referenced.
    
    if GetAtt references a high level construct, the resolved value will
    be the value returned by a named property. otherwise, we just retain
    the original Fn::GetAtt.
    
    at the moment, this is only supported for strings.
    Elad Ben-Israel committed Jan 27, 2019
    Configuration menu
    Copy the full SHA
    f650a36 View commit details
    Browse the repository at this point in the history
  6. apigateway: resourceForPath

    a new "resourceForPath(path)" method will get or create all
    the resources leading to a certain path in the api model.
    
    this can be used to easily define "routes" in the api and
    reuse the nodes in the tree.
    
    includes a refactor of how the root resource and normal resources
    share implementation (through an abstract base class, dah!)
    Elad Ben-Israel committed Jan 27, 2019
    Configuration menu
    Copy the full SHA
    a00ce86 View commit details
    Browse the repository at this point in the history
  7. lambda: ApiEventSource

    the ApiEventSource allows easily adding APIGW routes to a Lambda.
    upon first call, a new REST API resource will be created, and then
    routes will be added to it for each ApiEventSource associated 
    with the lambda.
    Elad Ben-Israel committed Jan 27, 2019
    Configuration menu
    Copy the full SHA
    d3e9d07 View commit details
    Browse the repository at this point in the history
  8. serverless: Function

    initial implementation for a declarative surface for serverless
    functions, which is based on the SAM spec. the main difference
    between this API and the Lambda API is that this allows defining
    event sources declaratively when the function is initialized.
    Elad Ben-Israel committed Jan 27, 2019
    Configuration menu
    Copy the full SHA
    a8deea8 View commit details
    Browse the repository at this point in the history
  9. more declarative examples

    - ECS/Fargate: one resource that synthesizes 38
    - Queue with KMS encryption with auto-created key
    - SAM API events + dynamo table + GetAtt in Outputs
    - SAM with Queues: shows GetAtt for both resource and construct
    
    A script "./synth" instead of cdk.json
    Elad Ben-Israel committed Jan 27, 2019
    Configuration menu
    Copy the full SHA
    63803e4 View commit details
    Browse the repository at this point in the history
  10. support construct properties with references

    If a construct has a property that references another
    construct, users can now use {Ref} to reference a construct
    of that type that was defined in the same template.
    
    The schema will only allow { Ref: ID }
    Elad Ben-Israel committed Jan 27, 2019
    Configuration menu
    Copy the full SHA
    c72ee74 View commit details
    Browse the repository at this point in the history
  11. print warnings when constructs are not serializable

    Elad Ben-Israel committed Jan 27, 2019
    Configuration menu
    Copy the full SHA
    272b9e9 View commit details
    Browse the repository at this point in the history
  12. deconstructing enum-like classes

    Classes that have static methods/properties that return
    a type that matches the class type can be considered "enum-like"
    because they can be used like so:
    
        lambda.Runtime.NodeJS10
    
    or:
    
        lambda.Code.asset('path')
    
    We are now deconstructing these to either a string (for the property
    case) or an object where the key is the method name and the value
    is an map of parameter names to values.
    
    This is actually something we can probably embed in the jsii spec,
    as it is a common pattern.
    Elad Ben-Israel committed Jan 27, 2019
    Configuration menu
    Copy the full SHA
    39bb01a View commit details
    Browse the repository at this point in the history
  13. ecs: make ContainerImage an enum-like class

    To enable deconstruction, turn ContainerImage to an enum-like class. This means that the "image" property needs to accept a concrete class instead of an interface. Seems like this won't hurt the model in any way.
    Elad Ben-Israel committed Jan 27, 2019
    Configuration menu
    Copy the full SHA
    f3910b8 View commit details
    Browse the repository at this point in the history
  14. ecs: fix ctor signature of ContainerDefinition

    in order to be able to deconstruct this, we expect ctors to have only three arguments: scope,id,props.
    
    split ContainerDefinitionOptions from ContainerDefinitionProps to allow
    reusing them in `addContainer`.
    
    also, move the logic of "linking" the container to the task definition
    into the ContainerDefinition class, so that "addContainer" is pure
    sugar and doesn't have special behavior. otherwise, we won't be able
    to use it declaratively.
    Elad Ben-Israel committed Jan 27, 2019
    Configuration menu
    Copy the full SHA
    1061c97 View commit details
    Browse the repository at this point in the history
  15. add a few more declarative examples

    - ecs
    - lambda
    - pipelines(!)
    Elad Ben-Israel committed Jan 27, 2019
    Configuration menu
    Copy the full SHA
    eb8859b View commit details
    Browse the repository at this point in the history
  16. allow Fn::GetAtt to be used for object refs too

    Elad Ben-Israel committed Jan 27, 2019
    Configuration menu
    Copy the full SHA
    701e243 View commit details
    Browse the repository at this point in the history

Commits on Jan 30, 2019

  1. feat(aws-lambda): specify event sources upon initialization

    Elad Ben-Israel committed Jan 30, 2019
    Configuration menu
    Copy the full SHA
    2fe18db View commit details
    Browse the repository at this point in the history
  2. fix(dynamodb): require partitionKey

    A partition key is a required property of DynamoDB.
    
    BREAKING CHANGE: partitionKey is now required when defining a DynamoDB table. the method "addPartitionKey" has been removed.
    Elad Ben-Israel committed Jan 30, 2019
    Configuration menu
    Copy the full SHA
    5399145 View commit details
    Browse the repository at this point in the history
  3. feat(dynamodb): SimpleTable

    add SimpleTable, which is a DynamoDB table with a default partition
    key of "ID: string".
    
    SimpleTable extends from Table and support all features.
    Elad Ben-Israel committed Jan 30, 2019
    Configuration menu
    Copy the full SHA
    a208519 View commit details
    Browse the repository at this point in the history
  4. decdk: support arbitrary classes

    If a property accepts an interface type, deCDK will identify all types
    that implement it and will formulate a JSON schema that allows users
    to instantiate these types.
    
    For example lambda IEventSource:
    
        "events": [
          { 
            "DynamoEventSource": { 
              "table": { "Ref": "Table" }, 
              "props": { "startingPosition": "TrimHorizon" } 
            } 
          },
          { "ApiEventSource": { "method": "GET", "path": "/hello" } },
          { "ApiEventSource": { "method": "POST", "path": "/hello" } },
          { "SnsEventSource": { "topic": { "Ref": "MyTopic" } } }
        ]
    Elad Ben-Israel committed Jan 30, 2019
    Configuration menu
    Copy the full SHA
    1f88881 View commit details
    Browse the repository at this point in the history

Commits on Feb 5, 2019

  1. Merge branch 'master' into offsite/declarative

    Sam Goodwin committed Feb 5, 2019
    Configuration menu
    Copy the full SHA
    20f2ab7 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ae247ae View commit details
    Browse the repository at this point in the history
  3. Fix linting errors

    Sam Goodwin committed Feb 5, 2019
    Configuration menu
    Copy the full SHA
    a1cd517 View commit details
    Browse the repository at this point in the history
  4. improve error reporting by tracking schema context

    prints a nice error tree instead of a flat list
    Elad Ben-Israel committed Feb 5, 2019
    Configuration menu
    Copy the full SHA
    0b94775 View commit details
    Browse the repository at this point in the history
  5. some more examples

    Elad Ben-Israel committed Feb 5, 2019
    Configuration menu
    Copy the full SHA
    7336a69 View commit details
    Browse the repository at this point in the history
  6. basic, initial and insufficient unit test

    Elad Ben-Israel committed Feb 5, 2019
    Configuration menu
    Copy the full SHA
    d2a2618 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    0f87854 View commit details
    Browse the repository at this point in the history

Commits on Feb 7, 2019

  1. misc

    - move examples to tools/decdk
    - rename decdk => decdk-schema
    - rename recdk => decdk
    - initial readme (still wip)
    Elad Ben-Israel committed Feb 7, 2019
    Configuration menu
    Copy the full SHA
    6617a74 View commit details
    Browse the repository at this point in the history

Commits on Feb 11, 2019

  1. Configuration menu
    Copy the full SHA
    2ac9a85 View commit details
    Browse the repository at this point in the history

Commits on Feb 12, 2019

  1. fix foreach script

    Elad Ben-Israel committed Feb 12, 2019
    Configuration menu
    Copy the full SHA
    4098f6b View commit details
    Browse the repository at this point in the history
  2. fix function import

    Elad Ben-Israel committed Feb 12, 2019
    Configuration menu
    Copy the full SHA
    a1ce99b View commit details
    Browse the repository at this point in the history
  3. apigateway: capitalize method names

    and fix "api" event source
    Elad Ben-Israel committed Feb 12, 2019
    Configuration menu
    Copy the full SHA
    c2b219f View commit details
    Browse the repository at this point in the history
  4. fix package.json

    Elad Ben-Israel committed Feb 12, 2019
    Configuration menu
    Copy the full SHA
    e8c9cb9 View commit details
    Browse the repository at this point in the history
  5. remove serverless::function

    Elad Ben-Israel committed Feb 12, 2019
    Configuration menu
    Copy the full SHA
    f65d939 View commit details
    Browse the repository at this point in the history
  6. kwargs + snapshot tests against examples

    Elad Ben-Israel committed Feb 12, 2019
    Configuration menu
    Copy the full SHA
    c9b47fb View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    afac15b View commit details
    Browse the repository at this point in the history
  8. Merge branch 'master' into offsite/declarative

    Elad Ben-Israel authored Feb 12, 2019
    Configuration menu
    Copy the full SHA
    a86d18d View commit details
    Browse the repository at this point in the history

Commits on Feb 13, 2019

  1. Configuration menu
    Copy the full SHA
    e8650e9 View commit details
    Browse the repository at this point in the history
  2. deconstruct kwargs in methods a little differently and respect requir…

    …ed arguments
    Elad Ben-Israel committed Feb 13, 2019
    Configuration menu
    Copy the full SHA
    8ce7e33 View commit details
    Browse the repository at this point in the history
  3. emit schema on build

    Elad Ben-Israel committed Feb 13, 2019
    Configuration menu
    Copy the full SHA
    938f1fe View commit details
    Browse the repository at this point in the history
  4. update ecs and lambda examples

    Elad Ben-Israel committed Feb 13, 2019
    Configuration menu
    Copy the full SHA
    6d7bbee View commit details
    Browse the repository at this point in the history
  5. update readme

    Elad Ben-Israel committed Feb 13, 2019
    Configuration menu
    Copy the full SHA
    fb431e2 View commit details
    Browse the repository at this point in the history
  6. readme updates

    Elad Ben-Israel committed Feb 13, 2019
    Configuration menu
    Copy the full SHA
    1cb7165 View commit details
    Browse the repository at this point in the history
  7. add description in deps.js script + fix typo

    Elad Ben-Israel committed Feb 13, 2019
    Configuration menu
    Copy the full SHA
    8fbdfe3 View commit details
    Browse the repository at this point in the history