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

Framework: Tokens can be converted to strings #518

Merged
merged 20 commits into from
Aug 15, 2018

Commits on Aug 7, 2018

  1. Framework: Tokens can be converted to strings

    Tokens (such as resource attributes) can now be implicitly converted
    into strings. Parameters and attributes can now be combined into larger
    strings using the native string facilities of the host language.
    
    The process will be reversed by the resolve() function during synthesis,
    which will split the string up again into string literals and
    CloudFormation intrinsics.
    
    The same transformation is applied during JSON.stringify(), so that
    Tokens in a complex JSON structure are preserved.
    
    Fixes #24 and #168.
    Rico Huijbers committed Aug 7, 2018
    Configuration menu
    Copy the full SHA
    3796389 View commit details
    Browse the repository at this point in the history

Commits on Aug 8, 2018

  1. Remove incorrectly staged custom-resources directory

    Rico Huijbers committed Aug 8, 2018
    Configuration menu
    Copy the full SHA
    9469a71 View commit details
    Browse the repository at this point in the history
  2. WIP

    Rico Huijbers committed Aug 8, 2018
    Configuration menu
    Copy the full SHA
    e47741b View commit details
    Browse the repository at this point in the history
  3. Merge branch 'master' into huijbers/token-stringification

    Rico Huijbers committed Aug 8, 2018
    Configuration menu
    Copy the full SHA
    f6d01a8 View commit details
    Browse the repository at this point in the history
  4. Remove HintedToken, change markers, add quoting

    Rico Huijbers committed Aug 8, 2018
    Configuration menu
    Copy the full SHA
    6e79bb8 View commit details
    Browse the repository at this point in the history

Commits on Aug 9, 2018

  1. Update testing

    Rico Huijbers committed Aug 9, 2018
    Configuration menu
    Copy the full SHA
    a72d14d View commit details
    Browse the repository at this point in the history
  2. WIP

    Rico Huijbers committed Aug 9, 2018
    Configuration menu
    Copy the full SHA
    42becf3 View commit details
    Browse the repository at this point in the history
  3. After a giant slough, reintroducing tokenAwareJsonify()

    MAJOR CHANGES
    
    - Reintroducing tokenAwareJsonify; it needs to be there because
      otherwise we cannot have enough knowledge to do escaping properly;
      see documentation in the code.
    - Introducing markAsIntrinsic() which sets a hidden property on an
      object which is used as a hint to the rest of the engine that
      (a) the value doesn't need to be resolved anymore and (b) we can
      use it as a type hint to reject non-intrinsic complex types during
      stringification. A wrapper class would have been nicer but this
      entails fewer code changes (deepEqual everywhere...). A convenience
      class has been introduced in the CloudFormation section to make
      impact minimal.
    - Implement inversion-of-control on the FnConcat thing, execution
      engines (name?) can now register themselves to handle string
      combining. Still not perfect because if there are not intrinsics
      we can't really guess the engine (so we "default" to CFN anyway)
      but we have the initial trappings of CFN decoupling.
    
    ALSO
    - Add a run config and a helper script to debug a unit test from VSCode
      (breakpoints \o/)
    
    I expect this to generate a healthy amount of debate. Also I would
    appreciate suggestions on naming of the various pieces, I'm afraid
    I haven't been 100% consistent just yet.
    
    - What do we call CloudFormation/Terraform/...?
    - What do we call stringified Tokens?
    Rico Huijbers committed Aug 9, 2018
    Configuration menu
    Copy the full SHA
    1b60e45 View commit details
    Browse the repository at this point in the history
  4. Make CloudWatch use tokenAwareJsonify again

    Rico Huijbers committed Aug 9, 2018
    Configuration menu
    Copy the full SHA
    d1fc358 View commit details
    Browse the repository at this point in the history

Commits on Aug 13, 2018

  1. Reorganized code

    Changed tokenAwareJsonify() -> TokenJSON.stringify() to mimic
    JSON.stringify() API name. Implementation does not depend on override
    of toJSON() anymore, because there's no way to do that correctly.
    Instead, the function has a custom implementation.
    
    Split new code over more files to separate them out.
    Rico Huijbers committed Aug 13, 2018
    Configuration menu
    Copy the full SHA
    58602a9 View commit details
    Browse the repository at this point in the history
  2. SecretParameter no longer duckily implements Token, won't work in non…

    …-TypeScript languages anyway
    Rico Huijbers committed Aug 13, 2018
    Configuration menu
    Copy the full SHA
    74f4fe7 View commit details
    Browse the repository at this point in the history
  3. Merge remote-tracking branch 'origin/master' into huijbers/token-stri…

    …ngification
    Rico Huijbers committed Aug 13, 2018
    Configuration menu
    Copy the full SHA
    b15684d View commit details
    Browse the repository at this point in the history
  4. fix(aws-logs): resolving of policy

    Fix an issue where the wrong resolution method was used to resolve policy documents.
    Rico Huijbers committed Aug 13, 2018
    Configuration menu
    Copy the full SHA
    5753e31 View commit details
    Browse the repository at this point in the history
  5. Combine string literals while resolving fragments, so we never have n…

    …on-intrinsics
    Rico Huijbers committed Aug 13, 2018
    Configuration menu
    Copy the full SHA
    4206b85 View commit details
    Browse the repository at this point in the history

Commits on Aug 14, 2018

  1. Make intrinsics carry a direct object reference to the engine, simply…

    … cross-account-destination policy usage
    Rico Huijbers committed Aug 14, 2018
    4 Configuration menu
    Copy the full SHA
    85cfa81 View commit details
    Browse the repository at this point in the history
  2. Move JSONification to CloudFormation library, remove any reference to…

    … engines
    Rico Huijbers committed Aug 14, 2018
    Configuration menu
    Copy the full SHA
    a3ec610 View commit details
    Browse the repository at this point in the history

Commits on Aug 15, 2018

  1. Explain better in comments, fix cross-account-destination

    Rico Huijbers committed Aug 15, 2018
    Configuration menu
    Copy the full SHA
    7361815 View commit details
    Browse the repository at this point in the history
  2. Remove joiner(), make Tokens concat() themselves

    To avoid an undue number of {Fn::Join}s in the output, add an optimization
    into FnConcat() to inline nested FnConcats.
    Rico Huijbers committed Aug 15, 2018
    Configuration menu
    Copy the full SHA
    a7b41e2 View commit details
    Browse the repository at this point in the history
  3. Merge remote-tracking branch 'origin/master' into huijbers/token-stri…

    …ngification
    Rico Huijbers committed Aug 15, 2018
    Configuration menu
    Copy the full SHA
    6aa9b77 View commit details
    Browse the repository at this point in the history
  4. Remove laziness of many existing Token use cases

    Rico Huijbers committed Aug 15, 2018
    Configuration menu
    Copy the full SHA
    c5b3b68 View commit details
    Browse the repository at this point in the history