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

feat(bootstrap): add kms-key-id option to cdk bootstrap command #2245

Closed
wants to merge 3 commits into from
Closed

feat(bootstrap): add kms-key-id option to cdk bootstrap command #2245

wants to merge 3 commits into from

Conversation

abelmokadem
Copy link
Contributor

@abelmokadem abelmokadem commented Apr 11, 2019

Closes #2203


Pull Request Checklist

  • Testing
    • Unit test added (prefer not to modify an existing test, otherwise, it's probably a breaking change)
    • CLI change?: coordinate update of integration tests with team
    • cdk-init template change?: coordinated update of integration tests with team
  • Docs
    • jsdocs: All public APIs documented
    • README: README and/or documentation topic updated
  • Title and Description
    • Change type: title prefixed with fix, feat will appear in changelog
    • Title: use lower-case and doesn't end with a period
    • Breaking?: last paragraph: "BREAKING CHANGE: <describe what changed + link for details>"
    • Issues: Indicate issues fixed via: "Fixes #xxx" or "Closes #xxx"
  • Sensitive Modules (requires 2 PR approvers)
    • IAM Policy Document (in @aws-cdk/aws-iam)
    • EC2 Security Groups and ACLs (in @aws-cdk/aws-ec2)
    • Grant APIs (only if not based on official documentation with a reference)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license.

@abelmokadem abelmokadem marked this pull request as ready for review April 11, 2019 15:47
@abelmokadem abelmokadem requested a review from a team as a code owner April 11, 2019 15:47
@abelmokadem
Copy link
Contributor Author

Is it possible to see why the build failed?

@RomainMuller
Copy link
Contributor

Seems failed due to an ongoing issue we're experiencing with the mono tooling when compiling .NET bindings. Ugh. I wonder why you didn't get a TravisCI build here though.

@abelmokadem
Copy link
Contributor Author

abelmokadem commented May 23, 2019

Still need to make a change to the code in case there is no key. And add a test case. Haven't had the time yet.

@RomainMuller
Copy link
Contributor

That's cool. I was just making sure this PR does grow excessively stale :)

@RomainMuller
Copy link
Contributor

@abelmokadem are you till intending to push further commits on there? If you're unable to, it'd be nice if you can lay out the remaining work you intend to be done before this is merge-able.

@abelmokadem
Copy link
Contributor Author

Hi guys, I have been quite busy with work and our new born daughter :( Sorry I can't pick this up any further. Still hoping to see this feature in a future release.

@hoegertn
Copy link
Contributor

hoegertn commented Aug 7, 2019

Can you outline what is missing? I can try to pick up the PR.

Properties: {
AccessControl: "Private",
BucketEncryption: { ServerSideEncryptionConfiguration: [{ ServerSideEncryptionByDefault: { SSEAlgorithm: "aws:kms" } }] }
AccessControl: 'Private',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@hoegertn there is no condition here for when no kmsKeyId is provided.

Copy link
Contributor

Choose a reason for hiding this comment

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

right, you'd want to default that to a KMS managed server-side encryption

Copy link
Contributor

@shivlaks shivlaks left a comment

Choose a reason for hiding this comment

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

  • Would also love to see some updates / addition of tests

@@ -57,6 +57,7 @@ async function parseCommandLineArguments() {
.option('output', { type: 'string', alias: 'o', desc: 'write CloudFormation template for requested stacks to the given directory', requiresArg: true })
.option('numbered', { type: 'boolean', alias: 'n', desc: 'prefix filenames with numbers to indicate deployment ordering' }))
.command('bootstrap [ENVIRONMENTS..]', 'Deploys the CDK toolkit stack into an AWS environment', yargs => yargs
.option('toolkit-bucket-encryption-key-id', { type: 'string', alias: 'k', desc: 'AWS KMS master key ID used for the SSE-KMS encryption', default: 'aws:kms' })
Copy link
Contributor

Choose a reason for hiding this comment

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

  • I think the default should be no key right / a KMS managed key right? - S3 Bucket Encryption options for reference. aws:kms is not quite the default of selecting this option.

  • I'd prefer if we didn't add an alias as I don't think it's intuitive that k would map to the bootstrap bucket's KMS key ID

readonly bucketName?: string;

/**
* The ID of an existing KMS key to be used for encrypting items in the bucket.
Copy link
Contributor

Choose a reason for hiding this comment

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

by existing, do we mean a user managed KMS key?

Properties: {
AccessControl: "Private",
BucketEncryption: { ServerSideEncryptionConfiguration: [{ ServerSideEncryptionByDefault: { SSEAlgorithm: "aws:kms" } }] }
AccessControl: 'Private',
Copy link
Contributor

Choose a reason for hiding this comment

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

right, you'd want to default that to a KMS managed server-side encryption

@hoegertn
Copy link
Contributor

@eladb please close, as #3634 is merged

@eladb eladb closed this Aug 14, 2019
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.

Add kms encryption key as argument for cdk bootstrap
7 participants