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

SecretString from SecretsManager should be a valid cdk.Secret #1672

Closed
hoegertn opened this issue Feb 4, 2019 · 5 comments
Closed

SecretString from SecretsManager should be a valid cdk.Secret #1672

hoegertn opened this issue Feb 4, 2019 · 5 comments
Assignees
Labels
@aws-cdk/aws-secretsmanager Related to AWS Secrets Manager effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. needs-design This feature request needs additional design work. p2

Comments

@hoegertn
Copy link
Contributor

hoegertn commented Feb 4, 2019

Given the following code:

const githubAccessToken = new SecretString(this, 'GithubToken', {secretId: 'GitHub'});

it should be valid to use it directly in a SourceAction for Codepipeline.

Instead I have to write it like new Secret(githubAccessToken.jsonFieldValue('Token'))

@eladb eladb changed the title SecretString from Secretsmanager should be a valid cdk.Secret SecretString from SecretsManager should be a valid cdk.Secret Feb 11, 2019
@eladb
Copy link
Contributor

eladb commented Feb 11, 2019

I guess that name of the JSON field is additional information you'll need to supply (in your case Token).

How about something like toSecret:

githubAccessToken.toSecret('Token')

Would that be more convinient/discoverable?

@eladb eladb added feature-request A feature should be added or improved. needs-response @aws-cdk/aws-secretsmanager Related to AWS Secrets Manager labels Feb 11, 2019
@NGL321 NGL321 added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. and removed status/needs-response labels Sep 16, 2019
@rix0rrr
Copy link
Contributor

rix0rrr commented Sep 17, 2019

I guess jsonFieldValue should always have returned a Secret, actually, no? A fragment of a Secret is still a Secret.

We can deprecate that accessor and make a new one that returns a value of the right type.


githubAccessToken.toSecret('Token')

This seems a little inscrutable to me. Reads as if you're converting the githubAccessToken to a Secret (which it already is), and some modifier for the conversion is the string 'Token'.

IOW, to me it looks as if toSecret() operates on the WHOLE value, rather than extracing a part of it. Maybe extractSecret()? accessField() ?

@NGL321 NGL321 added closing-soon This issue will automatically close in 4 days unless further comments are made. and removed response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. labels Oct 4, 2019
@rix0rrr rix0rrr removed the closing-soon This issue will automatically close in 4 days unless further comments are made. label Oct 10, 2019
@rix0rrr
Copy link
Contributor

rix0rrr commented Oct 10, 2019

Don't close this please, I think it's still relevant. We have to hash out the right API though.

@rix0rrr rix0rrr assigned skinny85 and unassigned rix0rrr Jan 23, 2020
@skinny85 skinny85 added the effort/medium Medium work item – several days of effort label Feb 6, 2020
@SomayaB SomayaB added needs-discussion This issue/PR requires more discussion with community. needs-design This feature request needs additional design work. and removed status/needs-design needs-discussion This issue/PR requires more discussion with community. labels Feb 25, 2020
@SomayaB SomayaB assigned njlynch and unassigned skinny85 Jul 10, 2020
@njlynch njlynch added the p2 label Aug 11, 2020
@njlynch
Copy link
Contributor

njlynch commented Dec 2, 2020

Closing this out, as the SecretString interface was removed in #2161 (in CDK version 0.28.0!). The interfaces of Secret, cdk.SecretValue, and others have been dramatically altered since then, so hard to say if there's still any relevance.

@njlynch njlynch closed this as completed Dec 2, 2020
@github-actions
Copy link

github-actions bot commented Dec 2, 2020

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-secretsmanager Related to AWS Secrets Manager effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. needs-design This feature request needs additional design work. p2
Projects
None yet
Development

No branches or pull requests

7 participants