Skip to content

New plugin: AWS CDK Toolkit - #232

Merged
williamhpark merged 8 commits into
mainfrom
wpark/aws-cdk
Apr 5, 2023
Merged

williamhpark merged 8 commits into
mainfrom
wpark/aws-cdk

Conversation

@williamhpark

@williamhpark williamhpark commented Mar 29, 2023 •

Copy link
Copy Markdown
Contributor

Summary

Add support for a new plugin for the AWS CDK Toolkit.

The AWS Cloud Development Kit (AWS CDK) lets you define your cloud infrastructure as code in one of its supported programming languages. You can use it to create, manage, deploy, etc. AWS CDK apps.

Thought Process

The AWS CDK Toolkit uses the same credentials as the regular AWS CLI, and the same profile workflow. We can reuse the importers and provisioners that have already been created for the AWS shell plugin.

How To Test

  1. Install the AWS CDK Toolkit following these instructions
  2. Initialize the AWS CDK plugin by running op plugin init cdk
  3. Create an AWS CDK app following these instructions
  4. Run a cdk command from the CDK app directory that requires authentication, e.g. cdk deploy. Try authenticating in the following ways. The command should be authenticated and run as expected:
    a. Use an existing AWS Access Key created for the regular AWS shell plugin
    b. Import credentials from the ~/.aws/credentials file
    c. Import credentials manually as prompted
  5. Run make aws/validate. All validation checks should pass and there should be a # Executable: AWS CDK Toolkit section
@williamhpark
williamhpark requested a review from AndyTitu March 29, 2023 21:07
@williamhpark williamhpark self-assigned this Mar 29, 2023

@AndyTitu AndyTitu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We would like to leverage the powers of CredentialUsage field of an Executable to specify that AWS CDK CLI executable could use the exact same CredentialType as AWS does. This will mean that by default, all default provisioners and importers will be re-used for cdk as well.

Comment thread plugins/awscdk/plugin.go Resolved
@williamhpark
williamhpark marked this pull request as ready for review March 30, 2023 18:16
@williamhpark

Copy link
Copy Markdown
Contributor Author

We would like to leverage the powers of CredentialUsage field of an Executable to specify that AWS CDK CLI executable could use the exact same CredentialType as AWS does. This will mean that by default, all default provisioners and importers will be re-used for cdk as well.

@AndyTitu I believe that the change that I just pushed conforms with that you're hoping for. Let me know if you think any other changes are necessary!

Comment thread plugins/aws/aws.go Resolved
Comment thread plugins/aws/aws.go Resolved
Comment thread sdk/schema/plugin.go Resolved
Comment thread sdk/schema/plugin.go Resolved
Comment thread sdk/schema/plugin.go Resolved

@AndyTitu AndyTitu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Functionally tested for op plugin run, op plugin init, op plugin ls, op plugin inspect, and op plugin clear.

Code lgtm

Comment thread plugins/aws/cdk.go Resolved
@williamhpark
williamhpark merged commit d9ab2c9 into main Apr 5, 2023
@williamhpark
williamhpark deleted the wpark/aws-cdk branch April 5, 2023 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

5 participants