Skip to content

chore(cdk-cli-wrapper): create a cli wrapper for invoking the cdk#19518

Merged
mergify[bot] merged 4 commits intoaws:masterfrom
corymhall:corymhall/exec-cdk
Mar 23, 2022
Merged

chore(cdk-cli-wrapper): create a cli wrapper for invoking the cdk#19518
mergify[bot] merged 4 commits intoaws:masterfrom
corymhall:corymhall/exec-cdk

Conversation

@corymhall
Copy link
Copy Markdown
Contributor

@corymhall corymhall commented Mar 22, 2022

This is initially needed for the integration testing project. For
integration testing we need to be able to programmatically invoke the
CLI and control which arguments are passed to the CLI.

We could have just included this as part of the integration testing
library that we will be creating, but since the logic is pretty self
contained this allows us to eventually publish this as a separate
library for customers to use. Initially we will not publish this
externally, but it is configured with jsii so we can in the future.

This PR adds the base functionality needed, and the goal will be to
iterate on this as we work on creating the integration testing library.

I have taken the command options from the aws-cdk package, which does
introduce some duplication. Ideally it would be cool if we could define
these in a single place and somehow autogenerate the cli args from the
interfaces. Since we don't add new CLI options that often, I think this
is fine for now.

The ICdk interface is similar to the IAws
interface in cdk-assets which will allow us to create different
"clients" (e.g. we could create another one in aws-cdk that just uses
the functions there).


All Submissions:

Adding new Unconventional Dependencies:

* [ ] This PR adds new unconventional dependencies following the process described here

New Features

* [ ] Have you added the new feature to an integration test?
* [ ] Did you use cdk-integ to deploy the infrastructure and generate the snapshot (i.e. cdk-integ without --dry-run)?

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

This is initially needed for the integration testing project. For
integration testing we need to be able to programmatically invoke the
CLI and control which arguments are passed to the CLI.

We could have just included this as part of the integration testing
library that we will be creating, but since the logic is pretty self
contained this allows us to eventually publish this as a separate
library for customers to use. Initially we will not publish this
externally, but it is configured with jsii so we can in the future.

This PR adds the base functionality needed, and the goal will be to
iterate on this as we work on creating the integration testing library.

I have taken the command options from the aws-cdk package, which does
introduce some duplication. Ideally it would be cool if we could define
these in a single place and somehow autogenerate the cli args from the
interfaces. Since we don't add new CLI options that often, I think this
is fine for now.

The `ICdk` interface is similar to the [IAws](https://github.com/aws/aws-cdk/blob/fe0ecb48d98f3a33237ae80664610611b90873a9/packages/cdk-assets/lib/aws.ts#L6)
interface in `cdk-assets` which will allow us to create different
"clients" (e.g. we could create another one in `aws-cdk` that just uses
the functions there).
@gitpod-io
Copy link
Copy Markdown

gitpod-io bot commented Mar 22, 2022

@github-actions github-actions bot added the package/tools Related to AWS CDK Tools or CLI label Mar 22, 2022
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Mar 22, 2022
@corymhall
Copy link
Copy Markdown
Contributor Author

I wonder if it is possible (or even a good idea) to try and bundle the CLI. Now that we have a process to bundle the CLI, can we utilize that to include the bundle in this package?

@otaviomacedo otaviomacedo added the pr/do-not-merge This PR should not be merged at this time. label Mar 23, 2022
@corymhall corymhall removed the pr/do-not-merge This PR should not be merged at this time. label Mar 23, 2022
@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Mar 23, 2022

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation
Copy link
Copy Markdown
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject89A8053A-LhjRyN9kxr8o
  • Commit ID: b551756
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify mergify bot merged commit 92ae07d into aws:master Mar 23, 2022
@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Mar 23, 2022

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

StevePotter pushed a commit to StevePotter/aws-cdk that referenced this pull request Apr 27, 2022
…s#19518)

This is initially needed for the integration testing project. For
integration testing we need to be able to programmatically invoke the
CLI and control which arguments are passed to the CLI.

We could have just included this as part of the integration testing
library that we will be creating, but since the logic is pretty self
contained this allows us to eventually publish this as a separate
library for customers to use. Initially we will not publish this
externally, but it is configured with jsii so we can in the future.

This PR adds the base functionality needed, and the goal will be to
iterate on this as we work on creating the integration testing library.

I have taken the command options from the aws-cdk package, which does
introduce some duplication. Ideally it would be cool if we could define
these in a single place and somehow autogenerate the cli args from the
interfaces. Since we don't add new CLI options that often, I think this
is fine for now.

The `ICdk` interface is similar to the [IAws](https://github.com/aws/aws-cdk/blob/fe0ecb48d98f3a33237ae80664610611b90873a9/packages/cdk-assets/lib/aws.ts#L6)
interface in `cdk-assets` which will allow us to create different
"clients" (e.g. we could create another one in `aws-cdk` that just uses
the functions there).


----

### All Submissions:

* [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md)

### Adding new Unconventional Dependencies:

~* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md/#adding-new-unconventional-dependencies)~

### New Features

~* [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/master/INTEGRATION_TESTS.md)?~
	~* [ ] Did you use `cdk-integ` to deploy the infrastructure and generate the snapshot (i.e. `cdk-integ` without `--dry-run`)?~

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contribution/core This is a PR that came from AWS. package/tools Related to AWS CDK Tools or CLI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants