Search code examples
yamlaws-cloudformationaws-secrets-manager

Invalid resource attribute MySecretA for resource SecretsManager, how to create more than one secret in yml?


After deploying my project in cloud formation attemping to create more than one secret, the following error message is displayed:

Invalid resource attribute MySecretA for resource SecretsManager

YAML snippet:

SecretsManager:
 Type: AWS::SecretsManager::Secret
 MySecretA:
   Properties:
     Description: "some description"
     Name: "password B"
 MySecretB:
   Properties:
     Description: "another decription"
     Name: "password A"

I did it based on this documentation https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-secretsmanager-secret.html. Would you know how to create multiple secrets in the same yaml file?


Solution

  •  MySecretA:
       Type: AWS::SecretsManager::Secret
       Properties:
         Description: "some description"
         Name: "password B"
    
     MySecretB:
       Type: AWS::SecretsManager::Secret
       Properties:
         Description: "another decription"
         Name: "password A"