Skip to content

Conversation

@thantos
Copy link
Collaborator

@thantos thantos commented Oct 7, 2022

V0.1 of @functionless/formation

  • Modules Hanlders
  • Hand Rolled Resources (not supported by CC)
    • Event Bus
      • Create
      • Update
      • Delete
    • Event Bus Rule (not supported by CC)
      • Create
      • Update
      • Delete
    • Policy (not supported by CC)
      • Create
      • Update
      • Delete
    • Managed policy (not supported by CC)
      • Create
      • Update
      • Delete
    • Queue Policy (not supported by CC)
      • Create
      • Update
      • Delete
    • Queue (optimization)
      • Create
      • Update
      • Delete
    • Role (optimization)
      • Create
      • Update
      • Delete
    • Secret (not supported by CC)
      • Create
      • Update
      • Delete
    • Event Source Mapping (optimization)
      • Create
      • Update
      • Delete
    • more...
  • All Functionless Runtime Tests pass with Formless
    • Lambda
    • Queue - Event Bus Rule was broken
    • Sfn
    • Secret
    • Table
    • Api
  • Plan
    • Compute
      • Assets
      • Conditions
      • Deletes
      • Create/Update
        • No-Op Updates
    • Render (cli)
  • Improve CLI Output
  • Support Delete
  • Support Statefulness via tags and or stateful saving
  • Support parameters
    • As dependencies
    • In cli
  • Bi-furcate consistent vs referenceable completion
  • Metrics
  • Support correct Ref logic for all resources - some reasons do not use ARN for REF like Queue (uses QueueUrl)
  • create external package and cli with a really clever name

@github-actions
Copy link

github-actions bot commented Oct 7, 2022

@thantos thantos mentioned this pull request Oct 7, 2022
58 tasks
@sam-goodwin
Copy link
Owner

Not turbo formation?

.projenrc.ts Outdated
@@ -0,0 +1,391 @@
import * as fs from "fs";
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete this file?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, must have come from the merge? deleted

typeof kind === "number" ? getNodeKindName(kind) : kind
)
.join(", ")}`
.join(", ")}, found: ${item}`
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this print an object usefully?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not always, but it did when I was testing. Will stringify.

Comment on lines -276 to +267
busName: addr.node.addr,
busName: bus.resource.eventBusName,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops lol. How did that ever work

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It did work, but the bus was a singleton.

}));
}

async function nodeCfnDeploy(
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formation deploy?

Comment on lines +4 to +5
"node-cfn": "bin/node-cfn.js",
"node-cfn.js": "bin/node-cfn.js"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Time to rename these?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

likely, just copied them over

Comment on lines 175 to 176
circularReferences.push(logicalId);
break;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should you continue and find all?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was your code, I rewrote it in the next commit to use a pure DFS and support memoized paths.

Copy link
Owner

@sam-goodwin sam-goodwin Oct 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can comment on my own code too. It's all being committed 😅

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I re-wrote all of this anyways, lol. It was re-doing a lot of work.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can it be removed?

}

/**
* TODO: support optional snapshot.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some resources support snapshots on delete. My thought was the interface would have an optional snapshot callback that can be implemented by a provider when they want to support snapshots.

Additionally, they should be able to force a snapshot on delete for cases like RDS.

"AWS::CDK::Metadata": new NoOpProvider(),
"AWS::Lambda::EventSourceMapping": (props) =>
new EventSourceMappingProvider(props),
[DEFAULT_RESOURCE_PROVIDER_KEY]: (props) => new CloudControlProvider(props),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it a be better to have this logic handled explicitly by the caller? Strange to see it as a magic key

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these are defaults, the user can pass in any map of providers or merge into the defaults.

What interface were you looking for?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would expect this map to only have resource types. What resource is the default? Is there logic to specially handle that key?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Default is the provider we try when there is no explicit key for the current resource in the map. It seemed easier to define the default providers this way, at least until a more complex fallback system was created.

Other options:

  • a map of key to providers and a parameter for "defaultProvider"
  • a pipeline approach where a single provider is given which can have providers nested within.
  • a map of key to providers then an array of fallback providers.
  • a single handler given by the consumer which returns the provider given a key and some config

constructor(props: ResourceProviderProps) {
this.controlClient = new control.CloudControlClient(props.sdkConfig);
}
retry: ResourceProviderRetryConfig = { canRetry: true };
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Set this in the constructor? Make it read only?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved it to the top and made it readonly. No reason to set in the constructor if it is a constant.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why even have it if it's a constant? I was just thinking for consistency. It's jarring code

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its configuration per provider. Not all providers can idempotently be retried on all operations.

@thantos
Copy link
Collaborator Author

thantos commented Oct 7, 2022

Not turbo formation?

My though was to have a nested package (@functionless/formation) and then a top level package that gets published ???-formation (like we are doing with functionless).

@sam-goodwin
Copy link
Owner

Not turbo formation?

My though was to have a nested package (@functionless/formation) and then a top level package that gets published ???-formation (like we are doing with functionless).

If we have multiple packages, they should all share the same branding. We need to agree on the branding. I think turbo formation was winning last time we chatted. We can bring it up again with the team

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants