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(kms): import an Alias by name #8299

Merged
merged 4 commits into from
Jun 17, 2020
Merged

feat(kms): import an Alias by name #8299

merged 4 commits into from
Jun 17, 2020

Conversation

njlynch
Copy link
Contributor

@njlynch njlynch commented Jun 1, 2020

Supports importing an Alias by alias name only, without the underlying reference
to the Key ARN. Useful in scenarios where only the alias is needed in a
reference by a Construct.

fixes #5953


Tested via a simple repro script:

    const key = kms.Alias.fromAliasName(this, 'myKey', 'alias/myTestKey');
    new cloudtrail.Trail(this, 'CloudTrail', {
        sendToCloudWatchLogs: true,
        kmsKey: key
    });

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

Supports importing an Alias by alias name only, without the underlying reference
to the Key ARN. Useful in scenarios where only the alias is needed to be
referenced by a Construct.
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: 5305e36
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@skinny85 skinny85 self-assigned this Jun 1, 2020
Copy link
Contributor

@skinny85 skinny85 left a comment

Choose a reason for hiding this comment

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

Looks good, but I'd like to go a step further in making this more usable 🙂.

packages/@aws-cdk/aws-kms/lib/alias.ts Show resolved Hide resolved
packages/@aws-cdk/aws-kms/README.md Show resolved Hide resolved
packages/@aws-cdk/aws-kms/README.md Show resolved Hide resolved
@rix0rrr rix0rrr changed the title feat(kms): support importing an Alias by name feat(kms): import an Alias by name Jun 9, 2020
@mergify mergify bot dismissed skinny85’s stale review June 9, 2020 18:14

Pull request has been modified.

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: 70b4b76
  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: da23728
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Jun 10, 2020
Copy link
Contributor

@skinny85 skinny85 left a comment

Choose a reason for hiding this comment

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

Love it, thanks a lot @njlynch !

@mergify
Copy link
Contributor

mergify bot commented Jun 16, 2020

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-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: 761af94
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify
Copy link
Contributor

mergify bot commented Jun 17, 2020

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).

@mergify mergify bot merged commit 4611e69 into aws:master Jun 17, 2020
@Aarbel
Copy link

Aarbel commented Apr 4, 2023

@njlynch

const key = kms.Alias.fromAliasName(this, 'myKey', 'alias/myTestKey');

By myKey you mean KMS' keyId or key ARN ?

image

@skinny85
Copy link
Contributor

skinny85 commented Apr 5, 2023

Pretty sure Nick meant 'myKey' as a string - a resource identifier.

@Aarbel
Copy link

Aarbel commented Apr 5, 2023

Pretty sure Nick meant 'myKey' as a string - a resource identifier.

Thanks @skinny85, i name it rdsKmsKeyForPerformanceInsights

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution/core This is a PR that came from AWS.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

KMS - Ability to import an AWS managed key by its alias
5 participants