-
Notifications
You must be signed in to change notification settings - Fork 37
/
profile-secret.yaml
31 lines (31 loc) · 1.02 KB
/
profile-secret.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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}"