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

Apply command not reading credentials from AWS Secrets manager without placeholder in cluster config #205

Open
srini-hv opened this issue Jun 24, 2024 · 1 comment

Comments

@srini-hv
Copy link

Looks like topicctl apply is not trying to read SASL credentials from AWS Secrets manager while topicctl check does.

$ echo $TOPICCTL_SASL_SECRETS_MANAGER_ARN
arn:aws:secretsmanager:<region>:<account-id>:secret:<secret-id>

$ topicctl --version
topicctl version v1.18.0 (ref:dev)

Steps to reproduce:

$ cat /tmp/topic.yaml
---
meta:
  name: test_topic                     
  cluster: test_cluster       
  environment: dev
  region: some-region           
spec:                  
  partitions: 12
  replicationFactor: 3
  placement:          
    strategy: any


$ cat /tmp/cluster.yaml 
---
meta:
  name: test_cluster
  environment: dev
  region: some-region
spec:
  bootstrapAddrs:
    - <b1-endpoint>:9096
    - <b2-endpoint>:9096
    - <b3-endpoint>:9096
  tls:
    enabled: true
  sasl:
    enabled: true
    mechanism: SCRAM-SHA-512

$ topicctl apply /tmp/topic.yaml --skip-confirm --cluster-config /tmp/cluster.yaml --expand-env --debug

{{test_topic test_cluster some-region dev  map[] []} {12 3 0 map[] {any  [] []} <nil>}}
[2024-06-24 13:04:08] DEBUG No ZK addresses provided, using broker admin client
[2024-06-24 13:04:08] DEBUG Connecting to cluster on address <b1-endpoint>:9096 with TLS enabled=true, SASL enabled=true
[2024-06-24 13:04:08] DEBUG Getting supported API versions
[2024-06-24 13:04:09] ERROR 58: SASL Authentication Failed: SASL Authentication failed: Authentication failed during authentication due to invalid credentials with SASL mechanism SCRAM-SHA-512

Output from topicctl check:

$ topicctl get topics --cluster-config /tmp/cluster.yaml --expand-env --debug

time="2024-06-24 12:59:50" level=debug msg="No ZK addresses provided, using broker admin client"
time="2024-06-24 12:59:50" level=debug msg="Setting SASL SecretsManagerArn from override value"
time="2024-06-24 12:59:50" level=debug msg="Fetching credentials from Secrets Manager for secret: arn:aws:secretsmanager:<region>:<account-id>:secret:<secret-id>"
time="2024-06-24 12:59:50" level=debug msg="Fetching secret value for secret name: <secret-id>"
time="2024-06-24 12:59:50" level=debug msg="Connecting to cluster on address <b1-endpoint>:9096 with TLS enabled=true, SASL enabled=true"
time="2024-06-24 12:59:50" level=debug msg="Getting supported API versions"

You can clearly see that topicctl check tries to read secret from Secrets manager.

@srini-hv srini-hv changed the title Apply command not reading credentials from AWS Secrets manager Apply command not reading credentials from AWS Secrets manager without placeholder in cluster config Jun 24, 2024
@srini-hv
Copy link
Author

Just noticed that it ONLY works if value or placeholder is set for secretsManagerArn in cluster.yaml while Username & Password works just by setting as environment variables without the need for placeholders in cluster.yaml

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

No branches or pull requests

1 participant