AWSTemplateFormatVersion: '2010-09-09' Description: MongoDB Atlas AWS CloudFormation for building a, secret profile with ApiKeys Parameters: ProfileName: Description: "Your MongoDB Atlas Profile Name" Type: String Default: "default" PublicKey: Description: "Your MongoDB Atlas Public API Key" Type: String Default: "PublicKey" NoEcho: true PrivateKey: Description: "Your MongoDB Atlas Private API Key" Type: String Default: "PrivateKey" NoEcho: true BaseUrl: Description: "Defines the base URL of Atlas API" Type: String Default: "https://cloud.mongodb.com" Resources: AtlasApiKeySecret: Type: 'AWS::SecretsManager::Secret' Properties: Name: !Sub "cfn/atlas/profile/${ProfileName}" Description: MongoDB Atlas API Key SecretString: !Join ['', ['{"PublicKey":"', !Ref "PublicKey",'", "PrivateKey":"', !Ref "PrivateKey",'", "BaseURL":"',!Ref "BaseUrl", '"}'] ] Tags: - Key: mongodb-atlas-profile-keys Value: !Sub "${AWS::StackName}"