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

Add a check for permission to createVolume for EBS and creds validation for aws #1339

Merged

Conversation

leuyentran
Copy link
Contributor

@leuyentran leuyentran commented Mar 29, 2022

Change Overview

This PR:

  1. Add CheckVolumeCreate to check EC2 permission to perform VolumeCreate action
  2. Add IsAwsCredsValid to check credibility of AWS creds

Pull request type

Please check the type of change your PR introduces:

  • 🚧 Work in Progress
  • 🌈 Refactoring (no functional changes, no api changes)
  • 🐹 Trivial/Minor
  • 🐛 Bugfix
  • 🌻 Feature
  • 🗺️ Documentation
  • 🤖 Test

Issues

Test Plan

  • 💪 Manual
  • ⚡ Unit test
  • 💚 E2E

@leuyentran leuyentran self-assigned this Mar 29, 2022
@@ -148,3 +147,21 @@ func GetConfig(ctx context.Context, config map[string]string) (awsConfig *aws.Co
}
return &aws.Config{Credentials: creds}, region, nil
}

func IsAwsCredsValid(ctx context.Context, config map[string]string) (bool, error) {
Copy link
Contributor Author

@leuyentran leuyentran Mar 29, 2022

Choose a reason for hiding this comment

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

It is a conscious decision here to pass config map[string]string as input , as opposed to *aws.Config. This design is to minimize kanister calls on caller side. All that is needed to validate creds is the the creds itself, without having to call another kanister func beforehand (such as GetConfig())

@leuyentran leuyentran changed the title Add permission check func ebs and creds validation aws Add a check for permission to createVolume for EBS and creds validation for aws Mar 29, 2022
@mergify mergify bot merged commit 247e548 into master Mar 30, 2022
@mergify mergify bot deleted the add-permission-check-func-ebs-and-creds-validation-aws branch March 30, 2022 01:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants