-
Notifications
You must be signed in to change notification settings - Fork 4k
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
feat(secretsmanager): adds grantWrite to Secret #7858
Conversation
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
@skinny85 Ready for review whenever you are. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome contribution @ddneilson , thanks so much!
Minor comments, mainly on documentation and test. But this is great!
2911821
to
d77517b
Compare
@skinny85 Ready for round 2 when you are. |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thanks for the contribution @ddneilson !
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
### Commit Message feat(secretsmanager): adds grantWrite to Secret ### End Commit Message Implements: aws#7682 #### Testing I deployed the following: ``` #!/usr/bin/env node import * as cdk from '@aws-cdk/core'; import * as kms from '@aws-cdk/aws-kms'; import * as secretsmanager from '@aws-cdk/aws-secretsmanager'; import * as ec2 from '@aws-cdk/aws-ec2'; const app = new cdk.App(); const stack = new cdk.Stack(app, 'Stack', {}); const key = new kms.Key(stack, 'KMS'); const secret = new secretsmanager.Secret(stack, 'Secret', { encryptionKey: key }); const secret2 = new secretsmanager.Secret(stack, 'Secret2', {}); const vpc = ec2.Vpc.fromVpcAttributes(stack, 'Vpc', { vpcId: "vpc-XXXX", availabilityZones: [ "us-west-2a" ], publicSubnetIds: [ "subnet-XXXX" ], }); const instance = new ec2.BastionHostLinux(stack, 'Bastion', { vpc: vpc }); secret.grantRead(instance); secret.grantWrite(instance); secret2.grantRead(instance); secret2.grantWrite(instance); app.synth(); ``` Then, once the stack is deployed I used ssm to connect to the bastion and ran: ``` for secret in <secret name 1> <secret name 2> do aws --region us-west-2 secretsmanager put-secret-value --secret-id ${secret} --secret-string "FooValue" aws --region us-west-2 secretsmanager get-secret-value --secret-id ${secret} done ``` Finally, I verified the contents of the two secrets in the SecretsManager console. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Commit Message
feat(secretsmanager): adds grantWrite to Secret
End Commit Message
Implements: #7682
Testing
I deployed the following:
Then, once the stack is deployed I used ssm to connect to the bastion and ran:
Finally, I verified the contents of the two secrets in the SecretsManager console.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license