question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

creationPolicy type does not support Tokens

See original GitHub issue

Trying to convert the following to CDK-flavoured L2 constructs:

    CreationPolicy:
      ResourceSignal:
        Timeout: !Ref InstanceCreationTimeout
        Count: !Ref MinSize

However, the CDK types do not seem to support using anything other than a number. The following fails typescript compilation:

    autoscaler.options.creationPolicy = {
      resourceSignal: {
        timeout: new cdk.Token(instanceCreationTimeout.ref),
        count: new cdk.Token(minSize.ref)
      }
    };

The resourceSignal type only accepts number and undefined for count, meaning I can’t “cheat” and use a stringified nor a raw token.

Note that this is using CDK in its context as a “way to write cloudformation templates” rather than the entire app, so parameters / outputs / conditionals are being used.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
eladbcommented, Dec 30, 2018

@mipearson See #1455 - that’s probably a better way to support this. The reason we are trying to avoid union types in the APIs is because they can hardly be translated well to other programming languages.

0reactions
mipearsoncommented, Jan 4, 2019

I want to point out here that what I was trying to do was based on a lack of understanding of how CDK works, as this issues is referenced as a use case from another.

These values are no longer references in my stack: they’re available at compile / synth time.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tokens: be able to represent as numbers · Issue #1455 - GitHub
We are able to represent tokens as strings (token.toString()) and as string arrays ... creationPolicy type does not support Tokens #1453.
Read more >
CreationPolicy attribute - AWS CloudFormation
The creation policy is invoked only when CloudFormation creates the associated resource. Currently, the only CloudFormation resources that support creation ...
Read more >
Manage personal access tokens using policies - Azure DevOps
In the Azure Active Directory tab, find the Restrict global personal access token creation policy and move the toggle to on.
Read more >
Keycloak and Spring Boot: session creation policy
I try to configure keycloak with Spring Boot amd I would like to use custom Keycloak login page for getting acess token ......
Read more >
Parent Child Token Hierarchy - Vault - Hashicorp Support
vault policy write example-token-create - << EOF // Example token creation policy path ... You do NOT need to run "vault login" again....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found