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

BucketDeployment: invalid system metadata keys server-side-encryption and ssekms-key-id #6002

Closed
pnwpedro opened this issue Jan 28, 2020 · 2 comments · Fixed by #6006
Closed
Assignees
Labels
@aws-cdk/aws-kms Related to AWS Key Management @aws-cdk/aws-s3 Related to Amazon S3 bug This issue is a bug.

Comments

@pnwpedro
Copy link

Setting props serverSideEncryption or serverSideEncryptionAwsKmsKeyId results in a failure to deploy.

Reproduction Steps

const encryptionKey = new kms.Key(this, "ArtifactKey");
const artifactBucket = new s3.Bucket(this, "artifactBucket", { encryptionKey });

new s3deploy.BucketDeployment(this, "ArtifactPreparation", {
   sources: [s3deploy.Source.asset(path.resolve(__dirname, '../assets'))],
   destinationBucket: artifactBucket,
   serverSideEncryption: ServerSideEncryption.AWS_KMS,
   serverSideEncryptionAwsKmsKeyId: encryptionKey.keyId
});

Error Log

From lambda:

Unknown options: --server-side-encryption 'aws:kms',--ssekms-key-id 'redacted-key-id'
Command '['python3', '/var/task/aws', 's3', 'sync', '--delete', '/tmp/tmpgvs36uzh/contents', 's3://foo-bucket/', "--server-side-encryption 'aws:kms'", "--ssekms-key-id 'redacted-key-id'", '--metadata-directive', 'REPLACE']' returned non-zero exit status 255

Environment

  • CLI Version : 1.21.1

  • Framework Version: 1.21.1

  • Language : typescript

Other

Invalid system metadata keys:

From documentation, these should be:

  • sse
  • sse-kms-key-id

System metadata keys usage to construct the s3 sync operation here:
https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk/aws-s3-deployment/lambda/src/index.py#L156


This is 🐛 Bug Report

@pnwpedro pnwpedro added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jan 28, 2020
@mattsains
Copy link
Contributor

I am working on a fix, but it's my first time contributing to the cdk so it will take a while for me to test it successfully.

@SomayaB SomayaB added @aws-cdk/aws-s3 Related to Amazon S3 @aws-cdk/aws-kms Related to AWS Key Management labels Jan 28, 2020
@SomayaB
Copy link
Contributor

SomayaB commented Jan 28, 2020

Hi @pnwpedro, thanks for reporting this. And thanks @mattsains for working on it, much appreciated! 👍

@SomayaB SomayaB removed the needs-triage This issue or PR still needs to be triaged. label Jan 28, 2020
@mergify mergify bot closed this as completed in #6006 Feb 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-kms Related to AWS Key Management @aws-cdk/aws-s3 Related to Amazon S3 bug This issue is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants