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

New plugin: AWS CDK Toolkit #232

Merged
merged 8 commits into from Apr 5, 2023
Merged

New plugin: AWS CDK Toolkit #232

merged 8 commits into from Apr 5, 2023

Conversation

williamhpark
Copy link
Contributor

@williamhpark williamhpark commented Mar 29, 2023

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 self-assigned this Mar 29, 2023
Copy link
Contributor

@AndyTitu AndyTitu left a comment

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.

@williamhpark williamhpark marked this pull request as ready for review March 30, 2023 18:16
@williamhpark
Copy link
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!

plugins/aws/aws.go Outdated Show resolved Hide resolved
plugins/aws/aws.go Outdated Show resolved Hide resolved
sdk/schema/plugin.go Show resolved Hide resolved
Copy link
Contributor

@AndyTitu AndyTitu left a comment

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

plugins/aws/cdk.go Show resolved Hide resolved
@williamhpark williamhpark merged commit d9ab2c9 into main Apr 5, 2023
4 checks passed
@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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants