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

Added support for AWS SecretManager #13

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

musketyr
Copy link
Contributor

@musketyr musketyr commented Aug 4, 2021

This PR adds a support for AWS SecretManager. This can be used to easily distribute secrets for the developers.

Example:

    task downloadSecrets(type: AmazonSecretsManagerGetSecretValueTask) {
        secretName = 'application-local'
        destination = rootProject.file('../application-local.json')
    }
    
    tasks.withType(JavaExec) {
        dependsOn downloadSecrets
        environment(new JsonSlurper().parse(downloadSecrets.destination))
    }

The destination file is marked as output so it's only downloaded when missing

@musketyr musketyr force-pushed the feature/secretsmanager branch from e3262bc to e981b29 Compare August 6, 2021 08:13
@musketyr
Copy link
Contributor Author

musketyr commented Sep 7, 2021

Hi @JustinPihony! Any chance to merge and release this one any time soon?

@JustinPihony
Copy link
Owner

Hi @musketyr I will review this and release tomorrow if all looks good

Copy link
Owner

@JustinPihony JustinPihony left a comment

Choose a reason for hiding this comment

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

I have to finish wrapping my head around this - as I think the Extension can be rewritten to use most of what is already there. But I wanted to ping you early that you need to add to /deploy/jp.classmethod.aws.reboot.gradle if you want it to be it's own plugin, which is how you have the README set up

AWSSecretsManagerClientBuilder builder = AWSSecretsManagerClient.builder();

AwsPluginExtension aws = getProject().getExtensions().getByType(AwsPluginExtension.class);
String profile = aws.getProfileName() == null ? System.getenv("AWS_PROFILE") : aws.getProfileName();
Copy link
Owner

Choose a reason for hiding this comment

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

This should be added to the README

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not quite sure where should I put it

@musketyr
Copy link
Contributor Author

@JustinPihony thanks for the review! I've added the plugin into the deploy script but I'm still bit lost with your previous comment above.

@musketyr
Copy link
Contributor Author

Hi @JustinPihony any way how to move this PR forward?

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.

2 participants