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

fix(secretsmanager): Secret.fromSecretName doesn't work with ECS #11042

Merged
merged 5 commits into from
Oct 30, 2020

Commits on Oct 29, 2020

  1. fix(secretsmanager): Secret.fromSecretName doesn't work with ECS

    The ability to import and reference a Secret purely by the secret name was
    introduced in #10309. One of the original requests was modelled after the
    integration with CodeBuild, where either the secret name or the full ARN
    -- including the SecretsManager-provided suffix -- were accepted, but not a
    "partial" ARN without the suffix. To ease integrations with other services
    in this case, the `secretArn` was defined as returning the `secretName` for
    these secrets imported by name.
    
    However, other services -- like ECS -- require that an ARN format is provided,
    even as a partial ARN. This introduces a dual behavior where sometimes the
    secretName works and partial ARN fails, and other times the partial ARN works
    and the secretName fails.
    
    This change deprecates `fromSecretName` and introduces a new, better-behaved
    `fromSecretNameV2` that sets the ARN to a "partial" ARN without the Secrets
    Manager suffix. It also introduces a `secretFullArn` that is an optional version
    of `secretArn` that will be undefined for secrets imported by name.
    
    Related changes
    * I improved the suffix-strippiung logic of `parseSecretName` to only strip a
      suffix if it's exactly 6 characters long, as all SecretsManager
      suffixes are 6 characters. This prevents accidentally stripping the last word
      off of a hyphenated secret name like 'github-token'.
    * Updated the CodeBuild integration and added CodeBuild tests.
    
    fixes #10519
    njlynch committed Oct 29, 2020
    Configuration menu
    Copy the full SHA
    2e5fa7f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    4824981 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    732d9b2 View commit details
    Browse the repository at this point in the history

Commits on Oct 30, 2020

  1. Configuration menu
    Copy the full SHA
    0eba475 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    6c0a826 View commit details
    Browse the repository at this point in the history