2

I want to assign variable's value to the secret. I tried this. aws secretsmanager tag-resource --secret-id blah-blah --tags '[{"Key": "abc", "Value": "{$a}"}]'

I'm getting this error: An error occurred (InvalidRequestException) when calling the TagResource operation: Request rejected by the downstream tagging service. Please check that you're only using allowed characters.

Any help with this???

curious_coder
  • 99
  • 1
  • 7

2 Answers2

0

You are using wrong characters and quotes. It should be:

aws secretsmanager tag-resource --secret-id blah-blah --tags '[{"Key": "abc", "Value": "'${a}'"}]'
Marcin
  • 215,873
  • 14
  • 235
  • 294
0

I had a similar issue and this was the only exact hit on Google. For future seekers this error indictes an error on the tags, not the secrets. It kind of say in the error message, but still took me some time to figure out.

We missed a !sub for substitution on the tags on the bottom line when trying to define this in SAM:

  Auth0TokenSecret:
    Type: AWS::SecretsManager::Secret
    Properties:
      Name: 'auth0/aws-client-secret'
      Description: 'Auth0 token'
      SecretString: !Ref Auth0Token
      Tags:
        - Key: AppName
          Value: ${AWS::StackName}
Andreas Lundgren
  • 12,043
  • 3
  • 22
  • 44