Skip to content

AWS SSM vs AWS Secretsmanager > Strange behaviour if only ENV AWS_REGION is set #2191

Closed

Description

@nexeck

Hi there!

Bug Report

I am using AWS SSM Parameter Store for Secrets. The Web Instance tries to access SSM and Secretsmanager

Steps to reproducude:

  • Just set the ENV for AWS_REGION, both credential backends get activated

SSM:
https://github.com/concourse/atc/blob/master/creds/ssm/manager.go#L23
https://github.com/concourse/atc/blob/master/creds/ssm/manager.go#L49

Secretsmanager:
https://github.com/concourse/atc/blob/master/creds/secretsmanager/manager.go#L23
https://github.com/concourse/atc/blob/master/creds/secretsmanager/manager.go#L46

The following can also be handy:

  • Concourse version: 3.12.0
  • Deployment type (BOSH/Docker/binary): docker
  • Infrastructure/IaaS: AWS
  • Browser (if applicable):
  • Did this used to work?

Activity

  1. nexeck commented on May 2, 2018

    @nexeck
    ContributorAuthor

    @vito Can you take a look at this?
    vmware-archive/atc#229
    vmware-archive/atc#262

    Those two PR's introduced this behaviour.
    I do not know how to fix this, without breaking the current behaviour of both Credential Managers.

    Maybe remove the AWS_REGION Variable, and add two new, one for each Credential Manager?

  2. owen-fugue commented on May 8, 2018

    @owen-fugue

    @nexeck Thanks for doing the due diligence here. I came across your issue after I'd been debugging this as well. I think some kind of signaling value, as you suggested, would make sense.

  3. jama22 commented on May 23, 2018

    @jama22

    @nexeck thanks for doing the research. I've scheduled it under Operations.

  4. sjiveson commented on Jun 5, 2018

    @sjiveson

    I've seen the same behaviour (with ATC randomly attempting to pull secrets from one or the other each time I launched it) and had to add these (set to default) values to force use of Secrets Manager, I assume the same will work for SSM until you implement a fix:

    CONCOURSE_AWS_SECRETSMANAGER_PIPELINE_SECRET_TEMPLATE: "/concourse/{{.Team}}/{{.Pipeline}}/{{.Secret}}"
    CONCOURSE_AWS_SECRETSMANAGER_TEAM_SECRET_TEMPLATE: "/concourse/{{.Team}}/{{.Secret}}"
    
  5. analytically commented on Jul 25, 2018

    @analytically
    Contributor

    Seeing strange behaviour as well, the secret id is extracted from the arn? Can't seem to get it to work.

  6. sjiveson commented on Jul 25, 2018

    @sjiveson

    Secret ID? Can you elaborate?

  7. Luke-Vear commented on Oct 26, 2018

    @Luke-Vear

    Getting this issue on concourse 4.2.1

  8. vito commented on Nov 7, 2018

    @vito
    Contributor

    Ended up running in to this and fixing it in our quest to use the binaries in the BOSH release (#2575). It'll be in the next version. Thanks for the sleuthing!

  9. bracki commented on Dec 4, 2018

    @bracki

    @vito How does #2575 solve this very issue? Shouldn't there be the ability to tell Concourse exactly which credentials backend to use?

  10. vito commented on Dec 4, 2018

    @vito
    Contributor

    @bracki the offending env var (AWS_REGION) has been removed in favor of a more clearly named var for each (following the existing CONCOURSE_ prefix scheme)

  11. added this to the v5.0.0 milestone on Jan 10, 2019
  12. Jeeppler commented on Jan 15, 2019

    @Jeeppler

    @Luke-Vear do you still have this issue in Concourse 4.2.2?

  13. added
    release/documented
    on Jan 21, 2019
  14. benabineri commented on Apr 9, 2019

    @benabineri

    We are still seeing this on 4.2.3. This is on a concourse web instance configured with the following environment variables (among others, of course):

    AWS_REGION=eu-west-1
    CONCOURSE_AWS_SECRETSMANAGER_PIPELINE_SECRET_TEMPLATE=/concourse/{{.Team}}/{{.Pipeline}}/{{.Secret}}
    CONCOURSE_AWS_SECRETSMANAGER_TEAM_SECRET_TEMPLATE=/concourse/{{.Team}}/{{.Secret}}
    

    Started with the following command:

    ["web","--aws-secretsmanager-region","eu-west-1"]
    

    Log entries below - nothing changed, just a restart (of the ECS service):

    { "timestamp": "1554121846.894342184", "source": "atc", "message": "atc.credential-manager.configured credentials manager", "log_level": 1, "data": { "name": "ssm", "session": "7" } }
    
    { "timestamp": "1554822208.109996796", "source": "atc", "message": "atc.credential-manager.configured credentials manager", "log_level": 1, "data": { "name": "secretsmanager", "session": "7" } }
    

    Should we unset AWS_REGION?

  15. vito commented on Apr 10, 2019

    @vito
    Contributor

    @benabineri Yes, you should avoid setting AWS_REGION. This was fixed in v5.0.0 by using a different var for both.

  16. eedwards-sk commented on May 20, 2019

    @eedwards-sk

    @vito SSM docs still say AWS_REGION: https://concourse-ci.org/aws-ssm-credential-manager.html

    and ASM docs say CONCOURSE_AWS_SECRETSMANAGER_REGION: https://concourse-ci.org/aws-asm-credential-manager.html

    however this issue seems to claim SSM should use CONCOURSE_AWS_SSM_AWS_REGION: #2003

    which differs from the ASM version (_REGION vs _AWS_REGION)

    Which one is correct?

    Edit: I should probably open a new issue for this!

  17. added a commit that references this issue on Sep 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedbugrelease/documented

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions